Chris Lattner | 1853f28 | 2003-08-24 12:16:58 +0000 | [diff] [blame] | 1 | ; Test that we can inline a simple function, turning the calls in it into invoke |
Chris Lattner | 0f12ef6 | 2003-08-24 06:55:07 +0000 | [diff] [blame] | 2 | ; instructions |
| 3 | |
Reid Spencer | 951d8dc | 2007-04-15 08:30:33 +0000 | [diff] [blame] | 4 | ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | \ |
| 5 | ; RUN: not grep {call\[^e\]} |
Chris Lattner | 0f12ef6 | 2003-08-24 06:55:07 +0000 | [diff] [blame] | 6 | |
| 7 | declare void %might_throw() |
| 8 | |
| 9 | implementation |
| 10 | |
| 11 | internal void %callee() { |
| 12 | call void %might_throw() |
| 13 | ret void |
| 14 | } |
| 15 | |
| 16 | ; caller returns true if might_throw throws an exception... |
| 17 | int %caller() { |
| 18 | invoke void %callee() to label %cont except label %exc |
| 19 | cont: |
| 20 | ret int 0 |
| 21 | exc: |
| 22 | ret int 1 |
| 23 | } |