ADTarm-ehast-experimentalcleanup-dtorsenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change
on this file since 6a9d4b4 was
73abe95,
checked in by Thierry Delisle <tdelisle@…>, 6 years ago
|
Replace extension-less headers with .hfa
|
-
Property mode set to
100644
|
File size:
720 bytes
|
Line | |
---|
1 | #include <kernel.hfa> |
---|
2 | #include <math.hfa> |
---|
3 | #include <thread.hfa> |
---|
4 | #include <time.hfa> |
---|
5 | |
---|
6 | #define __kick_rate 5000000ul |
---|
7 | #include "long_tests.h" |
---|
8 | |
---|
9 | #ifndef PREEMPTION_RATE |
---|
10 | #error PREEMPTION_RATE not defined in makefile |
---|
11 | #endif |
---|
12 | |
---|
13 | Duration default_preemption() { |
---|
14 | return PREEMPTION_RATE; |
---|
15 | } |
---|
16 | |
---|
17 | thread worker_t {}; |
---|
18 | |
---|
19 | void main(worker_t & this) { |
---|
20 | while(TEST(0)) { |
---|
21 | volatile long long p = 5_021_609ul; |
---|
22 | volatile long long a = 326_417ul; |
---|
23 | volatile long long n = 1l; |
---|
24 | for (volatile long long i = 0; i < p; i++) { |
---|
25 | n *= a; |
---|
26 | n %= p; |
---|
27 | KICK_WATCHDOG; |
---|
28 | } |
---|
29 | |
---|
30 | if( !TEST(n == a) ) { |
---|
31 | abort(); |
---|
32 | } |
---|
33 | } |
---|
34 | } |
---|
35 | |
---|
36 | extern "C" { |
---|
37 | static worker_t * workers; |
---|
38 | } |
---|
39 | |
---|
40 | int main(int argc, char* argv[]) { |
---|
41 | processor p; |
---|
42 | { |
---|
43 | worker_t w[7]; |
---|
44 | workers = w; |
---|
45 | } |
---|
46 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.