Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | ; 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 Gohman | 3c7d308 | 2009-09-11 18:01:28 +0000 | [diff] [blame] | 6 | ; RUN: opt < %s -simplifycfg -S | \ |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 7 | ; RUN: not egrep {\\(invoke\\)|\\(br\\)} |
| 8 | |
Tanya Lattner | b46665e | 2008-03-18 03:45:45 +0000 | [diff] [blame] | 9 | declare void @bar() |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 10 | |
Tanya Lattner | b46665e | 2008-03-18 03:45:45 +0000 | [diff] [blame] | 11 | define i32 @test() { |
| 12 | invoke void @bar( ) |
| 13 | to label %Ok unwind label %Rethrow |
| 14 | Ok: ; preds = %0 |
| 15 | ret i32 0 |
| 16 | Rethrow: ; preds = %0 |
| 17 | unwind |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 18 | } |