diff options
author | Logan Chien <tzuhsiang.chien@gmail.com> | 2014-05-30 16:48:56 +0000 |
---|---|---|
committer | Logan Chien <tzuhsiang.chien@gmail.com> | 2014-05-30 16:48:56 +0000 |
commit | 731d23ed42db0f876f0c9b2a3985637ef4ec8384 (patch) | |
tree | e08fa24608817b6b422f7d2c2b96e650cd3634c7 /test | |
parent | ba735134d73c8df1aa2bb4f47cda962cc27e5e7f (diff) | |
download | llvm-731d23ed42db0f876f0c9b2a3985637ef4ec8384.tar.gz llvm-731d23ed42db0f876f0c9b2a3985637ef4ec8384.tar.bz2 llvm-731d23ed42db0f876f0c9b2a3985637ef4ec8384.tar.xz |
Fix MIPS exception personality encoding.
For MIPS, we have to encode the personality routine with
an indirect pointer to absptr; otherwise, some link warning
warning will be raised, and the program might crash in some
early MIPS Android device.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209907 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/Mips/ehframe-indirect.ll | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/ehframe-indirect.ll b/test/CodeGen/Mips/ehframe-indirect.ll new file mode 100644 index 0000000000..e78497a952 --- /dev/null +++ b/test/CodeGen/Mips/ehframe-indirect.ll @@ -0,0 +1,34 @@ +; RUN: llc -mtriple=mipsel-linux-gnu < %s | FileCheck %s +; RUN: llc -mtriple=mipsel-linux-android < %s | FileCheck %s + +define i32 @main() { +; CHECK: .cfi_startproc +; CHECK: .cfi_personality 128, DW.ref.__gxx_personality_v0 + +entry: + invoke void @foo() to label %cont unwind label %lpad +; CHECK: foo +; CHECK: jalr + +lpad: + %0 = landingpad { i8*, i32 } personality i8* + bitcast (i32 (...)* @__gxx_personality_v0 to i8*) catch i8* null + ret i32 0 + +cont: + ret i32 0 +} +; CHECK: .cfi_endproc + +declare i32 @__gxx_personality_v0(...) + +declare void @foo() + +; CHECK: .hidden DW.ref.__gxx_personality_v0 +; CHECK: .weak DW.ref.__gxx_personality_v0 +; CHECK: .section .data.DW.ref.__gxx_personality_v0,"aGw",@progbits,DW.ref.__gxx_personality_v0,comdat +; CHECK: .align 2 +; CHECK: .type DW.ref.__gxx_personality_v0,@object +; CHECK: .size DW.ref.__gxx_personality_v0, 4 +; CHECK: DW.ref.__gxx_personality_v0: +; CHECK: .4byte __gxx_personality_v0 |