xref: /llvm-project/llvm/test/CodeGen/X86/2012-01-16-mfence-nosse-flags.ll (revision 2f448bf509432c1a19ec46ab8cbc7353c03c6280)
1; RUN: llc < %s -verify-machineinstrs -mtriple=i686-linux -mattr=-sse | FileCheck %s
2; PR11768
3
4@ptr = external dso_local global ptr
5
6define void @baz() nounwind ssp {
7entry:
8  %0 = load ptr, ptr @ptr, align 4
9  %cmp = icmp eq ptr %0, null
10  fence seq_cst
11  br i1 %cmp, label %if.then, label %if.else
12
13; Make sure the fence comes before the comparison, since it
14; clobbers EFLAGS.
15
16; CHECK: lock orl {{.*}}, (%esp)
17; CHECK-NEXT: testl [[REG:%e[a-z]+]], [[REG]]
18
19if.then:                                          ; preds = %entry
20  tail call void @foo() nounwind
21  br label %if.end
22
23if.else:                                          ; preds = %entry
24  tail call void @bar() nounwind
25  br label %if.end
26
27if.end:                                           ; preds = %if.else, %if.then
28  ret void
29}
30
31declare void @foo(...)
32
33declare void @bar(...)
34