File: unwind-inline-asm.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (57 lines) | stat: -rw-r--r-- 1,928 bytes parent folder | download | duplicates (14)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
; RUN: llc -global-isel < %s | FileCheck %s

target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-unknown-linux-gnu"

@.str.2 = private unnamed_addr constant [7 x i8] c"Boom!\0A\00", align 1

define dso_local void @trap() {
entry:
  unreachable
}

define dso_local void @test() personality ptr @__gxx_personality_v0 {
entry:

; CHECK-LABEL: test:
; CHECK: .Ltmp0:
; CHECK: bl trap
; CHECK: .Ltmp1:

  invoke void asm sideeffect unwind "bl trap", ""()
          to label %invoke.cont unwind label %lpad

invoke.cont:
  ret void

lpad:
  %0 = landingpad { ptr, i32 }
          cleanup
; CHECK: bl	printf
  call void (ptr, ...) @printf(ptr @.str.2)
  resume { ptr, i32 } %0

}

declare dso_local i32 @__gxx_personality_v0(...)

declare dso_local void @printf(ptr, ...)

; Exception table generation around the inline assembly

; CHECK-LABEL: GCC_except_table1:
; CHECK-NEXT: .Lexception0:
; CHECK-NEXT: 	.byte	255                             // @LPStart Encoding = omit
; CHECK-NEXT: 	.byte	255                             // @TType Encoding = omit
; CHECK-NEXT: 	.byte	1                               // Call site Encoding = uleb128
; CHECK-NEXT: 	.uleb128 .Lcst_end0-.Lcst_begin0
; CHECK-NEXT: .Lcst_begin0:
; CHECK-NEXT: 	.uleb128 .Ltmp0-.Lfunc_begin0           // >> Call Site 1 <<
; CHECK-NEXT: 	.uleb128 .Ltmp1-.Ltmp0                  //   Call between .Ltmp0 and .Ltmp1
; CHECK-NEXT: 	.uleb128 .Ltmp2-.Lfunc_begin0           //     jumps to .Ltmp2
; CHECK-NEXT: 	.byte	0                               //   On action: cleanup
; CHECK-NEXT: 	.uleb128 .Ltmp1-.Lfunc_begin0           // >> Call Site 2 <<
; CHECK-NEXT: 	.uleb128 .Lfunc_end1-.Ltmp1             //   Call between .Ltmp1 and .Lfunc_end1
; CHECK-NEXT: 	.byte	0                               //     has no landing pad
; CHECK-NEXT: 	.byte	0                               //   On action: cleanup
; CHECK-NEXT: .Lcst_end0: