From 36c49e3f258dced101949edabd72e9bc3f1dedc4 Mon Sep 17 00:00:00 2001 From: dim Date: Fri, 17 Sep 2010 15:54:40 +0000 Subject: Vendor import of clang r114020 (from the release_28 branch): http://llvm.org/svn/llvm-project/cfe/branches/release_28@114020 Approved by: rpaulo (mentor) --- test/CodeGen/atomic.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'test/CodeGen/atomic.c') diff --git a/test/CodeGen/atomic.c b/test/CodeGen/atomic.c index aa5aa15..d0a7e04 100644 --- a/test/CodeGen/atomic.c +++ b/test/CodeGen/atomic.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin9 > %t1 -// RUN: grep @llvm.memory.barrier %t1 | count 38 +// RUN: grep @llvm.memory.barrier %t1 | count 42 // RUN: grep @llvm.atomic.load.add.i32 %t1 | count 3 // RUN: grep @llvm.atomic.load.sub.i8 %t1 | count 2 // RUN: grep @llvm.atomic.load.min.i32 %t1 @@ -7,7 +7,7 @@ // RUN: grep @llvm.atomic.load.umin.i32 %t1 // RUN: grep @llvm.atomic.load.umax.i32 %t1 // RUN: grep @llvm.atomic.swap.i32 %t1 -// RUN: grep @llvm.atomic.cmp.swap.i32 %t1 | count 4 +// RUN: grep @llvm.atomic.cmp.swap.i32 %t1 | count 5 // RUN: grep @llvm.atomic.load.and.i32 %t1 // RUN: grep @llvm.atomic.load.or.i8 %t1 // RUN: grep @llvm.atomic.load.xor.i8 %t1 @@ -19,6 +19,7 @@ int atomic(void) int old; int val = 1; char valc = 1; + _Bool valb = 0; unsigned int uval = 1; int cmp = 0; @@ -43,10 +44,18 @@ int atomic(void) __sync_val_compare_and_swap((void **)0, (void *)0, (void *)0); - + if ( __sync_val_compare_and_swap(&valb, 0, 1)) { + old = 42; + } + __sync_bool_compare_and_swap((void **)0, (void *)0, (void *)0); __sync_lock_release(&val); __sync_synchronize (); return old; } + +void release_return(int *lock) { + // Ensure this is actually returning void all the way through. + return __sync_lock_release(lock); +} -- cgit v1.1