2 * This test performs some relaxes, release, acquire opeations on a single
3 * atomic variable. It can give some rough idea of release sequence support but
4 * probably should be improved to give better information.
16 static void a(void *obj)
19 atomic_store_explicit(&x, 1, memory_order_release);
20 atomic_store_explicit(&x, 42, memory_order_relaxed);
23 static void b(void *obj)
25 int r = atomic_load_explicit(&x, memory_order_acquire);
26 printf("r = %d\n", r);
27 printf("load %d\n", load_32(&var));
30 static void c(void *obj)
32 atomic_store_explicit(&x, 2, memory_order_relaxed);
35 int user_main(int argc, char **argv)
41 printf("Main thread: creating 3 threads\n");
42 thrd_create(&t1, (thrd_start_t)&a, NULL);
43 thrd_create(&t2, (thrd_start_t)&b, NULL);
44 thrd_create(&t3, (thrd_start_t)&c, NULL);
49 printf("Main thread is finished\n");