@@ -281,6 +281,42 @@ void test21(const int *ptr) {
281
281
__atomic_fetch_add (ptr , 1 , 0 ); // expected-error {{address argument to atomic operation must be a pointer to non-const type ('const int *' invalid)}}
282
282
}
283
283
284
+ void test_ei_i42i (_ExtInt (42 ) * ptr , int value ) {
285
+ __sync_fetch_and_add (ptr , value ); // expected-error {{Atomic memory operand must have a power-of-two size}}
286
+ // expected-warning@+1 {{the semantics of this intrinsic changed with GCC version 4.4 - the newer semantics are provided here}}
287
+ __sync_nand_and_fetch (ptr , value ); // expected-error {{Atomic memory operand must have a power-of-two size}}
288
+ }
289
+
290
+ void test_ei_i64i (_ExtInt (64 ) * ptr , int value ) {
291
+ __sync_fetch_and_add (ptr , value ); // expect success
292
+ // expected-warning@+1 {{the semantics of this intrinsic changed with GCC version 4.4 - the newer semantics are provided here}}
293
+ __sync_nand_and_fetch (ptr , value ); // expect success
294
+ }
295
+
296
+ void test_ei_ii42 (int * ptr , _ExtInt (42 ) value ) {
297
+ __sync_fetch_and_add (ptr , value ); // expect success
298
+ // expected-warning@+1 {{the semantics of this intrinsic changed with GCC version 4.4 - the newer semantics are provided here}}
299
+ __sync_nand_and_fetch (ptr , value ); // expect success
300
+ }
301
+
302
+ void test_ei_ii64 (int * ptr , _ExtInt (64 ) value ) {
303
+ __sync_fetch_and_add (ptr , value ); // expect success
304
+ // expected-warning@+1 {{the semantics of this intrinsic changed with GCC version 4.4 - the newer semantics are provided here}}
305
+ __sync_nand_and_fetch (ptr , value ); // expect success
306
+ }
307
+
308
+ void test_ei_i42i42 (_ExtInt (42 ) * ptr , _ExtInt (42 ) value ) {
309
+ __sync_fetch_and_add (ptr , value ); // expected-error {{Atomic memory operand must have a power-of-two size}}
310
+ // expected-warning@+1 {{the semantics of this intrinsic changed with GCC version 4.4 - the newer semantics are provided here}}
311
+ __sync_nand_and_fetch (ptr , value ); // expected-error {{Atomic memory operand must have a power-of-two size}}
312
+ }
313
+
314
+ void test_ei_i64i64 (_ExtInt (64 ) * ptr , _ExtInt (64 ) value ) {
315
+ __sync_fetch_and_add (ptr , value ); // expect success
316
+ // expected-warning@+1 {{the semantics of this intrinsic changed with GCC version 4.4 - the newer semantics are provided here}}
317
+ __sync_nand_and_fetch (ptr , value ); // expect success
318
+ }
319
+
284
320
void test22 (void ) {
285
321
(void )__builtin_signbit (); // expected-error{{too few arguments to function call, expected 1, have 0}}
286
322
(void )__builtin_signbit (1.0 , 2.0 , 3.0 ); // expected-error{{too many arguments to function call, expected 1, have 3}}
0 commit comments