1// RUN: %clang_cc1 %s -verify -fsyntax-only -triple=i686-linux-gnu -std=c11
2
3// Basic parsing/Sema tests for __c11_atomic_*
4
5typedef enum memory_order {
6  memory_order_relaxed, memory_order_consume, memory_order_acquire,
7  memory_order_release, memory_order_acq_rel, memory_order_seq_cst
8} memory_order;
9
10struct S { char c[3]; };
11
12_Static_assert(__GCC_ATOMIC_BOOL_LOCK_FREE == 2, "");
13_Static_assert(__GCC_ATOMIC_CHAR_LOCK_FREE == 2, "");
14_Static_assert(__GCC_ATOMIC_CHAR16_T_LOCK_FREE == 2, "");
15_Static_assert(__GCC_ATOMIC_CHAR32_T_LOCK_FREE == 2, "");
16_Static_assert(__GCC_ATOMIC_WCHAR_T_LOCK_FREE == 2, "");
17_Static_assert(__GCC_ATOMIC_SHORT_LOCK_FREE == 2, "");
18_Static_assert(__GCC_ATOMIC_INT_LOCK_FREE == 2, "");
19_Static_assert(__GCC_ATOMIC_LONG_LOCK_FREE == 2, "");
20#ifdef __i386__
21_Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 1, "");
22#else
23_Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 2, "");
24#endif
25_Static_assert(__GCC_ATOMIC_POINTER_LOCK_FREE == 2, "");
26
27_Static_assert(__c11_atomic_is_lock_free(1), "");
28_Static_assert(__c11_atomic_is_lock_free(2), "");
29_Static_assert(__c11_atomic_is_lock_free(3), ""); // expected-error {{not an integral constant expression}}
30_Static_assert(__c11_atomic_is_lock_free(4), "");
31_Static_assert(__c11_atomic_is_lock_free(8), "");
32_Static_assert(__c11_atomic_is_lock_free(16), ""); // expected-error {{not an integral constant expression}}
33_Static_assert(__c11_atomic_is_lock_free(17), ""); // expected-error {{not an integral constant expression}}
34
35_Static_assert(__atomic_is_lock_free(1, 0), "");
36_Static_assert(__atomic_is_lock_free(2, 0), "");
37_Static_assert(__atomic_is_lock_free(3, 0), ""); // expected-error {{not an integral constant expression}}
38_Static_assert(__atomic_is_lock_free(4, 0), "");
39_Static_assert(__atomic_is_lock_free(8, 0), "");
40_Static_assert(__atomic_is_lock_free(16, 0), ""); // expected-error {{not an integral constant expression}}
41_Static_assert(__atomic_is_lock_free(17, 0), ""); // expected-error {{not an integral constant expression}}
42
43char i8;
44short i16;
45int i32;
46int __attribute__((vector_size(8))) i64;
47struct Incomplete *incomplete;
48
49_Static_assert(__atomic_is_lock_free(1, &i8), "");
50_Static_assert(__atomic_is_lock_free(1, &i64), "");
51_Static_assert(__atomic_is_lock_free(2, &i8), ""); // expected-error {{not an integral constant expression}}
52_Static_assert(__atomic_is_lock_free(2, &i16), "");
53_Static_assert(__atomic_is_lock_free(2, &i64), "");
54_Static_assert(__atomic_is_lock_free(4, &i16), ""); // expected-error {{not an integral constant expression}}
55_Static_assert(__atomic_is_lock_free(4, &i32), "");
56_Static_assert(__atomic_is_lock_free(4, &i64), "");
57_Static_assert(__atomic_is_lock_free(8, &i32), ""); // expected-error {{not an integral constant expression}}
58_Static_assert(__atomic_is_lock_free(8, &i64), "");
59
60_Static_assert(__atomic_always_lock_free(1, 0), "");
61_Static_assert(__atomic_always_lock_free(2, 0), "");
62_Static_assert(!__atomic_always_lock_free(3, 0), "");
63_Static_assert(__atomic_always_lock_free(4, 0), "");
64_Static_assert(__atomic_always_lock_free(8, 0), "");
65_Static_assert(!__atomic_always_lock_free(16, 0), "");
66_Static_assert(!__atomic_always_lock_free(17, 0), "");
67
68_Static_assert(__atomic_always_lock_free(1, incomplete), "");
69_Static_assert(!__atomic_always_lock_free(2, incomplete), "");
70_Static_assert(!__atomic_always_lock_free(4, incomplete), "");
71
72_Static_assert(__atomic_always_lock_free(1, &i8), "");
73_Static_assert(__atomic_always_lock_free(1, &i64), "");
74_Static_assert(!__atomic_always_lock_free(2, &i8), "");
75_Static_assert(__atomic_always_lock_free(2, &i16), "");
76_Static_assert(__atomic_always_lock_free(2, &i64), "");
77_Static_assert(!__atomic_always_lock_free(4, &i16), "");
78_Static_assert(__atomic_always_lock_free(4, &i32), "");
79_Static_assert(__atomic_always_lock_free(4, &i64), "");
80_Static_assert(!__atomic_always_lock_free(8, &i32), "");
81_Static_assert(__atomic_always_lock_free(8, &i64), "");
82
83void f(_Atomic(int) *i, _Atomic(int*) *p, _Atomic(float) *d,
84       int *I, int **P, float *D, struct S *s1, struct S *s2) {
85  __c11_atomic_init(I, 5); // expected-error {{pointer to _Atomic}}
86  __c11_atomic_load(0); // expected-error {{too few arguments to function}}
87  __c11_atomic_load(0,0,0); // expected-error {{too many arguments to function}}
88  __c11_atomic_store(0,0,0); // expected-error {{address argument to atomic builtin must be a pointer}}
89  __c11_atomic_store((int*)0,0,0); // expected-error {{address argument to atomic operation must be a pointer to _Atomic}}
90
91  __c11_atomic_load(i, memory_order_seq_cst);
92  __c11_atomic_load(p, memory_order_seq_cst);
93  __c11_atomic_load(d, memory_order_seq_cst);
94
95  int load_n_1 = __atomic_load_n(I, memory_order_relaxed);
96  int *load_n_2 = __atomic_load_n(P, memory_order_relaxed);
97  float load_n_3 = __atomic_load_n(D, memory_order_relaxed); // expected-error {{must be a pointer to integer or pointer}}
98  __atomic_load_n(s1, memory_order_relaxed); // expected-error {{must be a pointer to integer or pointer}}
99
100  __atomic_load(i, I, memory_order_relaxed); // expected-error {{must be a pointer to a trivially-copyable type}}
101  __atomic_load(I, i, memory_order_relaxed); // expected-warning {{passing '_Atomic(int) *' to parameter of type 'int *'}}
102  __atomic_load(I, *P, memory_order_relaxed);
103  __atomic_load(I, *P, memory_order_relaxed, 42); // expected-error {{too many arguments}}
104  (int)__atomic_load(I, I, memory_order_seq_cst); // expected-error {{operand of type 'void'}}
105  __atomic_load(s1, s2, memory_order_acquire);
106
107  __c11_atomic_store(i, 1, memory_order_seq_cst);
108  __c11_atomic_store(p, 1, memory_order_seq_cst); // expected-warning {{incompatible integer to pointer conversion}}
109  (int)__c11_atomic_store(d, 1, memory_order_seq_cst); // expected-error {{operand of type 'void'}}
110
111  __atomic_store_n(I, 4, memory_order_release);
112  __atomic_store_n(I, 4.0, memory_order_release);
113  __atomic_store_n(I, P, memory_order_release); // expected-warning {{parameter of type 'int'}}
114  __atomic_store_n(i, 1, memory_order_release); // expected-error {{must be a pointer to integer or pointer}}
115  __atomic_store_n(s1, *s2, memory_order_release); // expected-error {{must be a pointer to integer or pointer}}
116
117  __atomic_store(I, *P, memory_order_release);
118  __atomic_store(s1, s2, memory_order_release);
119  __atomic_store(i, I, memory_order_release); // expected-error {{trivially-copyable}}
120
121  int exchange_1 = __c11_atomic_exchange(i, 1, memory_order_seq_cst);
122  int exchange_2 = __c11_atomic_exchange(I, 1, memory_order_seq_cst); // expected-error {{must be a pointer to _Atomic}}
123  int exchange_3 = __atomic_exchange_n(i, 1, memory_order_seq_cst); // expected-error {{must be a pointer to integer or pointer}}
124  int exchange_4 = __atomic_exchange_n(I, 1, memory_order_seq_cst);
125
126  __atomic_exchange(s1, s2, s2, memory_order_seq_cst);
127  __atomic_exchange(s1, I, P, memory_order_seq_cst); // expected-warning 2{{parameter of type 'struct S *'}}
128  (int)__atomic_exchange(s1, s2, s2, memory_order_seq_cst); // expected-error {{operand of type 'void'}}
129
130  __c11_atomic_fetch_add(i, 1, memory_order_seq_cst);
131  __c11_atomic_fetch_add(p, 1, memory_order_seq_cst);
132  __c11_atomic_fetch_add(d, 1, memory_order_seq_cst); // expected-error {{must be a pointer to atomic integer or pointer}}
133
134  __atomic_fetch_add(i, 3, memory_order_seq_cst); // expected-error {{pointer to integer or pointer}}
135  __atomic_fetch_sub(I, 3, memory_order_seq_cst);
136  __atomic_fetch_sub(P, 3, memory_order_seq_cst);
137  __atomic_fetch_sub(D, 3, memory_order_seq_cst); // expected-error {{must be a pointer to integer or pointer}}
138  __atomic_fetch_sub(s1, 3, memory_order_seq_cst); // expected-error {{must be a pointer to integer or pointer}}
139
140  __c11_atomic_fetch_and(i, 1, memory_order_seq_cst);
141  __c11_atomic_fetch_and(p, 1, memory_order_seq_cst); // expected-error {{must be a pointer to atomic integer}}
142  __c11_atomic_fetch_and(d, 1, memory_order_seq_cst); // expected-error {{must be a pointer to atomic integer}}
143
144  __atomic_fetch_and(i, 3, memory_order_seq_cst); // expected-error {{pointer to integer}}
145  __atomic_fetch_or(I, 3, memory_order_seq_cst);
146  __atomic_fetch_xor(P, 3, memory_order_seq_cst); // expected-error {{must be a pointer to integer}}
147  __atomic_fetch_or(D, 3, memory_order_seq_cst); // expected-error {{must be a pointer to integer}}
148  __atomic_fetch_and(s1, 3, memory_order_seq_cst); // expected-error {{must be a pointer to integer}}
149
150  _Bool cmpexch_1 = __c11_atomic_compare_exchange_strong(i, 0, 1, memory_order_seq_cst, memory_order_seq_cst);
151  _Bool cmpexch_2 = __c11_atomic_compare_exchange_strong(p, 0, (int*)1, memory_order_seq_cst, memory_order_seq_cst);
152  _Bool cmpexch_3 = __c11_atomic_compare_exchange_strong(d, (int*)0, 1, memory_order_seq_cst, memory_order_seq_cst); // expected-warning {{incompatible pointer types}}
153
154  _Bool cmpexch_4 = __atomic_compare_exchange_n(I, I, 5, 1, memory_order_seq_cst, memory_order_seq_cst);
155  _Bool cmpexch_5 = __atomic_compare_exchange_n(I, P, 5, 0, memory_order_seq_cst, memory_order_seq_cst); // expected-warning {{; dereference with *}}
156  _Bool cmpexch_6 = __atomic_compare_exchange_n(I, I, P, 0, memory_order_seq_cst, memory_order_seq_cst); // expected-warning {{passing 'int **' to parameter of type 'int'}}
157
158  _Bool cmpexch_7 = __atomic_compare_exchange(I, I, 5, 1, memory_order_seq_cst, memory_order_seq_cst); // expected-warning {{passing 'int' to parameter of type 'int *'}}
159  _Bool cmpexch_8 = __atomic_compare_exchange(I, P, I, 0, memory_order_seq_cst, memory_order_seq_cst); // expected-warning {{; dereference with *}}
160  _Bool cmpexch_9 = __atomic_compare_exchange(I, I, I, 0, memory_order_seq_cst, memory_order_seq_cst);
161
162  const volatile int flag_k = 0;
163  volatile int flag = 0;
164  (void)(int)__atomic_test_and_set(&flag_k, memory_order_seq_cst); // expected-warning {{passing 'const volatile int *' to parameter of type 'volatile void *'}}
165  (void)(int)__atomic_test_and_set(&flag, memory_order_seq_cst);
166  __atomic_clear(&flag_k, memory_order_seq_cst); // expected-warning {{passing 'const volatile int *' to parameter of type 'volatile void *'}}
167  __atomic_clear(&flag, memory_order_seq_cst);
168  (int)__atomic_clear(&flag, memory_order_seq_cst); // expected-error {{operand of type 'void'}}
169
170  const _Atomic(int) const_atomic;
171  __c11_atomic_init(&const_atomic, 0); // expected-error {{address argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}}
172  __c11_atomic_store(&const_atomic, 0, memory_order_release); // expected-error {{address argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}}
173  __c11_atomic_load(&const_atomic, memory_order_acquire); // expected-error {{address argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(int) *' invalid)}}
174}
175
176_Atomic(int*) PR12527_a;
177void PR12527() { int *b = PR12527_a; }
178
179void PR16931(int* x) { // expected-note {{passing argument to parameter 'x' here}}
180  typedef struct { _Atomic(_Bool) flag; } flag;
181  flag flagvar = { 0 };
182  PR16931(&flagvar); // expected-warning {{incompatible pointer types}}
183}
184
185void memory_checks(_Atomic(int) *Ap, int *p, int val) {
186  (void)__c11_atomic_load(Ap, memory_order_relaxed);
187  (void)__c11_atomic_load(Ap, memory_order_acquire);
188  (void)__c11_atomic_load(Ap, memory_order_consume);
189  (void)__c11_atomic_load(Ap, memory_order_release); // expected-warning {{memory order argument to atomic operation is invalid}}
190  (void)__c11_atomic_load(Ap, memory_order_acq_rel); // expected-warning {{memory order argument to atomic operation is invalid}}
191  (void)__c11_atomic_load(Ap, memory_order_seq_cst);
192  (void)__c11_atomic_load(Ap, val);
193  (void)__c11_atomic_load(Ap, -1); // expected-warning {{memory order argument to atomic operation is invalid}}
194  (void)__c11_atomic_load(Ap, 42); // expected-warning {{memory order argument to atomic operation is invalid}}
195
196  (void)__c11_atomic_store(Ap, val, memory_order_relaxed);
197  (void)__c11_atomic_store(Ap, val, memory_order_acquire); // expected-warning {{memory order argument to atomic operation is invalid}}
198  (void)__c11_atomic_store(Ap, val, memory_order_consume); // expected-warning {{memory order argument to atomic operation is invalid}}
199  (void)__c11_atomic_store(Ap, val, memory_order_release);
200  (void)__c11_atomic_store(Ap, val, memory_order_acq_rel); // expected-warning {{memory order argument to atomic operation is invalid}}
201  (void)__c11_atomic_store(Ap, val, memory_order_seq_cst);
202
203  (void)__c11_atomic_fetch_add(Ap, 1, memory_order_relaxed);
204  (void)__c11_atomic_fetch_add(Ap, 1, memory_order_acquire);
205  (void)__c11_atomic_fetch_add(Ap, 1, memory_order_consume);
206  (void)__c11_atomic_fetch_add(Ap, 1, memory_order_release);
207  (void)__c11_atomic_fetch_add(Ap, 1, memory_order_acq_rel);
208  (void)__c11_atomic_fetch_add(Ap, 1, memory_order_seq_cst);
209
210  (void)__c11_atomic_init(Ap, val);
211  (void)__c11_atomic_init(Ap, val);
212  (void)__c11_atomic_init(Ap, val);
213  (void)__c11_atomic_init(Ap, val);
214  (void)__c11_atomic_init(Ap, val);
215  (void)__c11_atomic_init(Ap, val);
216
217  (void)__c11_atomic_fetch_sub(Ap, val, memory_order_relaxed);
218  (void)__c11_atomic_fetch_sub(Ap, val, memory_order_acquire);
219  (void)__c11_atomic_fetch_sub(Ap, val, memory_order_consume);
220  (void)__c11_atomic_fetch_sub(Ap, val, memory_order_release);
221  (void)__c11_atomic_fetch_sub(Ap, val, memory_order_acq_rel);
222  (void)__c11_atomic_fetch_sub(Ap, val, memory_order_seq_cst);
223
224  (void)__c11_atomic_fetch_and(Ap, val, memory_order_relaxed);
225  (void)__c11_atomic_fetch_and(Ap, val, memory_order_acquire);
226  (void)__c11_atomic_fetch_and(Ap, val, memory_order_consume);
227  (void)__c11_atomic_fetch_and(Ap, val, memory_order_release);
228  (void)__c11_atomic_fetch_and(Ap, val, memory_order_acq_rel);
229  (void)__c11_atomic_fetch_and(Ap, val, memory_order_seq_cst);
230
231  (void)__c11_atomic_fetch_or(Ap, val, memory_order_relaxed);
232  (void)__c11_atomic_fetch_or(Ap, val, memory_order_acquire);
233  (void)__c11_atomic_fetch_or(Ap, val, memory_order_consume);
234  (void)__c11_atomic_fetch_or(Ap, val, memory_order_release);
235  (void)__c11_atomic_fetch_or(Ap, val, memory_order_acq_rel);
236  (void)__c11_atomic_fetch_or(Ap, val, memory_order_seq_cst);
237
238  (void)__c11_atomic_fetch_xor(Ap, val, memory_order_relaxed);
239  (void)__c11_atomic_fetch_xor(Ap, val, memory_order_acquire);
240  (void)__c11_atomic_fetch_xor(Ap, val, memory_order_consume);
241  (void)__c11_atomic_fetch_xor(Ap, val, memory_order_release);
242  (void)__c11_atomic_fetch_xor(Ap, val, memory_order_acq_rel);
243  (void)__c11_atomic_fetch_xor(Ap, val, memory_order_seq_cst);
244
245  (void)__c11_atomic_exchange(Ap, val, memory_order_relaxed);
246  (void)__c11_atomic_exchange(Ap, val, memory_order_acquire);
247  (void)__c11_atomic_exchange(Ap, val, memory_order_consume);
248  (void)__c11_atomic_exchange(Ap, val, memory_order_release);
249  (void)__c11_atomic_exchange(Ap, val, memory_order_acq_rel);
250  (void)__c11_atomic_exchange(Ap, val, memory_order_seq_cst);
251
252  (void)__c11_atomic_compare_exchange_strong(Ap, p, val, memory_order_relaxed, memory_order_relaxed);
253  (void)__c11_atomic_compare_exchange_strong(Ap, p, val, memory_order_acquire, memory_order_relaxed);
254  (void)__c11_atomic_compare_exchange_strong(Ap, p, val, memory_order_consume, memory_order_relaxed);
255  (void)__c11_atomic_compare_exchange_strong(Ap, p, val, memory_order_release, memory_order_relaxed);
256  (void)__c11_atomic_compare_exchange_strong(Ap, p, val, memory_order_acq_rel, memory_order_relaxed);
257  (void)__c11_atomic_compare_exchange_strong(Ap, p, val, memory_order_seq_cst, memory_order_relaxed);
258
259  (void)__c11_atomic_compare_exchange_weak(Ap, p, val, memory_order_relaxed, memory_order_relaxed);
260  (void)__c11_atomic_compare_exchange_weak(Ap, p, val, memory_order_acquire, memory_order_relaxed);
261  (void)__c11_atomic_compare_exchange_weak(Ap, p, val, memory_order_consume, memory_order_relaxed);
262  (void)__c11_atomic_compare_exchange_weak(Ap, p, val, memory_order_release, memory_order_relaxed);
263  (void)__c11_atomic_compare_exchange_weak(Ap, p, val, memory_order_acq_rel, memory_order_relaxed);
264  (void)__c11_atomic_compare_exchange_weak(Ap, p, val, memory_order_seq_cst, memory_order_relaxed);
265
266  (void)__atomic_load_n(p, memory_order_relaxed);
267  (void)__atomic_load_n(p, memory_order_acquire);
268  (void)__atomic_load_n(p, memory_order_consume);
269  (void)__atomic_load_n(p, memory_order_release); // expected-warning {{memory order argument to atomic operation is invalid}}
270  (void)__atomic_load_n(p, memory_order_acq_rel); // expected-warning {{memory order argument to atomic operation is invalid}}
271  (void)__atomic_load_n(p, memory_order_seq_cst);
272
273  (void)__atomic_load(p, p, memory_order_relaxed);
274  (void)__atomic_load(p, p, memory_order_acquire);
275  (void)__atomic_load(p, p, memory_order_consume);
276  (void)__atomic_load(p, p, memory_order_release); // expected-warning {{memory order argument to atomic operation is invalid}}
277  (void)__atomic_load(p, p, memory_order_acq_rel); // expected-warning {{memory order argument to atomic operation is invalid}}
278  (void)__atomic_load(p, p, memory_order_seq_cst);
279
280  (void)__atomic_store(p, p, memory_order_relaxed);
281  (void)__atomic_store(p, p, memory_order_acquire); // expected-warning {{memory order argument to atomic operation is invalid}}
282  (void)__atomic_store(p, p, memory_order_consume); // expected-warning {{memory order argument to atomic operation is invalid}}
283  (void)__atomic_store(p, p, memory_order_release);
284  (void)__atomic_store(p, p, memory_order_acq_rel); // expected-warning {{memory order argument to atomic operation is invalid}}
285  (void)__atomic_store(p, p, memory_order_seq_cst);
286
287  (void)__atomic_store_n(p, val, memory_order_relaxed);
288  (void)__atomic_store_n(p, val, memory_order_acquire); // expected-warning {{memory order argument to atomic operation is invalid}}
289  (void)__atomic_store_n(p, val, memory_order_consume); // expected-warning {{memory order argument to atomic operation is invalid}}
290  (void)__atomic_store_n(p, val, memory_order_release);
291  (void)__atomic_store_n(p, val, memory_order_acq_rel); // expected-warning {{memory order argument to atomic operation is invalid}}
292  (void)__atomic_store_n(p, val, memory_order_seq_cst);
293
294  (void)__atomic_fetch_add(p, val, memory_order_relaxed);
295  (void)__atomic_fetch_add(p, val, memory_order_acquire);
296  (void)__atomic_fetch_add(p, val, memory_order_consume);
297  (void)__atomic_fetch_add(p, val, memory_order_release);
298  (void)__atomic_fetch_add(p, val, memory_order_acq_rel);
299  (void)__atomic_fetch_add(p, val, memory_order_seq_cst);
300
301  (void)__atomic_fetch_sub(p, val, memory_order_relaxed);
302  (void)__atomic_fetch_sub(p, val, memory_order_acquire);
303  (void)__atomic_fetch_sub(p, val, memory_order_consume);
304  (void)__atomic_fetch_sub(p, val, memory_order_release);
305  (void)__atomic_fetch_sub(p, val, memory_order_acq_rel);
306  (void)__atomic_fetch_sub(p, val, memory_order_seq_cst);
307
308  (void)__atomic_add_fetch(p, val, memory_order_relaxed);
309  (void)__atomic_add_fetch(p, val, memory_order_acquire);
310  (void)__atomic_add_fetch(p, val, memory_order_consume);
311  (void)__atomic_add_fetch(p, val, memory_order_release);
312  (void)__atomic_add_fetch(p, val, memory_order_acq_rel);
313  (void)__atomic_add_fetch(p, val, memory_order_seq_cst);
314
315  (void)__atomic_sub_fetch(p, val, memory_order_relaxed);
316  (void)__atomic_sub_fetch(p, val, memory_order_acquire);
317  (void)__atomic_sub_fetch(p, val, memory_order_consume);
318  (void)__atomic_sub_fetch(p, val, memory_order_release);
319  (void)__atomic_sub_fetch(p, val, memory_order_acq_rel);
320  (void)__atomic_sub_fetch(p, val, memory_order_seq_cst);
321
322  (void)__atomic_fetch_and(p, val, memory_order_relaxed);
323  (void)__atomic_fetch_and(p, val, memory_order_acquire);
324  (void)__atomic_fetch_and(p, val, memory_order_consume);
325  (void)__atomic_fetch_and(p, val, memory_order_release);
326  (void)__atomic_fetch_and(p, val, memory_order_acq_rel);
327  (void)__atomic_fetch_and(p, val, memory_order_seq_cst);
328
329  (void)__atomic_fetch_or(p, val, memory_order_relaxed);
330  (void)__atomic_fetch_or(p, val, memory_order_acquire);
331  (void)__atomic_fetch_or(p, val, memory_order_consume);
332  (void)__atomic_fetch_or(p, val, memory_order_release);
333  (void)__atomic_fetch_or(p, val, memory_order_acq_rel);
334  (void)__atomic_fetch_or(p, val, memory_order_seq_cst);
335
336  (void)__atomic_fetch_xor(p, val, memory_order_relaxed);
337  (void)__atomic_fetch_xor(p, val, memory_order_acquire);
338  (void)__atomic_fetch_xor(p, val, memory_order_consume);
339  (void)__atomic_fetch_xor(p, val, memory_order_release);
340  (void)__atomic_fetch_xor(p, val, memory_order_acq_rel);
341  (void)__atomic_fetch_xor(p, val, memory_order_seq_cst);
342
343  (void)__atomic_fetch_nand(p, val, memory_order_relaxed);
344  (void)__atomic_fetch_nand(p, val, memory_order_acquire);
345  (void)__atomic_fetch_nand(p, val, memory_order_consume);
346  (void)__atomic_fetch_nand(p, val, memory_order_release);
347  (void)__atomic_fetch_nand(p, val, memory_order_acq_rel);
348  (void)__atomic_fetch_nand(p, val, memory_order_seq_cst);
349
350  (void)__atomic_and_fetch(p, val, memory_order_relaxed);
351  (void)__atomic_and_fetch(p, val, memory_order_acquire);
352  (void)__atomic_and_fetch(p, val, memory_order_consume);
353  (void)__atomic_and_fetch(p, val, memory_order_release);
354  (void)__atomic_and_fetch(p, val, memory_order_acq_rel);
355  (void)__atomic_and_fetch(p, val, memory_order_seq_cst);
356
357  (void)__atomic_or_fetch(p, val, memory_order_relaxed);
358  (void)__atomic_or_fetch(p, val, memory_order_acquire);
359  (void)__atomic_or_fetch(p, val, memory_order_consume);
360  (void)__atomic_or_fetch(p, val, memory_order_release);
361  (void)__atomic_or_fetch(p, val, memory_order_acq_rel);
362  (void)__atomic_or_fetch(p, val, memory_order_seq_cst);
363
364  (void)__atomic_xor_fetch(p, val, memory_order_relaxed);
365  (void)__atomic_xor_fetch(p, val, memory_order_acquire);
366  (void)__atomic_xor_fetch(p, val, memory_order_consume);
367  (void)__atomic_xor_fetch(p, val, memory_order_release);
368  (void)__atomic_xor_fetch(p, val, memory_order_acq_rel);
369  (void)__atomic_xor_fetch(p, val, memory_order_seq_cst);
370
371  (void)__atomic_nand_fetch(p, val, memory_order_relaxed);
372  (void)__atomic_nand_fetch(p, val, memory_order_acquire);
373  (void)__atomic_nand_fetch(p, val, memory_order_consume);
374  (void)__atomic_nand_fetch(p, val, memory_order_release);
375  (void)__atomic_nand_fetch(p, val, memory_order_acq_rel);
376  (void)__atomic_nand_fetch(p, val, memory_order_seq_cst);
377
378  (void)__atomic_exchange_n(p, val, memory_order_relaxed);
379  (void)__atomic_exchange_n(p, val, memory_order_acquire);
380  (void)__atomic_exchange_n(p, val, memory_order_consume);
381  (void)__atomic_exchange_n(p, val, memory_order_release);
382  (void)__atomic_exchange_n(p, val, memory_order_acq_rel);
383  (void)__atomic_exchange_n(p, val, memory_order_seq_cst);
384
385  (void)__atomic_exchange(p, p, p, memory_order_relaxed);
386  (void)__atomic_exchange(p, p, p, memory_order_acquire);
387  (void)__atomic_exchange(p, p, p, memory_order_consume);
388  (void)__atomic_exchange(p, p, p, memory_order_release);
389  (void)__atomic_exchange(p, p, p, memory_order_acq_rel);
390  (void)__atomic_exchange(p, p, p, memory_order_seq_cst);
391
392  (void)__atomic_compare_exchange(p, p, p, 0, memory_order_relaxed, memory_order_relaxed);
393  (void)__atomic_compare_exchange(p, p, p, 0, memory_order_acquire, memory_order_relaxed);
394  (void)__atomic_compare_exchange(p, p, p, 0, memory_order_consume, memory_order_relaxed);
395  (void)__atomic_compare_exchange(p, p, p, 0, memory_order_release, memory_order_relaxed);
396  (void)__atomic_compare_exchange(p, p, p, 0, memory_order_acq_rel, memory_order_relaxed);
397  (void)__atomic_compare_exchange(p, p, p, 0, memory_order_seq_cst, memory_order_relaxed);
398
399  (void)__atomic_compare_exchange_n(p, p, val, 0, memory_order_relaxed, memory_order_relaxed);
400  (void)__atomic_compare_exchange_n(p, p, val, 0, memory_order_acquire, memory_order_relaxed);
401  (void)__atomic_compare_exchange_n(p, p, val, 0, memory_order_consume, memory_order_relaxed);
402  (void)__atomic_compare_exchange_n(p, p, val, 0, memory_order_release, memory_order_relaxed);
403  (void)__atomic_compare_exchange_n(p, p, val, 0, memory_order_acq_rel, memory_order_relaxed);
404  (void)__atomic_compare_exchange_n(p, p, val, 0, memory_order_seq_cst, memory_order_relaxed);
405}
406