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; RUN: llc -mtriple=armv7-apple-watchos -O3 < %s | FileCheck %s
6; RUN: llc -mtriple=armv7k-apple-ios < %s | FileCheck %s --check-prefix=CHECK-WATCH
7
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
15define i8* @foo(i8 %a, {} %c) personality i8* bitcast (i32 (...)* @baz to i8*) {
16entry:
17; CHECK: bl __Unwind_SjLj_Register
18; CHECK-NEXT: {{[A-Z][a-zA-Z0-9]*}}:
19; CHECK-NEXT: bl _bar
20
21; CHECK-WATCH-NOT: bl __Unwind_SjLj_Register
22
23  invoke void @bar ()
24    to label %unreachable unwind label %handler
25
26unreachable:
27  unreachable
28
29handler:
30  %tmp = landingpad { i8*, i32 }
31  cleanup
32  resume { i8*, i32 } undef
33}
34
35declare void @bar()
36declare i32 @baz(...)
37