2 int printf(const char*,...);
4 #if defined test_atomic_compare_exchange
11 atomic_store(&a
, b
+ 0);
12 r
= atomic_compare_exchange_strong(&a
, &b
, 99);
13 printf("%d %d %d\n", r
, a
, b
);
15 atomic_store(&a
, b
+ 3);
16 r
= atomic_compare_exchange_strong(&a
, &b
, 99);
17 printf("%d %d %d\n", r
, a
, b
);
22 #elif defined test_atomic_store
28 r
= atomic_fetch_add(&i
, i
);
29 printf("r = %d, i = %d\n", r
, i
);
32 #elif defined test_atomic_store_pointer
33 typedef struct { char c
[4]; } c4
;
40 printf("*p = %d\n", *p
);
43 #elif defined test_atomic_store_struct
44 typedef struct { char c
[4]; } c4
;
50 printf("%d %d %d %d\n", p
.c
[0], p
.c
[1], p
.c
[2], p
.c
[3]);
53 #elif defined test_atomic_error_1
60 #elif defined test_atomic_error_2
63 struct { char c
[3]; } _Atomic c3
;
67 #elif defined test_atomic_error_3
71 atomic_fetch_add(&p
, 1);
74 #elif defined test_atomic_error_4
79 atomic_compare_exchange_strong(&i
, &c
, 0);
82 #elif defined test_atomic_warn_1
86 /* assignment to integer from pointer */
90 #elif defined test_atomic_warn_2
96 /* assignment from incompatible pointer */
100 #elif defined test_atomic_warn_3
104 /* assignment to read-only -location */
105 atomic_fetch_add(&i
, 2);