File: zos-landingpad.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,245,028 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,675; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (43 lines) | stat: -rw-r--r-- 1,538 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
; RUN: llc < %s -mtriple=s390x-none-zos -mcpu=z10 | FileCheck %s
;
; Ensures that landingpad instructions use the right Exception Pointer
; and Exception Selector registers, and that the exception table is emitted.

declare void @callee()
declare void @passeh(ptr, i32) noreturn
declare i32 @__zos_cxx_personality_v2(...)

define void @test1() uwtable personality ptr @__zos_cxx_personality_v2 {
entry:
  %ehptr = alloca ptr, align 8
  %ehsel = alloca i32, align 8
  invoke void @callee() to label %done unwind label %lpad
done:
  ret void
; Match the return instruction.
; CHECK: b 2(7)
lpad:
  %0 = landingpad { ptr, i32 } cleanup
; The Exception Pointer is %r1; the Exception Selector, %r2.
; CHECK: L#BB{{[^%]*}} %lpad
; CHECK-DAG: stg 1,{{.*}}
; CHECK-DAG: st 2,{{.*}}
  %1 = extractvalue { ptr, i32 } %0, 0
  %2 = extractvalue { ptr, i32 } %0, 1
  store ptr %1, ptr %ehptr, align 8
  store i32 %2, ptr %ehsel, align 8
  call void @passeh(ptr %1, i32 %2)
  unreachable
}

; Check that offsets to the FD of the personality routine and LSDA are emitted in PPA1
; CHECK: .byte 145 {{.*PPA1 Flags}}
; CHECK: Bit 3: 1 = C++ EH block
; TODO: Emit the value instead of a dummy value.
; CHECK: Personality routine
; CHECK: LSDA location
; Check that the exception table is emitted into .lsda section.
; CHECK:  stdin#C CSECT
; CHECK:  C_WSA64 CATTR ALIGN(2),FILL(0),NOTEXECUTABLE,RMODE(64),PART(.gcc_exception_table.test1)
; CHECK:  .gcc_exception_table.test1 XATTR LINKAGE(XPLINK),REFERENCE(DATA),SCOPE(SECTION)
; CHECK: GCC_except_table0: