112 lines · plain
1# RUN: %{cxx} %{flags} %s %{link_flags} -no-pie -o %t.exe2# RUN: %{exec} %t.exe3 4# REQUIRES: linux && target={{x86_64-.+}}5# UNSUPPORTED: target={{.+-android.*}}6# UNSUPPORTED: no-exceptions7 8## Check that libc++abi works correctly when LPStart address is explicitly set9## to zero.10 11## This file is generated from the following C++ source code.12##13## ```14## int main() {15## try {16## throw 42;17## } catch (...) {18## return 0;19## }20## return 1;21## }22## ```23## The exception table is modified to use udata4 encoding for LPStart and24## sdata4 encoding for call sites.25 26 .att_syntax27 .text28 .globl main # -- Begin function main29 .p2align 4, 0x9030 .type main,@function31main: # @main32.Lfunc_begin0:33 .cfi_startproc34 .globl __gxx_personality_v035 .cfi_personality 3, __gxx_personality_v036 .cfi_lsda 27, .Lexception037# %bb.0: # %entry38 pushq %rbp39 .cfi_def_cfa_offset 1640 .cfi_offset %rbp, -1641 movq %rsp, %rbp42 .cfi_def_cfa_register %rbp43 subq $32, %rsp44 movl $0, -4(%rbp)45 movl $4, %edi46 callq __cxa_allocate_exception@PLT47 movq %rax, %rdi48 movl $42, (%rdi)49.Ltmp0:50 movq _ZTIi@GOTPCREL(%rip), %rsi51 xorl %eax, %eax52 movl %eax, %edx53 callq __cxa_throw@PLT54.Ltmp1:55 jmp .LBB0_456.LBB0_1: # %lpad57.Ltmp2:58 movq %rax, %rcx59 movl %edx, %eax60 movq %rcx, -16(%rbp)61 movl %eax, -20(%rbp)62# %bb.2: # %catch63 movq -16(%rbp), %rdi64 callq __cxa_begin_catch@PLT65 movl $0, -4(%rbp)66 callq __cxa_end_catch@PLT67# %bb.3: # %return68 movl -4(%rbp), %eax69 addq $32, %rsp70 popq %rbp71 .cfi_def_cfa %rsp, 872 retq73.LBB0_4: # %unreachable74.Lfunc_end0:75 .size main, .Lfunc_end0-main76 .cfi_endproc77 78 .section .gcc_except_table,"a",@progbits79 .p2align 2, 0x080GCC_except_table0:81.Lexception0:82 .byte 3 # @LPStart Encoding = udata483 .long 084 .byte 155 # @TType Encoding = indirect pcrel sdata485 .uleb128 .Lttbase0-.Lttbaseref086.Lttbaseref0:87 .byte 11 # Call site Encoding = sdata488 .uleb128 .Lcst_end0-.Lcst_begin089.Lcst_begin0:90 .long .Lfunc_begin0-.Lfunc_begin0 # >> Call Site 1 <<91 .long .Ltmp0-.Lfunc_begin0 # Call between .Lfunc_begin0 and .Ltmp092 .long 0 # has no landing pad93 .byte 0 # On action: cleanup94 .long .Ltmp0-.Lfunc_begin0 # >> Call Site 2 <<95 .long .Ltmp1-.Ltmp0 # Call between .Ltmp0 and .Ltmp196 .long .Ltmp297 .byte 1 # On action: 198 .long .Ltmp1-.Lfunc_begin0 # >> Call Site 3 <<99 .long .Lfunc_end0-.Ltmp1 # Call between .Ltmp1 and .Lfunc_end0100 .long 0 # has no landing pad101 .byte 0 # On action: cleanup102.Lcst_end0:103 .byte 1 # >> Action Record 1 <<104 # Catch TypeInfo 1105 .byte 0 # No further actions106 .p2align 2, 0x0107 # >> Catch TypeInfos <<108 .long 0 # TypeInfo 1109.Lttbase0:110 .p2align 2, 0x0111 # -- End function112