1 ; RUN: opt < %s -simplifycfg -S | FileCheck %s
2 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
4 declare i32 @__gxx_personality_v0(...)
9 define void @test1() personality i32 (...)* @__gxx_personality_v0 {
12 ; CHECK: to label %invoke2 unwind label %lpad2
14 to label %invoke2 unwind label %lpad1
17 ; CHECK-LABEL: invoke2:
18 ; CHECK: to label %invoke.cont unwind label %lpad2
20 to label %invoke.cont unwind label %lpad2
26 %exn = landingpad {i8*, i32}
28 br label %shared_resume
32 ; CHECK: landingpad { i8*, i32 }
34 ; CHECK-NEXT: call void @fn()
35 ; CHECK-NEXT: ret void
36 %exn2 = landingpad {i8*, i32}
38 br label %shared_resume
45 ; Don't trigger if blocks aren't the same/empty
46 define void @neg1() personality i32 (...)* @__gxx_personality_v0 {
50 ; CHECK: to label %invoke2 unwind label %lpad1
52 to label %invoke2 unwind label %lpad1
55 ; CHECK-LABEL: invoke2:
56 ; CHECK: to label %invoke.cont unwind label %lpad2
58 to label %invoke.cont unwind label %lpad2
64 %exn = landingpad {i8*, i32}
65 filter [0 x i8*] zeroinitializer
67 br label %shared_resume
70 %exn2 = landingpad {i8*, i32}
72 br label %shared_resume
79 ; Should not trigger when the landing pads are not the exact same
80 define void @neg2() personality i32 (...)* @__gxx_personality_v0 {
84 ; CHECK: to label %invoke2 unwind label %lpad1
86 to label %invoke2 unwind label %lpad1
89 ; CHECK-LABEL: invoke2:
90 ; CHECK: to label %invoke.cont unwind label %lpad2
92 to label %invoke.cont unwind label %lpad2
98 %exn = landingpad {i8*, i32}
99 filter [0 x i8*] zeroinitializer
100 br label %shared_resume
103 %exn2 = landingpad {i8*, i32}
105 br label %shared_resume