blob: b79422172530ed65afe88585fce53f8bf01827f4 [file] [log] [blame]
Rafael Espindola77a2c372011-06-30 20:14:24 +00001; RUN: opt < %s -simplifycfg -S | FileCheck %s
2
3; Test that a lifetime intrinsic doesn't prevent us from simplifying this.
4
5; CHECK: foo
6; CHECK: entry:
7; CHECK-NOT: bb0:
8; CHECK-NOT: bb1:
9; CHECK: ret
10define void @foo(i1 %x) {
11entry:
12 %a = alloca i8
13 call void @llvm.lifetime.start(i64 -1, i8* %a) nounwind
14 br i1 %x, label %bb0, label %bb1
15
16bb0:
17 call void @llvm.lifetime.end(i64 -1, i8* %a) nounwind
18 br label %bb1
19
20bb1:
21 call void @f()
22 ret void
23}
24
25declare void @f()
26
27declare void @llvm.lifetime.start(i64, i8* nocapture) nounwind
28
29declare void @llvm.lifetime.end(i64, i8* nocapture) nounwind