1// Test the bits of .eh_frame on mips that are already implemented correctly. 2 3// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips-unknown-linux-gnu 4// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,ABS32 %s 5// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF32,DWARF32_ABS %s 6 7// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mipsel-unknown-linux-gnu 8// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,ABS32 %s 9// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF32,DWARF32_ABS %s 10 11// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64-unknown-linux-gnu 12// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,ABS64 %s 13// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_ABS %s 14 15// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64el-unknown-linux-gnu 16// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,ABS64 %s 17// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_ABS %s 18 19/// Check that position-indenpendent code use PC-relative relocations: 20// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips-unknown-linux-gnu --position-independent 21// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,PIC32 %s 22// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF32,DWARF32_PIC %s 23 24// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mipsel-unknown-linux-gnu --position-independent 25// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,PIC32 %s 26// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF32,DWARF32_PIC %s 27 28// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64-unknown-linux-gnu --position-independent 29// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,PIC64 %s 30// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_PIC %s 31 32// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64el-unknown-linux-gnu --position-independent 33// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,PIC64 %s 34// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_PIC %s 35 36/// However using the large code model forces R_MIPS_64 since there is no R_MIPS_PC64 relocation: 37// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64-unknown-linux-gnu --position-independent --large-code-model 38// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,ABS64 %s 39// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_ABS %s 40 41// RUN: llvm-mc -filetype=obj %s -o %t.o -triple mips64el-unknown-linux-gnu --position-independent --large-code-model 42// RUN: llvm-readobj -r %t.o | FileCheck --check-prefixes=RELOCS,ABS64 %s 43// RUN: llvm-dwarfdump -eh-frame %t.o | FileCheck --check-prefixes=DWARF64,DWARF64_ABS %s 44 45func: 46 .cfi_startproc 47 .cfi_endproc 48 49// RELOCS: Relocations [ 50// RELOCS: Section ({{.+}}) .rel{{a?}}.eh_frame { 51// ABS32-NEXT: R_MIPS_32 52// ABS64-NEXT: R_MIPS_64/R_MIPS_NONE/R_MIPS_NONE 53// PIC32-NEXT: R_MIPS_PC32 54// PIC64-NEXT: R_MIPS_PC32/R_MIPS_NONE/R_MIPS_NONE 55// RELOCS-NEXT: } 56 57// DWARF32: 00000000 00000010 00000000 CIE 58// DWARF32-NEXT: Format: DWARF32 59// DWARF32-NEXT: Version: 1 60// DWARF32-NEXT: Augmentation: "zR" 61// DWARF32-NEXT: Code alignment factor: 1 62// DWARF32-NEXT: Data alignment factor: -4 63// DWARF32-NEXT: Return address column: 31 64// DWARF32_ABS-NEXT: Augmentation data: 0B 65// ^^ fde pointer encoding: DW_EH_PE_sdata4 66// DWARF32_PIC-NEXT: Augmentation data: 1B 67// ^^ fde pointer encoding: DW_EH_PE_pcrel | DW_EH_PE_sdata4 68// DWARF32-EMPTY: 69// DWARF32-NEXT: DW_CFA_def_cfa_register: SP_64 70// 71// DWARF32_ABS: 00000014 00000010 00000018 FDE cie=00000000 pc=00000000...00000000 72// DWARF32_PIC: 00000014 00000010 00000018 FDE cie=00000000 pc=0000001c...0000001c 73// DWARF32-NEXT: Format: DWARF32 74// DWARF32-NEXT: DW_CFA_nop: 75// DWARF32-NEXT: DW_CFA_nop: 76// DWARF32-NEXT: DW_CFA_nop: 77 78 79// DWARF64: 00000000 00000010 00000000 CIE 80// DWARF64-NEXT: Format: DWARF32 81// DWARF64-NEXT: Version: 1 82// DWARF64-NEXT: Augmentation: "zR" 83// DWARF64-NEXT: Code alignment factor: 1 84// DWARF64-NEXT: Data alignment factor: -8 85// ^^ GAS uses -4. Should be ok as long as 86// all offsets we need are a multiple of 8. 87// DWARF64-NEXT: Return address column: 31 88// DWARF64_ABS-NEXT: Augmentation data: 0C 89// ^^ fde pointer encoding: DW_EH_PE_sdata8 90// DWARF64_PIC: Augmentation data: 1B 91// ^^ fde pointer encoding: DW_EH_PE_pcrel | DW_EH_PE_sdata4 92// DWARF64-EMPTY: 93// DWARF64-NEXT: DW_CFA_def_cfa_register: SP_64 94// DWARF64_PIC-NEXT: DW_CFA_nop: 95// 96// DWARF64_ABS: 00000014 00000018 00000018 FDE cie=00000000 pc=00000000...00000000 97// DWARF64_PIC: 00000014 00000010 00000018 FDE cie=00000000 pc=00000000...00000000 98// DWARF64-NEXT: Format: DWARF32 99// DWARF64-NEXT: DW_CFA_nop: 100// DWARF64-NEXT: DW_CFA_nop: 101// DWARF64-NEXT: DW_CFA_nop: 102