• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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).
7define void @foo(%struct.Foo* align 4 %a) {
8entry:
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
17define fastcc void @bar(%struct.Foo* align 4 %a) {
18; CHECK-LABEL: @bar
19entry:
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
23if.then.i.i:
24  call void @llvm.assume(i1 undef)
25  unreachable
26
27if.end:
28  ret void
29}
30
31declare void @llvm.assume(i1)
32