blob: 4f52f6b72e9e6388279c0a82311cb4819742c9aa [file] [log] [blame]
Chris Lattnercd98c722003-08-24 17:58:24 +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
Tanya Lattnerf04d8d12008-03-18 03:45:45 +00006; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
Reid Spencer9aafdcf2007-04-15 09:21:47 +00007; RUN: not egrep {\\(invoke\\)|\\(br\\)}
Chris Lattnercd98c722003-08-24 17:58:24 +00008
Tanya Lattnerf04d8d12008-03-18 03:45:45 +00009declare void @bar()
Chris Lattnercd98c722003-08-24 17:58:24 +000010
Tanya Lattnerf04d8d12008-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
Chris Lattnercd98c722003-08-24 17:58:24 +000018}