summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
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
commit206ca569aad8551e3e05a3d773f70e6baadfde8c (patch)
tree0498dd1ffe718788e01c98f2db8e71805226493f /llvm/test/CodeGen
parent75e3db4c7ac67c8966dfa3c28a68b1d4edd55112 (diff)
downloadbcm5719-llvm-206ca569aad8551e3e05a3d773f70e6baadfde8c.tar.gz
bcm5719-llvm-206ca569aad8551e3e05a3d773f70e6baadfde8c.zip
Make sure the non-SSE lowering for fences correctly clobbers EFLAGS. PR11768.
llvm-svn: 148240
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/X86/2012-01-16-mfence-nosse-flags.ll34
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/2012-01-16-mfence-nosse-flags.ll b/llvm/test/CodeGen/X86/2012-01-16-mfence-nosse-flags.ll
new file mode 100644
index 00000000000..a883d7938b5
--- /dev/null
+++ b/llvm/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(...)
OpenPOWER on IntegriCloud