|
| 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 |
| 3 | + |
| 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" |
| 6 | + |
| 7 | +define swiftcc void @rdar113994760() personality ptr @__gcc_personality_v0 { |
| 8 | +entry: |
| 9 | + %swifterror = alloca swifterror ptr, align 8 |
| 10 | + invoke swiftcc void null(i64 0, ptr null, ptr swifterror %swifterror) |
| 11 | + to label %.noexc unwind label %tsan_cleanup |
| 12 | + |
| 13 | +.noexc: ; preds = %entry |
| 14 | + ret void |
| 15 | + |
| 16 | +tsan_cleanup: ; preds = %entry |
| 17 | + %cleanup.lpad = landingpad { ptr, i32 } |
| 18 | + cleanup |
| 19 | + resume { ptr, i32 } zeroinitializer |
| 20 | +} |
| 21 | + |
| 22 | +declare i32 @__gcc_personality_v0(...) |
| 23 | + |
| 24 | +; RELOC-LABEL: Relocations [ |
| 25 | +; RELOC-NEXT: Section __text { |
| 26 | +; RELOC-NEXT: 0x18 1 2 1 X86_64_RELOC_BRANCH 0 __Unwind_Resume |
| 27 | +; RELOC-NEXT: } |
| 28 | +; RELOC-NEXT: Section __eh_frame { |
| 29 | +; RELOC-NEXT: 0x13 1 2 1 X86_64_RELOC_GOT 0 ___gcc_personality_v0 |
| 30 | +; RELOC-NEXT: } |
| 31 | +; RELOC-NEXT: ] |
| 32 | + |
| 33 | +; ASM-LABEL: rdar113994760: |
| 34 | +; ASM: ## %bb.0: ## %entry |
| 35 | +; ASM-NEXT: pushq %r12 |
| 36 | +; ASM-NEXT: .cfi_def_cfa_offset 16 |
| 37 | +; ASM-NEXT: subq $16, %rsp |
| 38 | +; ASM-NEXT: .cfi_def_cfa_offset 32 |
| 39 | +; ASM-NEXT: .cfi_offset %r12, -16 |
| 40 | +; ASM-NEXT: Ltmp0: |
| 41 | +; ASM-NEXT: xorl %eax, %eax |
| 42 | +; ASM-NEXT: xorl %edi, %edi |
| 43 | +; ASM-NEXT: xorl %esi, %esi |
| 44 | +; ASM-NEXT: callq *%rax |
| 45 | +; ASM-NEXT: Ltmp1: |
| 46 | +; ASM-NEXT: ## %bb.1: ## %.noexc |
| 47 | +; ASM-NEXT: addq $16, %rsp |
| 48 | +; ASM-NEXT: popq %r12 |
| 49 | +; ASM-NEXT: retq |
| 50 | +; ASM-NEXT: LBB0_2: ## %tsan_cleanup |
| 51 | +; ASM-NEXT: Ltmp2: |
| 52 | +; ASM-NEXT: xorl %edi, %edi |
| 53 | +; ASM-NEXT: callq __Unwind_Resume |
| 54 | +; ASM-NEXT: Lfunc_end0: |
| 55 | +; ASM-NEXT: .cfi_endproc |
| 56 | +; ASM-NEXT: .section __TEXT,__gcc_except_tab |
| 57 | +; ASM-NEXT: .p2align 2, 0x0 |
| 58 | +; ASM-NEXT: GCC_except_table0: |
| 59 | +; ASM-NEXT: Lexception0: |
| 60 | +; ASM-NEXT: .byte 255 ## @LPStart Encoding = omit |
| 61 | +; ASM-NEXT: .byte 255 ## @TType Encoding = omit |
| 62 | +; ASM-NEXT: .byte 1 ## Call site Encoding = uleb128 |
| 63 | +; ASM-NEXT: .uleb128 Lcst_end0-Lcst_begin0 |
| 64 | +; ASM-NEXT: Lcst_begin0: |
| 65 | +; ASM-NEXT: .uleb128 Ltmp0-Lfunc_begin0 ## >> Call Site 1 << |
| 66 | +; ASM-NEXT: .uleb128 Ltmp1-Ltmp0 ## Call between Ltmp0 and Ltmp1 |
| 67 | +; ASM-NEXT: .uleb128 Ltmp2-Lfunc_begin0 ## jumps to Ltmp2 |
| 68 | +; ASM-NEXT: .byte 0 ## On action: cleanup |
| 69 | +; ASM-NEXT: .uleb128 Ltmp1-Lfunc_begin0 ## >> Call Site 2 << |
| 70 | +; ASM-NEXT: .uleb128 Lfunc_end0-Ltmp1 ## Call between Ltmp1 and Lfunc_end0 |
| 71 | +; ASM-NEXT: .byte 0 ## has no landing pad |
| 72 | +; ASM-NEXT: .byte 0 ## On action: cleanup |
| 73 | +; ASM-NEXT: Lcst_end0: |
| 74 | +; ASM-NEXT: .p2align 2, 0x0 |
| 75 | +; ASM-NEXT: ## -- End function |
0 commit comments