1 ; RUN: llc < %s -mtriple=s390x-none-zos -mcpu=z10 | FileCheck %s
3 ; Ensures that landingpad instructions use the right Exception Pointer
4 ; and Exception Selector registers, and that the exception table is emitted.
7 declare void @passeh(ptr, i32) noreturn
8 declare i32 @__zos_cxx_personality_v2(...)
10 define void @test1() uwtable personality ptr @__zos_cxx_personality_v2 {
12 %ehptr = alloca ptr, align 8
13 %ehsel = alloca i32, align 8
14 invoke void @callee() to label %done unwind label %lpad
17 ; Match the return instruction.
20 %0 = landingpad { ptr, i32 } cleanup
21 ; The Exception Pointer is %r1; the Exception Selector, %r2.
22 ; CHECK: L#BB{{[^%]*}} %lpad
23 ; CHECK-DAG: stg 1,{{.*}}
24 ; CHECK-DAG: st 2,{{.*}}
25 %1 = extractvalue { ptr, i32 } %0, 0
26 %2 = extractvalue { ptr, i32 } %0, 1
27 store ptr %1, ptr %ehptr, align 8
28 store i32 %2, ptr %ehsel, align 8
29 call void @passeh(ptr %1, i32 %2)
33 ; Check that offsets to the FD of the personality routine and LSDA are emitted in PPA1
34 ; CHECK: .byte 145 {{.*PPA1 Flags}}
35 ; CHECK: Bit 3: 1 = C++ EH block
36 ; TODO: Emit the value instead of a dummy value.
37 ; CHECK: Personality routine
38 ; CHECK: LSDA location
39 ; Check that the exception table is emitted into .lsda section.
40 ; CHECK: .section ".gcc_exception_table.test1"
41 ; CHECK: GCC_except_table0: