1 ; RUN: llc %s -filetype=obj -o - | llvm-readobj -r - | FileCheck %s --check-prefix=RELOC
2 ; RUN: llc %s -o - | FileCheck %s --check-prefix=ASM
4 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-apple-macosx"
7 declare void @issue64826(i64, ptr, ptr swifterror)
9 define swiftcc void @rdar113994760() personality ptr @__gcc_personality_v0 {
11 %swifterror = alloca swifterror ptr, align 8
12 invoke swiftcc void @issue64826(i64 0, ptr null, ptr swifterror %swifterror)
13 to label %.noexc unwind label %tsan_cleanup
15 .noexc: ; preds = %entry
18 tsan_cleanup: ; preds = %entry
19 %cleanup.lpad = landingpad { ptr, i32 }
21 resume { ptr, i32 } zeroinitializer
24 declare i32 @__gcc_personality_v0(...)
26 ; RELOC-LABEL: Relocations [
27 ; RELOC-NEXT: Section __text {
28 ; RELOC-NEXT: 0x19 1 2 1 X86_64_RELOC_BRANCH 0 __Unwind_Resume
29 ; RELOC-NEXT: 0xB 1 2 1 X86_64_RELOC_BRANCH 0 _issue64826
31 ; RELOC-NEXT: Section __eh_frame {
32 ; RELOC-NEXT: 0x13 1 2 1 X86_64_RELOC_GOT 0 ___gcc_personality_v0
36 ; ASM-LABEL: rdar113994760:
37 ; ASM: ## %bb.0: ## %entry
38 ; ASM-NEXT: pushq %r12
39 ; ASM-NEXT: .cfi_def_cfa_offset 16
40 ; ASM-NEXT: subq $16, %rsp
41 ; ASM-NEXT: .cfi_def_cfa_offset 32
42 ; ASM-NEXT: .cfi_offset %r12, -16
44 ; ASM-NEXT: xorl %edi, %edi
45 ; ASM-NEXT: xorl %esi, %esi
46 ; ASM-NEXT: callq _issue64826
48 ; ASM-NEXT: ## %bb.1: ## %.noexc
49 ; ASM-NEXT: addq $16, %rsp
52 ; ASM-NEXT: LBB0_2: ## %tsan_cleanup
54 ; ASM-NEXT: xorl %edi, %edi
55 ; ASM-NEXT: callq __Unwind_Resume
56 ; ASM-NEXT: Lfunc_end0:
57 ; ASM-NEXT: .cfi_endproc
58 ; ASM-NEXT: .section __TEXT,__gcc_except_tab
59 ; ASM-NEXT: .p2align 2, 0x0
60 ; ASM-NEXT: GCC_except_table0:
61 ; ASM-NEXT: Lexception0:
62 ; ASM-NEXT: .byte 255 ## @LPStart Encoding = omit
63 ; ASM-NEXT: .byte 255 ## @TType Encoding = omit
64 ; ASM-NEXT: .byte 1 ## Call site Encoding = uleb128
65 ; ASM-NEXT: .uleb128 Lcst_end0-Lcst_begin0
66 ; ASM-NEXT: Lcst_begin0:
67 ; ASM-NEXT: .uleb128 Ltmp0-Lfunc_begin0 ## >> Call Site 1 <<
68 ; ASM-NEXT: .uleb128 Ltmp1-Ltmp0 ## Call between Ltmp0 and Ltmp1
69 ; ASM-NEXT: .uleb128 Ltmp2-Lfunc_begin0 ## jumps to Ltmp2
70 ; ASM-NEXT: .byte 0 ## On action: cleanup
71 ; ASM-NEXT: .uleb128 Ltmp1-Lfunc_begin0 ## >> Call Site 2 <<
72 ; ASM-NEXT: .uleb128 Lfunc_end0-Ltmp1 ## Call between Ltmp1 and Lfunc_end0
73 ; ASM-NEXT: .byte 0 ## has no landing pad
74 ; ASM-NEXT: .byte 0 ## On action: cleanup
75 ; ASM-NEXT: Lcst_end0:
76 ; ASM-NEXT: .p2align 2, 0x0
77 ; ASM-NEXT: ## -- End function