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