• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -simplifycfg -S | FileCheck %s
2
3; Test that a lifetime intrinsic isn't removed because that would change semantics
4
5; CHECK: foo
6; CHECK: entry:
7; CHECK: bb0:
8; CHECK: 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
30