1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 ; RUN: llc -O0 -global-isel -stop-after=irtranslator < %s | FileCheck %s
4 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
5 target triple = "aarch64-unknown-linux-gnu"
7 @.str.2 = private unnamed_addr constant [7 x i8] c"Boom!\0A\00", align 1
9 define dso_local void @trap() {
10 ; CHECK-LABEL: name: trap
16 define dso_local void @test() personality ptr @__gxx_personality_v0 {
17 ; CHECK-LABEL: name: test
19 ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.3(0x40000000)
21 ; CHECK-NEXT: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @.str.2
22 ; CHECK-NEXT: G_INVOKE_REGION_START
23 ; CHECK-NEXT: EH_LABEL <mcsymbol >
24 ; CHECK-NEXT: INLINEASM &"bl trap", 1 /* sideeffect attdialect */
25 ; CHECK-NEXT: EH_LABEL <mcsymbol >
26 ; CHECK-NEXT: G_BR %bb.2
28 ; CHECK-NEXT: bb.2.invoke.cont:
29 ; CHECK-NEXT: RET_ReallyLR
31 ; CHECK-NEXT: bb.3.lpad (landing-pad):
32 ; CHECK-NEXT: liveins: $x0, $x1
34 ; CHECK-NEXT: EH_LABEL <mcsymbol >
35 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s128) = G_IMPLICIT_DEF
36 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
37 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
38 ; CHECK-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY1]](p0)
39 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
40 ; CHECK-NEXT: $x0 = COPY [[GV]](p0)
41 ; CHECK-NEXT: BL @printf, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0
42 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
43 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
44 ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
45 ; CHECK-NEXT: BL @_Unwind_Resume, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0
46 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
50 invoke void asm sideeffect unwind "bl trap", ""()
51 to label %invoke.cont unwind label %lpad
58 %0 = landingpad { ptr, i32 }
60 call void (ptr, ...) @printf(ptr @.str.2)
61 resume { ptr, i32 } %0
65 define void @test2() #0 personality ptr @__gcc_personality_v0 {
66 ; CHECK-LABEL: name: test2
67 ; CHECK: bb.1 (%ir-block.0):
68 ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.3(0x40000000)
70 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(p0) = G_IMPLICIT_DEF
71 ; CHECK-NEXT: G_INVOKE_REGION_START
72 ; CHECK-NEXT: EH_LABEL <mcsymbol >
73 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64common = COPY [[DEF]](p0)
74 ; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */, {{[0-9]+}} /* reguse:GPR64common */, [[COPY]]
75 ; CHECK-NEXT: EH_LABEL <mcsymbol >
76 ; CHECK-NEXT: G_BR %bb.2
79 ; CHECK-NEXT: RET_ReallyLR
81 ; CHECK-NEXT: bb.3.b (landing-pad):
82 ; CHECK-NEXT: liveins: $x0, $x1
84 ; CHECK-NEXT: EH_LABEL <mcsymbol >
85 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s128) = G_IMPLICIT_DEF
86 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x0
87 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY $x1
88 ; CHECK-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY2]](p0)
89 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
90 ; CHECK-NEXT: $x0 = COPY [[COPY1]](p0)
91 ; CHECK-NEXT: BL @_Unwind_Resume, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0
92 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
93 invoke void asm sideeffect "", "r"(ptr undef) to label %a unwind label %b
97 %landing_pad = landingpad { ptr, i32 } cleanup
98 resume { ptr, i32 } %landing_pad
101 declare i32 @__gcc_personality_v0(...)
102 declare dso_local i32 @__gxx_personality_v0(...)
104 declare dso_local void @printf(ptr, ...)