blob: ae5401b58fbf3656b990023b16a58eaa705d1489 [file] [log] [blame]
Tim Northovere3d42362013-02-01 11:40:47 +00001; RUN: llc -verify-machineinstrs -mtriple=aarch64-none-linux-gnu %s -filetype=obj -o %t
Oliver Stannardcf6bfb12014-11-03 12:19:03 +00002; RUN: llvm-objdump -s %t | FileCheck %s
Tim Northovere0e3aef2013-01-31 12:12:40 +00003
4declare i32 @__gxx_personality_v0(...)
5
6declare void @bar()
7
David Majnemer7fddecc2015-06-17 20:52:32 +00008define i64 @foo(i64 %lhs, i64 %rhs) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
Tim Northovere0e3aef2013-01-31 12:12:40 +00009 invoke void @bar() to label %end unwind label %clean
10end:
11 ret i64 0
12
13clean:
David Majnemer7fddecc2015-06-17 20:52:32 +000014 %tst = landingpad { i8*, i32 } cleanup
Tim Northovere0e3aef2013-01-31 12:12:40 +000015 ret i64 42
16}
17
18; CHECK: Contents of section .eh_frame:
Rafael Espindolaa7c31632015-04-27 22:04:24 +000019; CHECK: 0000 1c000000 00000000 017a504c 5200017c .........zPLR..|
Tim Northovere0e3aef2013-01-31 12:12:40 +000020; CHECK: 0010 1e0b0000 00000000 00000000 1b0c1f00 ................
21
22; Don't really care about the rest:
23
24; 0020 1c000000 24000000 00000000 24000000 ....$.......$...
25; 0030 08000000 00000000 00440c1f 10449e02 .........D...D..
26
27; The key test here is that the personality routine is sanely encoded (under the
28; small memory model it must be an 8-byte value for full generality: code+data <
29; 4GB, but you might need both +4GB and -4GB depending on where things end
30; up. However, for completeness:
31
32; First CIE:
33; ----------
34; 1c000000: Length = 0x1c
35; 00000000: This is a CIE
Oliver Stannardf7693f42014-06-19 15:39:33 +000036; 03: Version 3
Tim Northovere0e3aef2013-01-31 12:12:40 +000037; 7a 50 4c 52 00: Augmentation string "zPLR" (personality routine, language-specific data, pointer format)
38; 01: Code alignment factor 1
39; 78: Data alignment factor: -8
40; 1e: Return address in x30
41; 07: Augmentation data 0xb bytes (this is key!)
42; 00: Personality encoding is DW_EH_PE_absptr
43; 00 00 00 00 00 00 00 00: First part of aug (personality routine). Relocated, obviously
44; 00: Second part of aug (language-specific data): absolute pointer format used
45; 1b: pointer format: pc-relative signed 4-byte. Just like GNU.
46; 0c 1f 00: Initial instructions ("DW_CFA_def_cfa x31 ofs 0" in this case)