2013-02-01 19:40:47 +08:00
|
|
|
; RUN: llc -verify-machineinstrs -mtriple=aarch64-none-linux-gnu %s -filetype=obj -o %t
|
2014-11-03 20:19:03 +08:00
|
|
|
; RUN: llvm-objdump -s %t | FileCheck %s
|
2013-01-31 20:12:40 +08:00
|
|
|
|
|
|
|
declare i32 @__gxx_personality_v0(...)
|
|
|
|
|
|
|
|
declare void @bar()
|
|
|
|
|
2015-06-18 04:52:32 +08:00
|
|
|
define i64 @foo(i64 %lhs, i64 %rhs) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
|
2013-01-31 20:12:40 +08:00
|
|
|
invoke void @bar() to label %end unwind label %clean
|
|
|
|
end:
|
|
|
|
ret i64 0
|
|
|
|
|
|
|
|
clean:
|
2015-06-18 04:52:32 +08:00
|
|
|
%tst = landingpad { i8*, i32 } cleanup
|
2013-01-31 20:12:40 +08:00
|
|
|
ret i64 42
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: Contents of section .eh_frame:
|
2015-04-28 06:04:24 +08:00
|
|
|
; CHECK: 0000 1c000000 00000000 017a504c 5200017c .........zPLR..|
|
2013-01-31 20:12:40 +08:00
|
|
|
; CHECK: 0010 1e0b0000 00000000 00000000 1b0c1f00 ................
|
|
|
|
|
|
|
|
; Don't really care about the rest:
|
|
|
|
|
|
|
|
; 0020 1c000000 24000000 00000000 24000000 ....$.......$...
|
|
|
|
; 0030 08000000 00000000 00440c1f 10449e02 .........D...D..
|
|
|
|
|
|
|
|
; The key test here is that the personality routine is sanely encoded (under the
|
|
|
|
; small memory model it must be an 8-byte value for full generality: code+data <
|
|
|
|
; 4GB, but you might need both +4GB and -4GB depending on where things end
|
|
|
|
; up. However, for completeness:
|
|
|
|
|
|
|
|
; First CIE:
|
|
|
|
; ----------
|
|
|
|
; 1c000000: Length = 0x1c
|
|
|
|
; 00000000: This is a CIE
|
2014-06-19 23:39:33 +08:00
|
|
|
; 03: Version 3
|
2013-01-31 20:12:40 +08:00
|
|
|
; 7a 50 4c 52 00: Augmentation string "zPLR" (personality routine, language-specific data, pointer format)
|
|
|
|
; 01: Code alignment factor 1
|
|
|
|
; 78: Data alignment factor: -8
|
|
|
|
; 1e: Return address in x30
|
|
|
|
; 07: Augmentation data 0xb bytes (this is key!)
|
|
|
|
; 00: Personality encoding is DW_EH_PE_absptr
|
|
|
|
; 00 00 00 00 00 00 00 00: First part of aug (personality routine). Relocated, obviously
|
|
|
|
; 00: Second part of aug (language-specific data): absolute pointer format used
|
|
|
|
; 1b: pointer format: pc-relative signed 4-byte. Just like GNU.
|
|
|
|
; 0c 1f 00: Initial instructions ("DW_CFA_def_cfa x31 ofs 0" in this case)
|