Rafael Espindola | fa5942b | 2013-05-05 20:43:10 +0000 | [diff] [blame] | 1 | ; RUN: %lli_mcjit %s |
Rafael Espindola | 072f4d9 | 2013-05-06 03:35:56 +0000 | [diff] [blame] | 2 | ; XFAIL: powerpc64, arm, cygwin |
Rafael Espindola | fa5942b | 2013-05-05 20:43:10 +0000 | [diff] [blame] | 3 | declare i8* @__cxa_allocate_exception(i64) |
| 4 | declare void @__cxa_throw(i8*, i8*, i8*) |
| 5 | declare i32 @__gxx_personality_v0(...) |
| 6 | |
| 7 | @_ZTIi = external constant i8* |
| 8 | |
| 9 | define void @throwException() { |
| 10 | %exception = tail call i8* @__cxa_allocate_exception(i64 4) |
| 11 | call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null) |
| 12 | unreachable |
| 13 | } |
| 14 | |
| 15 | define i32 @main() { |
| 16 | entry: |
| 17 | invoke void @throwException() |
| 18 | to label %try.cont unwind label %lpad |
| 19 | |
| 20 | lpad: |
| 21 | %p = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) |
| 22 | catch i8* bitcast (i8** @_ZTIi to i8*) |
| 23 | br label %try.cont |
| 24 | |
| 25 | try.cont: |
| 26 | ret i32 0 |
| 27 | } |