File: exception-handling-windows-elf.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 (44 lines) | stat: -rw-r--r-- 1,408 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
44
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc -mtriple=aarch64-pc-windows-elf < %s | FileCheck %s

; Make sure windows elf does not assert with exceptions. This is a
; hack for MCJIT that could be treated as an error when it is removed.

@_ZTIi = external global ptr

declare i32 @foo(i32)
declare i32 @__gxx_personality_v0(...)

define void @bar() personality ptr @__gxx_personality_v0 {
; CHECK-LABEL: bar:
; CHECK:       // %bb.0: // %continue
; CHECK-NEXT:    sub sp, sp, #32
; CHECK-NEXT:    str x30, [sp, #16] // 8-byte Folded Spill
; CHECK-NEXT:    .cfi_def_cfa_offset 32
; CHECK-NEXT:    .cfi_offset w30, -16
; CHECK-NEXT:    adrp x8, :got:foo
; CHECK-NEXT:    mov w0, #42 // =0x2a
; CHECK-NEXT:    ldr x8, [x8, :got_lo12:foo]
; CHECK-NEXT:    blr x8
; CHECK-NEXT:    ldr x30, [sp, #16] // 8-byte Folded Reload
; CHECK-NEXT:    add sp, sp, #32
; CHECK-NEXT:    ret
  %exn.slot = alloca ptr
  %ehselector.slot = alloca i32
  %1 = invoke i32 @foo(i32 42) to label %continue unwind label %cleanup

cleanup:
  %lp = landingpad { ptr, i32 } cleanup
  %lp.0 = extractvalue { ptr, i32 } %lp, 0
  store ptr %lp.0, ptr %exn.slot, align 8
  %lp.1 = extractvalue { ptr, i32 } %lp, 1
  store i32 %lp.1, ptr %ehselector.slot, align 4
  br label %eh.resume

continue:
  ret void

eh.resume:
  %exn = load ptr, ptr %exn.slot, align 8
  unreachable
}