blob: 435bed0c295713d40523388b1864f1e06b3ec97f [file] [log] [blame]
Chris Lattner8d6d0932009-10-13 18:10:05 +00001; RUN: opt < %s -simplifycfg -S | FileCheck %s
Chris Lattner94be3002003-08-24 17:58:24 +00002
Tanya Lattnerbaa370b2008-03-18 03:45:45 +00003declare void @bar()
Chris Lattner94be3002003-08-24 17:58:24 +00004
Chris Lattner19788ca2009-10-13 18:13:05 +00005; This testcase checks to see if the simplifycfg pass is converting invoke
6; instructions to call instructions if the handler just rethrows the exception.
Chris Lattner8d6d0932009-10-13 18:10:05 +00007define i32 @test1() {
Stephen Linc1c7a132013-07-14 01:42:54 +00008; CHECK-LABEL: @test1(
Chris Lattner8d6d0932009-10-13 18:10:05 +00009; CHECK-NEXT: call void @bar()
10; CHECK-NEXT: ret i32 0
Tanya Lattnerbaa370b2008-03-18 03:45:45 +000011 invoke void @bar( )
Chris Lattnerbc9e6d92010-12-13 05:10:30 +000012 to label %1 unwind label %Rethrow
Tanya Lattnerbaa370b2008-03-18 03:45:45 +000013 ret i32 0
Chris Lattnerbc9e6d92010-12-13 05:10:30 +000014Rethrow:
Bill Wendlinge7b02b82011-09-19 22:11:35 +000015 %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
16 catch i8* null
17 resume { i8*, i32 } %exn
Chris Lattner94be3002003-08-24 17:58:24 +000018}
Chris Lattner19788ca2009-10-13 18:13:05 +000019
Bill Wendlinge7b02b82011-09-19 22:11:35 +000020declare i32 @__gxx_personality_v0(...)