2003-08-24 06:55:07 +00:00
|
|
|
; Test that any rethrown exceptions in an inlined function are automatically
|
|
|
|
; turned into branches to the invoke destination.
|
|
|
|
|
2005-05-13 15:48:41 +00:00
|
|
|
; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep unwind$
|
2003-08-24 06:55:07 +00:00
|
|
|
|
|
|
|
declare void %might_throw()
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
internal int %callee() {
|
|
|
|
invoke void %might_throw() to label %cont except label %exc
|
|
|
|
cont:
|
|
|
|
ret int 0
|
|
|
|
exc: ; This just rethrows the exception!
|
2005-05-13 15:48:41 +00:00
|
|
|
unwind
|
2003-08-24 06:55:07 +00:00
|
|
|
}
|
|
|
|
|
2003-08-24 12:16:58 +00:00
|
|
|
; caller returns true if might_throw throws an exception... which gets
|
|
|
|
; propagated by callee.
|
2003-08-24 06:55:07 +00:00
|
|
|
int %caller() {
|
|
|
|
%X = invoke int %callee() to label %cont
|
|
|
|
except label %Handler
|
|
|
|
cont:
|
|
|
|
ret int %X
|
|
|
|
Handler:
|
|
|
|
; This consumes an exception thrown by might_throw
|
2003-08-24 12:16:58 +00:00
|
|
|
ret int 1
|
2003-08-24 06:55:07 +00:00
|
|
|
}
|