Chris Lattner | cd98c72 | 2003-08-24 17:58:24 +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 | |
Misha Brukman | e78760e | 2003-09-16 15:29:54 +0000 | [diff] [blame] | 6 | ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not egrep 'invoke|br' |
Chris Lattner | cd98c72 | 2003-08-24 17:58:24 +0000 | [diff] [blame] | 7 | |
| 8 | declare void %bar() |
Chris Lattner | cd98c72 | 2003-08-24 17:58:24 +0000 | [diff] [blame] | 9 | |
| 10 | int %test() { |
| 11 | invoke void %bar() to label %Ok except label %Rethrow |
| 12 | Ok: |
| 13 | ret int 0 |
| 14 | Rethrow: |
Chris Lattner | f380445 | 2004-07-01 04:09:14 +0000 | [diff] [blame] | 15 | unwind |
Chris Lattner | cd98c72 | 2003-08-24 17:58:24 +0000 | [diff] [blame] | 16 | } |
| 17 | |