64 lines · plain
1; RUN: llc -mtriple mips-unknown-linux-gnu -mattr=+micromips \2; RUN: -relocation-model=static -O3 -filetype=obj -o - %s | \3; RUN: llvm-readelf -r - | FileCheck %s --check-prefixes=STATIC4; RUN: llc -mtriple mips-unknown-linux-gnu -mattr=+micromips \5; RUN: -relocation-model=pic -O3 -filetype=obj -o - %s | \6; RUN: llvm-readelf -r - | FileCheck %s --check-prefixes=PIC7; RUN: llc -mtriple mips-unknown-linux-gnu -mattr=+micromips \8; RUN: -relocation-model=static -O3 -filetype=obj -o - %s | \9; RUN: llvm-objdump -s -j .gcc_except_table - | FileCheck %s --check-prefix=EXCEPT-TABLE-STATIC10; RUN: llc -mtriple mips-unknown-linux-gnu -mattr=+micromips \11; RUN: -relocation-model=pic -O3 -filetype=obj -o - %s | \12; RUN: llvm-objdump -s -j .gcc_except_table - | FileCheck %s --check-prefix=EXCEPT-TABLE-PIC13 14; STATIC-LABEL: Relocation section '.rel.eh_frame'15; STATIC-DAG: R_MIPS_32 00000000 DW.ref.__gxx_personality_v016; STATIC-DAG: R_MIPS_32 00000000 .text17; STATIC-DAG: R_MIPS_32 00000000 .gcc_except_table18 19; PIC-LABEL: Relocation section '.rel.eh_frame'20; PIC-DAG: R_MIPS_PC32 00000000 DW.ref.__gxx_personality_v021; PIC-DAG: R_MIPS_PC32 00000000 .L022; PIC-DAG: R_MIPS_PC32 00000000 .L023 24; CHECK-READELF: DW.ref.__gxx_personality_v025; CHECK-READELF-STATIC-NEXT: R_MIPS_32 00000000 .text26; CHECK-READELF-PIC-NEXT: R_MIPS_PC3227; CHECK-READELF-NEXT: .gcc_except_table28 29; EXCEPT-TABLE-STATIC: 0000 ff9b1501 0c001400 00140e22 01221e00 ..........."."..30; EXCEPT-TABLE-STATIC: 0010 00010000 0000000031; EXCEPT-TABLE-PIC: 0000 ff9b1501 0c002c00 002c123e 013e2a00 ......,..,.>.>*.32; EXCEPT-TABLE-PIC: 0010 00010000 00000000 ........33 34@_ZTIi = external constant ptr35 36define dso_local i32 @main() local_unnamed_addr personality ptr @__gxx_personality_v0 {37entry:38 %exception.i = tail call ptr @__cxa_allocate_exception(i32 4) nounwind39 store i32 5, ptr %exception.i, align 1640 invoke void @__cxa_throw(ptr %exception.i, ptr @_ZTIi, ptr null) noreturn41 to label %.noexc unwind label %return42 43.noexc:44 unreachable45 46return:47 %0 = landingpad { ptr, i32 }48 catch ptr null49 %1 = extractvalue { ptr, i32 } %0, 050 %2 = tail call ptr @__cxa_begin_catch(ptr %1) nounwind51 tail call void @__cxa_end_catch()52 ret i32 053}54 55declare i32 @__gxx_personality_v0(...)56 57declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr58 59declare void @__cxa_end_catch() local_unnamed_addr60 61declare ptr @__cxa_allocate_exception(i32) local_unnamed_addr62 63declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr64