Remove C/C++11 header files that we don't really use
[satcheck.git] / clang / test / userprog2_unannotated.c
1 #include <stdio.h>
2 #include <threads.h>
3
4 #include "libinterface.h"
5
6 int x;
7 int y;
8 int gr1;
9 int gr2;
10
11 static void a(void *obj)
12 {
13         int r1=load_32(&y);
14         if (r1) {
15                 r1=42;
16         } else {
17                 r1=0;
18         }
19
20         store_32(&x, r1);
21
22         store_32(&gr1, r1);
23         printf("r1=%d\n",r1);
24 }
25
26 static void b(void *obj)
27 {
28         int r2=load_32(&x);
29         store_32(&y, 42);
30
31         store_32(&gr2, r2);
32         printf("r2=%d\n",r2);
33 }
34
35 int user_main(int argc, char **argv)
36 {
37         thrd_t t1, t2;
38
39         store_32(&x, 0);
40         store_32(&y, 0);
41
42         printf("Main thread: creating 2 threads\n");
43         thrd_create(&t1, (thrd_start_t)&a, NULL);
44         thrd_create(&t2, (thrd_start_t)&b, NULL);
45
46         thrd_join(t1);
47         thrd_join(t2);
48         printf("Main thread is finished\n");
49         int lgr1=load_32(&gr1);
50
51         int lgr2=load_32(&gr2);
52         if (lgr1==42) {
53                 if (lgr2==42) {
54                 } else {
55                 }
56         } else {
57         }
58
59         return 0;
60 }