2011-07-01 04:14:24 +08:00
|
|
|
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
|
|
|
|
2014-07-31 05:04:00 +08:00
|
|
|
; Test that a lifetime intrinsic isn't removed because that would change semantics
|
2011-07-01 04:14:24 +08:00
|
|
|
|
|
|
|
; CHECK: foo
|
|
|
|
; CHECK: entry:
|
2014-07-31 05:04:00 +08:00
|
|
|
; CHECK: bb0:
|
|
|
|
; CHECK: bb1:
|
2011-07-01 04:14:24 +08:00
|
|
|
; CHECK: ret
|
|
|
|
define void @foo(i1 %x) {
|
|
|
|
entry:
|
|
|
|
%a = alloca i8
|
2017-04-11 04:18:21 +08:00
|
|
|
call void @llvm.lifetime.start.p0i8(i64 -1, i8* %a) nounwind
|
2011-07-01 04:14:24 +08:00
|
|
|
br i1 %x, label %bb0, label %bb1
|
|
|
|
|
|
|
|
bb0:
|
2017-04-11 04:18:21 +08:00
|
|
|
call void @llvm.lifetime.end.p0i8(i64 -1, i8* %a) nounwind
|
2011-07-01 04:14:24 +08:00
|
|
|
br label %bb1
|
|
|
|
|
|
|
|
bb1:
|
|
|
|
call void @f()
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @f()
|
|
|
|
|
2017-04-11 04:18:21 +08:00
|
|
|
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) nounwind
|
2011-07-01 04:14:24 +08:00
|
|
|
|
2017-04-11 04:18:21 +08:00
|
|
|
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) nounwind
|