aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/2012-01-16-mfence-nosse-flags.ll
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-01-16 16:42:21 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-01-16 16:42:21 +0000
commit1857b51ef57697992afe3955f5f90e79612142d8 (patch)
tree93b0a926c41df3c852d0e7e1c78657b5ff745f43 /test/CodeGen/X86/2012-01-16-mfence-nosse-flags.ll
parenta20b71518a9d27aa902d1044599bb1b659c93bce (diff)
downloadexternal_llvm-1857b51ef57697992afe3955f5f90e79612142d8.zip
external_llvm-1857b51ef57697992afe3955f5f90e79612142d8.tar.gz
external_llvm-1857b51ef57697992afe3955f5f90e79612142d8.tar.bz2
Make sure the non-SSE lowering for fences correctly clobbers EFLAGS. PR11768.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148240 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/2012-01-16-mfence-nosse-flags.ll')
-rw-r--r--test/CodeGen/X86/2012-01-16-mfence-nosse-flags.ll34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/CodeGen/X86/2012-01-16-mfence-nosse-flags.ll b/test/CodeGen/X86/2012-01-16-mfence-nosse-flags.ll
new file mode 100644
index 0000000..a883d79
--- /dev/null
+++ b/test/CodeGen/X86/2012-01-16-mfence-nosse-flags.ll
@@ -0,0 +1,34 @@
+; RUN: llc < %s -mtriple=i686-linux -mattr=-sse | FileCheck %s
+; PR11768
+
+@ptr = external global i8*
+
+define void @baz() nounwind ssp {
+entry:
+ %0 = load i8** @ptr, align 4
+ %cmp = icmp eq i8* %0, null
+ fence seq_cst
+ br i1 %cmp, label %if.then, label %if.else
+
+; Make sure the fence comes before the comparison, since it
+; clobbers EFLAGS.
+
+; CHECK: lock
+; CHECK-NEXT: orl {{.*}}, (%esp)
+; CHECK-NEXT: cmpl $0
+
+if.then: ; preds = %entry
+ tail call void bitcast (void (...)* @foo to void ()*)() nounwind
+ br label %if.end
+
+if.else: ; preds = %entry
+ tail call void bitcast (void (...)* @bar to void ()*)() nounwind
+ br label %if.end
+
+if.end: ; preds = %if.else, %if.then
+ ret void
+}
+
+declare void @foo(...)
+
+declare void @bar(...)