1*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -triple aarch64-none-linux-gnu -filetype=obj %s -o %t 2*9880d681SAndroid Build Coastguard Worker// RUN: llvm-objdump -s %t | FileCheck %s 3*9880d681SAndroid Build Coastguard Worker .text 4*9880d681SAndroid Build Coastguard Worker .globl foo 5*9880d681SAndroid Build Coastguard Worker .type foo,@function 6*9880d681SAndroid Build Coastguard Workerfoo: 7*9880d681SAndroid Build Coastguard Worker .cfi_startproc 8*9880d681SAndroid Build Coastguard Worker ret 9*9880d681SAndroid Build Coastguard Worker .cfi_endproc 10*9880d681SAndroid Build Coastguard Worker 11*9880d681SAndroid Build Coastguard Worker// The really key points we're checking here are: 12*9880d681SAndroid Build Coastguard Worker// * Return register is x30. 13*9880d681SAndroid Build Coastguard Worker// * Pointer format is 0x1b (GNU doesn't appear to understand others). 14*9880d681SAndroid Build Coastguard Worker 15*9880d681SAndroid Build Coastguard Worker// The rest is largely incidental, but not expected to change regularly. 16*9880d681SAndroid Build Coastguard Worker 17*9880d681SAndroid Build Coastguard Worker// Output is: 18*9880d681SAndroid Build Coastguard Worker 19*9880d681SAndroid Build Coastguard Worker// CHECK: Contents of section .eh_frame: 20*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT: 0000 10000000 00000000 017a5200 017c1e01 .........zR..|.. 21*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT: 0010 1b0c1f00 10000000 18000000 00000000 ................ 22*9880d681SAndroid Build Coastguard Worker 23*9880d681SAndroid Build Coastguard Worker 24*9880d681SAndroid Build Coastguard Worker// Won't check the rest, it's rather incidental. 25*9880d681SAndroid Build Coastguard Worker// 0020 04000000 00000000 ........ 26*9880d681SAndroid Build Coastguard Worker 27*9880d681SAndroid Build Coastguard Worker 28*9880d681SAndroid Build Coastguard Worker 29*9880d681SAndroid Build Coastguard Worker// The first CIE: 30*9880d681SAndroid Build Coastguard Worker// ------------------- 31*9880d681SAndroid Build Coastguard Worker// 10000000: length of first CIE = 0x10 32*9880d681SAndroid Build Coastguard Worker// 00000000: This is a CIE 33*9880d681SAndroid Build Coastguard Worker// 03: version = 0x3 34*9880d681SAndroid Build Coastguard Worker// 7a 52 00: augmentation string "zR" -- pointer format is specified 35*9880d681SAndroid Build Coastguard Worker// 01: code alignment factor 1 36*9880d681SAndroid Build Coastguard Worker// 7c: data alignment factor -4 37*9880d681SAndroid Build Coastguard Worker// 1e: return address register 30 (== x30). 38*9880d681SAndroid Build Coastguard Worker// 01: 1 byte of augmentation 39*9880d681SAndroid Build Coastguard Worker// 1b: pointer format 1b: DW_EH_PE_pcrel | DW_EH_PE_sdata4 40*9880d681SAndroid Build Coastguard Worker// 0c 1f 00: initial instructions: "DW_CFA_def_cfa x31 ofs 0" in this case 41*9880d681SAndroid Build Coastguard Worker 42*9880d681SAndroid Build Coastguard Worker// Next the FDE: 43*9880d681SAndroid Build Coastguard Worker// ------------- 44*9880d681SAndroid Build Coastguard Worker// 10000000: FDE length 0x10 45*9880d681SAndroid Build Coastguard Worker// 18000000: Uses CIE 0x18 backwards (only coincidentally same as above) 46*9880d681SAndroid Build Coastguard Worker// 00000000: PC begin for this FDE is at 00000000 (relocation is applied here) 47*9880d681SAndroid Build Coastguard Worker// 04000000: FDE applies up to PC begin+0x14 48*9880d681SAndroid Build Coastguard Worker// 00: Augmentation string length 0 for this FDE 49