diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-05-15 21:06:54 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-05-15 21:06:54 +0000 |
commit | 39f229fdd3084dc995a1b45d94cde435c3a0a180 (patch) | |
tree | 0783bc0ea824e9b18c5944d39df2a7d368191a18 /test | |
parent | f13140f28618c26e2698d8026d86849f2ec0edfb (diff) |
Merging r181728:
------------------------------------------------------------------------
r181728 | rafael | 2013-05-13 13:09:47 -0700 (Mon, 13 May 2013) | 6 lines
Use atomic instructions on ARM linux.
This is safe given how the pre-v6 atomic ops funcions in libgcc are
implemented.
This fixes pr15429.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_33@181919 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/linux-arm-atomic.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CodeGen/linux-arm-atomic.c b/test/CodeGen/linux-arm-atomic.c new file mode 100644 index 0000000000..3fda7f688c --- /dev/null +++ b/test/CodeGen/linux-arm-atomic.c @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv7-unknown-linux | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv6-unknown-linux | FileCheck %s + +typedef int _Atomic_word; +_Atomic_word exchange_and_add(volatile _Atomic_word *__mem, int __val) { + return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); +} + +// CHECK: define {{.*}} @exchange_and_add +// CHECK: atomicrmw {{.*}} add |