Fix typeos and add descriptions
[oota-llvm.git] / test / Transforms / Inline / invoke_test-2.ll
1 ; Test that if an invoked function is inlined, and if that function cannot
2 ; throw, that the dead handler is now unreachable.
3
4 ; RUN: as < %s | opt -inline -simplifycfg | dis | not grep UnreachableExceptionHandler
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:
15         ; This just consumes the exception!
16         ret int 1
17 }
18
19 ; caller returns true if might_throw throws an exception... callee cannot throw.
20 int %caller() {
21         %X = invoke int %callee() to label %cont 
22                 except label %UnreachableExceptionHandler
23 cont:
24         ret int %X
25 UnreachableExceptionHandler:
26         ret int -1   ; This is dead!
27 }