blob: 323d5037138ecb81f7db57d541fbbb73aab6c10c [file] [log] [blame]
Bill Wendling151b44d2014-07-14 06:22:36 +00001; 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
Tim Northover042a6c12016-01-27 19:32:29 +00005; RUN: llc -mtriple=armv7-apple-watchos -O3 < %s | FileCheck %s
6; RUN: llc -mtriple=armv7k-apple-ios < %s | FileCheck %s --check-prefix=CHECK-WATCH
Bill Wendling151b44d2014-07-14 06:22:36 +00007
8; SjLjEHPrepare shouldn't crash when lowering empty structs.
9;
10; Checks that between in case of empty structs used as arguments
11; nothing happens, i.e. there are no instructions between
12; __Unwind_SjLj_Register and actual @bar invocation
13
14
David Majnemer7fddecc2015-06-17 20:52:32 +000015define i8* @foo(i8 %a, {} %c) personality i8* bitcast (i32 (...)* @baz to i8*) {
Bill Wendling151b44d2014-07-14 06:22:36 +000016entry:
17; CHECK: bl __Unwind_SjLj_Register
18; CHECK-NEXT: {{[A-Z][a-zA-Z0-9]*}}:
19; CHECK-NEXT: bl _bar
Tim Northover042a6c12016-01-27 19:32:29 +000020
21; CHECK-WATCH-NOT: bl __Unwind_SjLj_Register
22
Bill Wendling151b44d2014-07-14 06:22:36 +000023 invoke void @bar ()
24 to label %unreachable unwind label %handler
25
26unreachable:
27 unreachable
28
29handler:
David Majnemer7fddecc2015-06-17 20:52:32 +000030 %tmp = landingpad { i8*, i32 }
Bill Wendling151b44d2014-07-14 06:22:36 +000031 cleanup
32 resume { i8*, i32 } undef
33}
34
35declare void @bar()
36declare i32 @baz(...)