Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Transforms / Inline / invoke_test-3.ll
1 ; Test that any rethrown exceptions in an inlined function are automatically
2 ; turned into branches to the invoke destination.
3
4 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | not grep unwind$
5
6 declare void %might_throw()
7
8 implementation
9
10 internal int %callee() {
11         invoke void %might_throw() to label %cont except label %exc
12 cont:
13         ret int 0
14 exc:    ; This just rethrows the exception!
15         unwind
16 }
17
18 ; caller returns true if might_throw throws an exception... which gets 
19 ; propagated by callee.
20 int %caller() {
21         %X = invoke int %callee() to label %cont 
22                 except label %Handler
23 cont:
24         ret int %X
25 Handler:
26         ; This consumes an exception thrown by might_throw
27         ret int 1
28 }