diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-03 03:13:19 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-03 03:13:19 +0000 |
commit | 04011e8429033ae0623ea629527d2d13de3f8109 (patch) | |
tree | cd53708ff252d83d92862acfb8364d477ec54838 /test/MC/Mips/eh-frame.s | |
parent | 729c19482f434d8f3889d2a2c611a6e7813444f0 (diff) | |
download | external_llvm-04011e8429033ae0623ea629527d2d13de3f8109.zip external_llvm-04011e8429033ae0623ea629527d2d13de3f8109.tar.gz external_llvm-04011e8429033ae0623ea629527d2d13de3f8109.tar.bz2 |
Fix the fde encoding used by mips to match gas.
This finally fixes the encoding. The patch also
* Removes eh-frame.ll. It was an unnecessary .ll to .o test that was checking
the wrong value.
* Merge fde-reloc.s and eh-frame.s into a single test, since the only difference
was the run lines.
* Don't blindly test the content of the entire .eh_frame section. It makes it
hard to anyone actually fixing a bug and hitting a difference in a binary
blob. Instead, use a CHECK for each field and document what is being checked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178615 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/Mips/eh-frame.s')
-rw-r--r-- | test/MC/Mips/eh-frame.s | 191 |
1 files changed, 156 insertions, 35 deletions
diff --git a/test/MC/Mips/eh-frame.s b/test/MC/Mips/eh-frame.s index 56278b8..67df213 100644 --- a/test/MC/Mips/eh-frame.s +++ b/test/MC/Mips/eh-frame.s @@ -1,46 +1,167 @@ -// Assembler generated object test. -// This tests .eh_frame descriptors minimally. +// Test the bits of .eh_frame on mips that are already implemented correctly. -// What we really need is a prettyprinter output check not unlike what -// gnu's readobj generates instead of checking the bits for .eh_frame. +// FIXME: This test would be a lot cleaner if llvm-objdump had the +// --dwarf=frames option. -// RUN: llvm-mc -filetype=obj -mcpu=mips32r2 -triple mipsel-unknown-linux -arch=mipsel %s -o - \ -// RUN: | llvm-objdump -s - | FileCheck -check-prefix=CHECK-LEO32 %s +// RUN: llvm-mc -filetype=obj %s -o %t.o -arch=mips +// RUN: llvm-objdump -r -s %t.o | FileCheck --check-prefix=MIPS32 %s -// RUN: llvm-mc -filetype=obj -mcpu=mips32r2 -triple mips-unknown-linux -arch=mips %s -o - \ -// RUN: | llvm-objdump -s - | FileCheck -check-prefix=CHECK-BEO32 %s +// RUN: llvm-mc -filetype=obj %s -o %t.o -arch=mipsel +// RUN: llvm-objdump -r -s %t.o | FileCheck --check-prefix=MIPS32EL %s -// RUN: llvm-mc -filetype=obj -mcpu=mips64r2 -mattr=n64 -arch=mips64el %s -o - \ -// RUN: | llvm-objdump -s - | FileCheck -check-prefix=CHECK-LE64 %s +// RUN: llvm-mc -filetype=obj %s -o %t.o -arch=mips64 +// RUN: llvm-objdump -r -s %t.o | FileCheck --check-prefix=MIPS64 %s -// RUN: llvm-mc -filetype=obj -mcpu=mips64r2 -mattr=n64 -arch=mips64 %s -o - \ -// RUN: | llvm-objdump -s - | FileCheck -check-prefix=CHECK-BE64 %s +// RUN: llvm-mc -filetype=obj %s -o %t.o -arch=mips64el +// RUN: llvm-objdump -r -s %t.o | FileCheck --check-prefix=MIPS64EL %s -// O32 little endian -// CHECK-LEO32: Contents of section .eh_frame: -// CHECK-LEO32-NEXT: 0000 10000000 00000000 017a5200 017c1f01 .........zR..|.. -// CHECK-LEO32-NEXT: 0010 000c1d00 10000000 18000000 00000000 ................ -// CHECK-LEO32-NEXT: 0020 00000000 00000000 ........ +func: + .cfi_startproc + .cfi_endproc -// O32 big endian -// CHECK-BEO32: Contents of section .eh_frame: -// CHECK-BEO32-NEXT 0000 00000010 00000000 017a5200 017c1f01 .........zR..|.. -// CHECK-BEO32-NEXT 0010 000c1d00 00000010 00000018 00000000 ................ -// CHECK-BEO32-NEXT 0020 00000000 00000000 ........ +// MIPS32: RELOCATION RECORDS FOR [.eh_frame]: +// MIPS32-NEXT: R_MIPS_32 +// MIPS32: Contents of section .eh_frame: +// MIPS32-NEXT: 0000 -// N64 little endian -// CHECK-LE64: Contents of section .eh_frame: -// CHECK-LE64-NEXT: 0000 10000000 00000000 017a5200 01781f01 .........zR..x.. -// CHECK-LE64-NEXT: 0010 000c1d00 18000000 18000000 00000000 ................ -// CHECK-LE64-NEXT: 0020 00000000 00000000 00000000 00000000 ................ +// Length +// MIPS32: 00000010 -// N64 big endian -// CHECK-BE64: Contents of section .eh_frame: -// CHECK-BE64-NEXT: 0000 00000010 00000000 017a5200 01781f01 .........zR..x.. -// CHECK-BE64-NEXT: 0010 000c1d00 00000018 00000018 00000000 ................ -// CHECK-BE64-NEXT: 0020 00000000 00000000 00000000 00000000 ................ +// CIE ID +// MIPS32: 00000000 -func: - .cfi_startproc - .cfi_endproc +// Version +// MIPS32: 01 + +// Augmentation String +// MIPS32: 7a5200 + +// Code Alignment Factor +// MIPS32: 01 + +// Data Alignment Factor (-4) +// MIPS32: 7c + +// Return Address Register +// MIPS32: 1f + +// Augmentation Size +// MIPS32: 01 + +// MIPS32: .........zR..|.. +// MIPS32-NEXT: 0010 + +// Augmentation (fde pointer encoding: DW_EH_PE_sdata4) +// MIPS32: 0b +// FIXME: The instructions are different from the ones produces by gas. + +// MIPS32EL: RELOCATION RECORDS FOR [.eh_frame]: +// MIPS32EL-NEXT: R_MIPS_32 +// MIPS32EL: Contents of section .eh_frame: +// MIPS32EL-NEXT: 0000 + +// Length +// MIPS32EL: 10000000 + +// CIE ID +// MIPS32EL: 00000000 + +// Version +// MIPS32EL: 01 + +// Augmentation String +// MIPS32EL: 7a5200 + +// Code Alignment Factor +// MIPS32EL: 01 + +// Data Alignment Factor (-4) +// MIPS32EL: 7c + +// Return Address Register +// MIPS32EL: 1f + +// Augmentation Size +// MIPS32EL: 01 + +// MIPS32EL: .........zR..|.. +// MIPS32EL-NEXT: 0010 + +// Augmentation (fde pointer encoding: DW_EH_PE_sdata4) +// MIPS32EL: 0b +// FIXME: The instructions are different from the ones produces by gas. + +// MIPS64: RELOCATION RECORDS FOR [.eh_frame]: +// MIPS64-NEXT: R_MIPS_64 +// MIPS64: Contents of section .eh_frame: +// MIPS64-NEXT: 0000 + +// Length +// MIPS64: 00000010 + +// CIE ID +// MIPS64: 00000000 + +// Version +// MIPS64: 01 + +// Augmentation String +// MIPS64: 7a5200 + +// Code Alignment Factor +// MIPS64: 01 + +// Data Alignment Factor (-8). GAS uses -4. Should be ok as long as all +// offsets we need are a multiple of 8. +// MIPS64: 78 + +// Return Address Register +// MIPS64: 1f + +// Augmentation Size +// MIPS64: 01 + +// MIPS64: .........zR..x.. +// MIPS64-NEXT: 0010 + +// Augmentation (fde pointer encoding: DW_EH_PE_sdata8) +// MIPS64: 0c +// FIXME: The instructions are different from the ones produces by gas. + + +// MIPS64EL: RELOCATION RECORDS FOR [.eh_frame]: +// FIXME: llvm-objdump currently misprints the relocations for mips64el +// MIPS64EL: Contents of section .eh_frame: +// MIPS64EL-NEXT: 0000 + +// Length +// MIPS64EL: 10000000 + +// CIE ID +// MIPS64EL: 00000000 + +// Version +// MIPS64EL: 01 + +// Augmentation String +// MIPS64EL: 7a5200 + +// Code Alignment Factor +// MIPS64EL: 01 + +// Data Alignment Factor (-8). GAS uses -4. Should be ok as long as all +// offsets we need are a multiple of 8. +// MIPS64EL: 78 + +// Return Address Register +// MIPS64EL: 1f + +// Augmentation Size +// MIPS64EL: 01 + +// MIPS64EL: .........zR..x.. +// MIPS64EL-NEXT: 0010 +// Augmentation (fde pointer encoding: DW_EH_PE_sdata8) +// MIPS64EL: 0c +// FIXME: The instructions are different from the ones produces by gas. |