1; RUN: opt < %s -simplifycfg -S | FileCheck %s
2
3declare void @bar()
4
5; This testcase checks to see if the simplifycfg pass is converting invoke
6; instructions to call instructions if the handler just rethrows the exception.
7define i32 @test1() personality i32 (...)* @__gxx_personality_v0 {
8; CHECK-LABEL: @test1(
9; CHECK-NEXT: call void @bar()
10; CHECK-NEXT: ret i32 0
11        invoke void @bar( )
12                        to label %1 unwind label %Rethrow
13        ret i32 0
14Rethrow:
15        %exn = landingpad {i8*, i32}
16                 catch i8* null
17        resume { i8*, i32 } %exn
18}
19
20define i32 @test2() personality i32 (...)* @__gxx_personality_v0 {
21; CHECK-LABEL: @test2(
22; CHECK-NEXT: call void @bar() [ "foo"(i32 100) ]
23; CHECK-NEXT: ret i32 0
24        invoke void @bar( ) [ "foo"(i32 100) ]
25                        to label %1 unwind label %Rethrow
26        ret i32 0
27Rethrow:
28        %exn = landingpad {i8*, i32}
29                 catch i8* null
30        resume { i8*, i32 } %exn
31}
32
33declare i32 @__gxx_personality_v0(...)
34