blob: 9f3bd4ee510536b3d2663e8f58914753a1109b9c [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; This testcase checks to see if the simplifycfg pass is converting invoke
2; instructions to call instructions if the handler just rethrows the exception.
3
4; If this test is successful, the function should be reduced to 'call; ret'
5
Dan Gohman3c7d3082009-09-11 18:01:28 +00006; RUN: opt < %s -simplifycfg -S | \
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007; RUN: not egrep {\\(invoke\\)|\\(br\\)}
8
Tanya Lattnerb46665e2008-03-18 03:45:45 +00009declare void @bar()
Dan Gohmanf17a25c2007-07-18 16:29:46 +000010
Tanya Lattnerb46665e2008-03-18 03:45:45 +000011define i32 @test() {
12 invoke void @bar( )
13 to label %Ok unwind label %Rethrow
14Ok: ; preds = %0
15 ret i32 0
16Rethrow: ; preds = %0
17 unwind
Dan Gohmanf17a25c2007-07-18 16:29:46 +000018}