source: src/tests/preempt_longrun/stack.c@ 704d11e

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr no_list persistent-indexer pthread-emulation qualifiedEnum
Last change on this file since 704d11e was 7bdcac1, checked in by Thierry Delisle <tdelisle@…>, 7 years ago

Added the option to make longrun tests run until failure

  • Property mode set to 100644
File size: 648 bytes
Line 
1#include <kernel>
2#include <math>
3#include <thread>
4#include <time>
5
6#include "long_tests.h"
7
8#ifndef PREEMPTION_RATE
9#error PREEMPTION_RATE not defined in makefile
10#endif
11
12Duration default_preemption() {
13 return PREEMPTION_RATE;
14}
15
16thread worker_t {};
17
18void main(worker_t & this) {
19 volatile long long p = 5_021_609ul;
20 volatile long long a = 326_417ul;
21 volatile long long n = 1l;
22 for (volatile long long i = 0; TEST(i < p); i++) {
23 n *= a;
24 n %= p;
25 KICK_WATCHDOG;
26 }
27
28 if( !TEST(n == a) ) {
29 abort();
30 }
31}
32
33extern "C" {
34static worker_t * workers;
35}
36
37int main(int argc, char* argv[]) {
38 processor p;
39 {
40 worker_t w[7];
41 workers = w;
42 }
43}
Note: See TracBrowser for help on using the repository browser.