summaryrefslogtreecommitdiffstats
path: root/test/Sema/builtins.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
committerdim <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
commit056abd2059c65a3e908193aeae16fad98017437c (patch)
tree2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /test/Sema/builtins.c
parentcc73504950eb7b5dff2dded9bedd67bc36d64641 (diff)
downloadFreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.zip
FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.tar.gz
Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2):
http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974
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