[Mips] Replace assembler code by YAML to make the 'gotsym.test' test

target independent.

llvm-svn: 214641
This commit is contained in:
Simon Atanasyan 2014-08-02 20:18:31 +00:00
parent c03105ba8e
commit 0670abdd2e
1 changed files with 24 additions and 13 deletions

View File

@ -1,10 +1,8 @@
# REQUIRES: mips
# Check _gp_disp and GOT_OFFSET_TABLE value
# RUN: llvm-mc -triple=mipsel -filetype=obj -o=%t1 %s
# RUN: lld -flavor gnu -target mipsel -shared --noinhibit-exec -o %t2 %t1
# RUN: llvm-objdump -section-headers -t %t2 | FileCheck -check-prefix=SHARED %s
#
# RUN: yaml2obj -format=elf %s > %t.o
# RUN: lld -flavor gnu -target mipsel -shared --noinhibit-exec -o %t.so %t.o
# RUN: llvm-objdump -h -t %t.so | FileCheck -check-prefix=SHARED %s
# SHARED: Sections:
# SHARED: Idx Name Size Address Type
@ -14,8 +12,8 @@
# SHARED: 00008ff0 g *ABS* 00000000 _gp
# SHARED: 00008ff0 g *ABS* 00000000 _gp_disp
# RUN: lld -flavor gnu -target mipsel -e main --noinhibit-exec -o %t2 %t1
# RUN: llvm-objdump -section-headers -t %t2 | FileCheck -check-prefix=EXE %s
# RUN: lld -flavor gnu -target mipsel -e main --noinhibit-exec -o %t.exe %t.o
# RUN: llvm-objdump -h -t %t.exe | FileCheck -check-prefix=EXE %s
# EXE: Sections:
# EXE: Idx Name Size Address Type
@ -25,8 +23,21 @@
# EXE: 00408ff0 g *ABS* 00000000 _gp
# EXE: 00408ff0 g *ABS* 00000000 _gp_disp
.global main
.ent main
main:
nop
.end main
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_MIPS
Flags: [ EF_MIPS_CPIC, EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
AddressAlign: 0x10
Size: 0x04
Symbols:
Global:
- Name: main
Section: .text