Bill Wendling | 151b44d | 2014-07-14 06:22:36 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=armv7-apple-ios -O0 < %s | FileCheck %s |
| 2 | ; RUN: llc -mtriple=armv7-apple-ios -O1 < %s | FileCheck %s |
| 3 | ; RUN: llc -mtriple=armv7-apple-ios -O2 < %s | FileCheck %s |
| 4 | ; RUN: llc -mtriple=armv7-apple-ios -O3 < %s | FileCheck %s |
| 5 | |
| 6 | ; SjLjEHPrepare shouldn't crash when lowering empty structs. |
| 7 | ; |
| 8 | ; Checks that between in case of empty structs used as arguments |
| 9 | ; nothing happens, i.e. there are no instructions between |
| 10 | ; __Unwind_SjLj_Register and actual @bar invocation |
| 11 | |
| 12 | |
Bill Wendling | c80b6c9 | 2014-07-14 18:21:11 +0000 | [diff] [blame] | 13 | define i8* @foo(i8 %a, {} %c) { |
Bill Wendling | 151b44d | 2014-07-14 06:22:36 +0000 | [diff] [blame] | 14 | entry: |
| 15 | ; CHECK: bl __Unwind_SjLj_Register |
| 16 | ; CHECK-NEXT: {{[A-Z][a-zA-Z0-9]*}}: |
| 17 | ; CHECK-NEXT: bl _bar |
| 18 | invoke void @bar () |
| 19 | to label %unreachable unwind label %handler |
| 20 | |
| 21 | unreachable: |
| 22 | unreachable |
| 23 | |
| 24 | handler: |
| 25 | %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @baz to i8*) |
| 26 | cleanup |
| 27 | resume { i8*, i32 } undef |
| 28 | } |
| 29 | |
| 30 | declare void @bar() |
| 31 | declare i32 @baz(...) |