1 /* Validate that the __sync builtins are overloaded properly. */
2 /* { dg-do compile } */
3 /* { dg-options "-Werror" } */
5 #define TEST1(TYPE, BUILTIN) \
6 void t_##TYPE##BUILTIN(TYPE *p) \
8 __typeof(BUILTIN(p, 1)) *pp; \
12 #define TEST2(BUILTIN) \
16 TEST2(__sync_fetch_and_add
)
17 TEST2(__sync_fetch_and_sub
)
18 TEST2(__sync_fetch_and_or
)
19 TEST2(__sync_fetch_and_and
)
20 TEST2(__sync_fetch_and_xor
)
21 TEST2(__sync_fetch_and_nand
)
23 TEST2(__sync_add_and_fetch
)
24 TEST2(__sync_sub_and_fetch
)
25 TEST2(__sync_or_and_fetch
)
26 TEST2(__sync_and_and_fetch
)
27 TEST2(__sync_xor_and_fetch
)
28 TEST2(__sync_nand_and_fetch
)
30 TEST2(__sync_lock_test_and_set
)
33 void t_##TYPE##__sync_val_compare_and_swap(TYPE *p) \
35 __typeof(__sync_val_compare_and_swap(p, 1, 2)) *pp; \