brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 2ee65a8 Raw
47 lines · plain
1; RUN: llc -verify-machineinstrs -mtriple=aarch64-none-linux-gnu %s -filetype=obj -o %t2; RUN: llvm-objdump -s %t | FileCheck %s3 4declare i32 @__gxx_personality_v0(...)5 6declare void @bar()7 8define i64 @foo(i64 %lhs, i64 %rhs) personality ptr @__gxx_personality_v0 {9  invoke void @bar() to label %end unwind label %clean10end:11 ret i64 012 13clean:14  %tst = landingpad { ptr, i32 } cleanup15  ret i64 4216}17 18; CHECK: Contents of section .eh_frame:19; CHECK: 0000 1c000000 00000000 017a504c 5200017c  .........zPLR..|20; CHECK: 0010 1e0b9c00 00000000 0000001c 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 the28; 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 end30; up. However, for completeness:31 32; First CIE:33; ----------34; 1c000000: Length = 0x1c35; 00000000: This is a CIE36; 03: Version 337; 7a 50 4c 52 00: Augmentation string "zPLR" (personality routine, language-specific data, pointer format)38; 01: Code alignment factor 139; 78: Data alignment factor: -840; 1e: Return address in x3041; 07: Augmentation data 0xb bytes (this is key!)42; 00: Personality encoding is DW_EH_PE_absptr43; 00 00 00 00 00 00 00 00: First part of aug (personality routine). Relocated, obviously44; 00: Second part of aug (language-specific data): absolute pointer format used45; 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)47