summaryrefslogtreecommitdiffstats
path: root/test/Sema/builtins.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/builtins.c')
-rw-r--r--test/Sema/builtins.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/Sema/builtins.c b/test/Sema/builtins.c
index b8b0367..e3b3b7e 100644
--- a/test/Sema/builtins.c
+++ b/test/Sema/builtins.c
@@ -40,7 +40,7 @@ void test9(short v) {
old = __sync_fetch_and_add(); // expected-error {{too few arguments to function call}}
old = __sync_fetch_and_add(&old); // expected-error {{too few arguments to function call}}
- old = __sync_fetch_and_add((unsigned*)0, 42i); // expected-warning {{imaginary constants are an extension}}
+ old = __sync_fetch_and_add((unsigned*)0, 42i); // expected-warning {{imaginary constants are a GNU extension}}
// PR7600: Pointers are implicitly casted to integers and back.
void *old_ptr = __sync_val_compare_and_swap((void**)0, 0, 0);
@@ -51,6 +51,20 @@ void test9(short v) {
}
}
+// overloaded atomics should be declared only once.
+void test9_1(volatile int* ptr, int val) {
+ __sync_fetch_and_add_4(ptr, val);
+}
+void test9_2(volatile int* ptr, int val) {
+ __sync_fetch_and_add(ptr, val);
+}
+void test9_3(volatile int* ptr, int val) {
+ __sync_fetch_and_add_4(ptr, val);
+ __sync_fetch_and_add(ptr, val);
+ __sync_fetch_and_add(ptr, val);
+ __sync_fetch_and_add_4(ptr, val);
+ __sync_fetch_and_add_4(ptr, val);
+}
// rdar://7236819
void test10(void) __attribute__((noreturn));
OpenPOWER on IntegriCloud