diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /test/CodeGen/atomics-inlining.c | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'test/CodeGen/atomics-inlining.c')
-rw-r--r-- | test/CodeGen/atomics-inlining.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/CodeGen/atomics-inlining.c b/test/CodeGen/atomics-inlining.c new file mode 100644 index 0000000..9b0d413 --- /dev/null +++ b/test/CodeGen/atomics-inlining.c @@ -0,0 +1,49 @@ +// RUN: %clang_cc1 -triple powerpc-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=PPC32 +// RUN: %clang_cc1 -triple powerpc64-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=PPC64 +// RUN: %clang_cc1 -triple mipsel-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=MIPS32 +// RUN: %clang_cc1 -triple mips64el-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=MIPS64 + +unsigned char c1, c2; +unsigned short s1, s2; +unsigned int i1, i2; +unsigned long long ll1, ll2; + +enum memory_order { + memory_order_relaxed, + memory_order_consume, + memory_order_acquire, + memory_order_release, + memory_order_acq_rel, + memory_order_seq_cst +}; + +void test1(void) { + (void)__atomic_load(&c1, &c2, memory_order_seq_cst); + (void)__atomic_load(&s1, &s2, memory_order_seq_cst); + (void)__atomic_load(&i1, &i2, memory_order_seq_cst); + (void)__atomic_load(&ll1, &ll2, memory_order_seq_cst); + +// PPC32: define void @test1 +// PPC32: load atomic i8* @c1 seq_cst +// PPC32: load atomic i16* @s1 seq_cst +// PPC32: load atomic i32* @i1 seq_cst +// PPC32: call void @__atomic_load(i32 8, i8* bitcast (i64* @ll1 to i8*) + +// PPC64: define void @test1 +// PPC64: load atomic i8* @c1 seq_cst +// PPC64: load atomic i16* @s1 seq_cst +// PPC64: load atomic i32* @i1 seq_cst +// PPC64: load atomic i64* @ll1 seq_cst + +// MIPS32: define void @test1 +// MIPS32: load atomic i8* @c1 seq_cst +// MIPS32: load atomic i16* @s1 seq_cst +// MIPS32: load atomic i32* @i1 seq_cst +// MIPS32: call void @__atomic_load(i32 8, i8* bitcast (i64* @ll1 to i8*) + +// MIPS64: define void @test1 +// MIPS64: load atomic i8* @c1 seq_cst +// MIPS64: load atomic i16* @s1 seq_cst +// MIPS64: load atomic i32* @i1 seq_cst +// MIPS64: load atomic i64* @ll1 seq_cst +} |