Taints the non-acquire RMW's store address with the load part
[oota-llvm.git] / test / Transforms / Inline / inline-assume.ll
1 ; RUN: opt -inline -S -o - < %s | FileCheck %s
2
3 %0 = type opaque
4 %struct.Foo = type { i32, %0* }
5
6 ; Test that we don't crash when inlining @bar (rdar://22521387).
7 define void @foo(%struct.Foo* align 4 %a) {
8 entry:
9   call fastcc void @bar(%struct.Foo* nonnull align 4 undef)
10
11 ; CHECK: call void @llvm.assume(i1 undef)
12 ; CHECK: unreachable
13
14   ret void
15 }
16
17 define fastcc void @bar(%struct.Foo* align 4 %a) {
18 ; CHECK-LABEL: @bar
19 entry:
20   %b = getelementptr inbounds %struct.Foo, %struct.Foo* %a, i32 0, i32 1
21   br i1 undef, label %if.end, label %if.then.i.i
22
23 if.then.i.i:
24   call void @llvm.assume(i1 undef)
25   unreachable
26
27 if.end:
28   ret void
29 }
30
31 declare void @llvm.assume(i1)