aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-08-19 23:09:18 +0000
committerBill Wendling <isanbard@gmail.com>2008-08-19 23:09:18 +0000
commit108ecf397578946a5f34fc90f22cdd0c9ca4448a (patch)
treee869831aa6509ecacf3aa2406d6c572e7da6397d /test
parentd3aedf445c4c969c2026e3a1cc02265c5eb79a42 (diff)
downloadexternal_llvm-108ecf397578946a5f34fc90f22cdd0c9ca4448a.zip
external_llvm-108ecf397578946a5f34fc90f22cdd0c9ca4448a.tar.gz
external_llvm-108ecf397578946a5f34fc90f22cdd0c9ca4448a.tar.bz2
Add support for the __sync_sub_and_fetch atomics and friends for X86. The code
was already present, but not hooked up to anything. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55018 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/2008-08-19-SubAndFetch.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGen/X86/2008-08-19-SubAndFetch.ll b/test/CodeGen/X86/2008-08-19-SubAndFetch.ll
new file mode 100644
index 0000000..00bcdf8
--- /dev/null
+++ b/test/CodeGen/X86/2008-08-19-SubAndFetch.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=x86-64 | grep xadd
+
+@var = external global i64 ; <i64*> [#uses=1]
+
+define i32 @main() nounwind {
+entry:
+ tail call i64 @llvm.atomic.load.sub.i64.p0i64( i64* @var, i64 1 ) ; <i64>:0 [#uses=0]
+ unreachable
+}
+
+declare i64 @llvm.atomic.load.sub.i64.p0i64(i64*, i64) nounwind