• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test that we don't sink landingpads
2; RUN: opt -sink -S < %s | FileCheck %s
3
4declare hidden void @g()
5declare void @h()
6declare i32 @__gxx_personality_v0(...)
7
8define void @f() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
9entry:
10  invoke void @g()
11          to label %invoke.cont.15 unwind label %lpad
12
13invoke.cont.15:
14  unreachable
15
16; CHECK: lpad:
17; CHECK: %0 = landingpad { i8*, i32 }
18lpad:
19  %0 = landingpad { i8*, i32 }
20          catch i8* null
21  invoke void @h()
22          to label %invoke.cont unwind label %lpad.1
23
24; CHECK: invoke.cont
25; CHECK-NOT: %0 = landingpad { i8*, i32 }
26invoke.cont:
27  ret void
28
29lpad.1:
30  %1 = landingpad { i8*, i32 }
31          cleanup
32  resume { i8*, i32 } %1
33}
34