Chris Lattner | 94be300 | 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 | |
Reid Spencer | a551c04 | 2007-04-15 09:21:47 +0000 | [diff] [blame] | 6 | ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | \ |
| 7 | ; RUN: not egrep {\\(invoke\\)|\\(br\\)} |
Chris Lattner | 94be300 | 2003-08-24 17:58:24 +0000 | [diff] [blame] | 8 | |
| 9 | declare void %bar() |
Chris Lattner | 94be300 | 2003-08-24 17:58:24 +0000 | [diff] [blame] | 10 | |
| 11 | int %test() { |
| 12 | invoke void %bar() to label %Ok except label %Rethrow |
| 13 | Ok: |
| 14 | ret int 0 |
| 15 | Rethrow: |
Chris Lattner | eee3472 | 2004-07-01 04:09:14 +0000 | [diff] [blame] | 16 | unwind |
Chris Lattner | 94be300 | 2003-08-24 17:58:24 +0000 | [diff] [blame] | 17 | } |
| 18 | |