[lld] r210004 - [Mips] Reduce number of input files used my Mips tests.
Simon Atanasyan
simon at atanasyan.com
Sun Jun 1 21:20:01 PDT 2014
Author: atanasyan
Date: Sun Jun 1 23:20:01 2014
New Revision: 210004
URL: http://llvm.org/viewvc/llvm-project?rev=210004&view=rev
Log:
[Mips] Reduce number of input files used my Mips tests.
No functional changes.
Added:
lld/trunk/test/elf/Mips/Inputs/npic-obj.yaml
Removed:
lld/trunk/test/elf/Mips/Inputs/ext.s
lld/trunk/test/elf/Mips/Inputs/ext1.s
Modified:
lld/trunk/test/elf/Mips/exe-dynamic.test
lld/trunk/test/elf/Mips/exe-fileheader.test
lld/trunk/test/elf/Mips/exe-got.test
lld/trunk/test/elf/Mips/la25-stub.test
lld/trunk/test/elf/Mips/plt-header.test
lld/trunk/test/elf/Mips/r26-1.test
Removed: lld/trunk/test/elf/Mips/Inputs/ext.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/Inputs/ext.s?rev=210003&view=auto
==============================================================================
--- lld/trunk/test/elf/Mips/Inputs/ext.s (original)
+++ lld/trunk/test/elf/Mips/Inputs/ext.s (removed)
@@ -1,38 +0,0 @@
-# Assembly code defines set of externally visible labels.
-
-# Shared library generation:
-# llvm-mc -triple=mipsel -filetype=obj -relocation-model=pic \
-# -o=%t1 %p/Inputs/ext.s
-# lld -flavor gnu -target mipsel -shared -o %t2 %t1
-
-# Executable generation:
-# llvm-mc -triple=mipsel -filetype=obj -o=%t1 %p/Inputs/ext.s
-# lld -flavor gnu -target mipsel -e ext1 -o %t2 %t1
-
- .global ext1
- .type ext1, at function
- .ent ext1
-ext1:
- nop
- .end ext1
-
- .global ext2
- .type ext2, at function
- .ent ext2
-ext2:
- nop
- .end ext2
-
- .global ext3
- .type ext3, at function
- .ent ext3
-ext3:
- nop
- .end ext3
-
- .type data1, at object
- .comm data1,4,4
- .type data2, at object
- .comm data2,4,4
- .type data3, at object
- .comm data3,4,4
Removed: lld/trunk/test/elf/Mips/Inputs/ext1.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/Inputs/ext1.s?rev=210003&view=auto
==============================================================================
--- lld/trunk/test/elf/Mips/Inputs/ext1.s (original)
+++ lld/trunk/test/elf/Mips/Inputs/ext1.s (removed)
@@ -1,39 +0,0 @@
-# Assembly code defines set of externally visible labels.
-
-# Shared library generation:
-# llvm-mc -triple=mipsel -filetype=obj -relocation-model=pic \
-# -o=%t1 %p/Inputs/ext1.s
-# lld -flavor gnu -target mipsel -shared -o %t2 %t1
-
-# Executable generation:
-# llvm-mc -triple=mipsel -filetype=obj -o=%t1 %p/Inputs/ext1.s
-# lld -flavor gnu -target mipsel -e ext4 -o %t2 %t1
-
- .abicalls
- .global ext4
- .type ext4, at function
- .ent ext4
-ext4:
- nop
- .end ext4
-
- .global ext5
- .type ext5, at function
- .ent ext5
-ext5:
- nop
- .end ext5
-
- .global ext6
- .type ext6, at function
- .ent ext6
-ext6:
- nop
- .end ext6
-
- .type data4, at object
- .comm data4,4,4
- .type data5, at object
- .comm data5,4,4
- .type data6, at object
- .comm data6,4,4
Added: lld/trunk/test/elf/Mips/Inputs/npic-obj.yaml
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/Inputs/npic-obj.yaml?rev=210004&view=auto
==============================================================================
--- lld/trunk/test/elf/Mips/Inputs/npic-obj.yaml (added)
+++ lld/trunk/test/elf/Mips/Inputs/npic-obj.yaml Sun Jun 1 23:20:01 2014
@@ -0,0 +1,56 @@
+# Define symbols in the .text (T1N, T2N, T3N)
+# and .data (D1N, D2N, D3N) sections.
+# The object file has CPIC flags.
+!ELF
+FileHeader: !FileHeader
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_MIPS
+ Flags: [EF_MIPS_CPIC]
+
+Sections:
+- Name: .text
+ Type: SHT_PROGBITS
+ Content: "000000000000000000000000"
+ AddressAlign: 16
+ Flags: [SHF_EXECINSTR, SHF_ALLOC]
+
+- Name: .data
+ Type: SHT_PROGBITS
+ Content: "000000000000000000000000"
+ AddressAlign: 16
+ Flags: [SHF_WRITE, SHF_ALLOC]
+
+Symbols:
+ Global:
+ - Name: T1N
+ Section: .text
+ Type: STT_FUNC
+ Value: 0x0
+ Size: 4
+ - Name: T2N
+ Section: .text
+ Type: STT_FUNC
+ Value: 0x4
+ Size: 4
+ - Name: T3N
+ Section: .text
+ Type: STT_FUNC
+ Value: 0x8
+ Size: 4
+ - Name: D1N
+ Section: .data
+ Type: STT_OBJECT
+ Value: 0x0
+ Size: 4
+ - Name: D2N
+ Section: .data
+ Type: STT_OBJECT
+ Value: 0x4
+ Size: 4
+ - Name: D3N
+ Section: .data
+ Type: STT_OBJECT
+ Value: 0x8
+ Size: 4
Modified: lld/trunk/test/elf/Mips/exe-dynamic.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/exe-dynamic.test?rev=210004&r1=210003&r2=210004&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/exe-dynamic.test (original)
+++ lld/trunk/test/elf/Mips/exe-dynamic.test Sun Jun 1 23:20:01 2014
@@ -3,9 +3,8 @@
# Check MIPS specific tags in the dynamic table in case executable linking.
# Build shared library
-# RUN: llvm-mc -triple=mipsel -filetype=obj -relocation-model=pic \
-# RUN: -o=%t-obj %p/Inputs/ext.s
-# RUN: lld -flavor gnu -target mipsel -shared -o %t-so %t-obj
+# RUN: yaml2obj -format=elf %S/Inputs/pic-obj.yaml > %t-so-obj
+# RUN: lld -flavor gnu -target mipsel -shared -o %t-so %t-so-obj
# Build executable
# RUN: llvm-mc -triple=mipsel -filetype=obj -o=%t-obj %s
@@ -21,14 +20,14 @@
# CHECK-NEXT: 0x00000004 HASH 0x400110
# CHECK-NEXT: 0x00000005 STRTAB 0x400144
# CHECK-NEXT: 0x00000006 SYMTAB 0x400124
-# CHECK-NEXT: 0x0000000A STRSZ 30 (bytes)
+# CHECK-NEXT: 0x0000000A STRSZ 28 (bytes)
# CHECK-NEXT: 0x0000000B SYMENT 16 (bytes)
# CHECK-NEXT: 0x0000001A FINI_ARRAY 0x0
# CHECK-NEXT: 0x0000001C FINI_ARRAYSZ 0 (bytes)
# CHECK-NEXT: 0x00000002 PLTRELSZ 8 (bytes)
# CHECK-NEXT: 0x70000032 MIPS_PLTGOT 0x402000
# CHECK-NEXT: 0x00000014 PLTREL REL
-# CHECK-NEXT: 0x00000017 JMPREL 0x400164
+# CHECK-NEXT: 0x00000017 JMPREL 0x400160
# CHECK-NEXT: 0x70000001 MIPS_RLD_VERSION 1
# CHECK-NEXT: 0x70000005 MIPS_FLAGS NOTPOT
# CHECK-NEXT: 0x70000006 MIPS_BASE_ADDRESS 0x400000
@@ -44,7 +43,7 @@
.global glob
.ent glob
loc:
- jal ext1
+ jal T1
glob:
jal loc
jal glob
Modified: lld/trunk/test/elf/Mips/exe-fileheader.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/exe-fileheader.test?rev=210004&r1=210003&r2=210004&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/exe-fileheader.test (original)
+++ lld/trunk/test/elf/Mips/exe-fileheader.test Sun Jun 1 23:20:01 2014
@@ -3,9 +3,8 @@
# Check ELF Header for non-pic executable file.
# Build shared library
-# RUN: llvm-mc -triple=mipsel -filetype=obj -relocation-model=pic \
-# RUN: -o=%t-obj %p/Inputs/ext.s
-# RUN: lld -flavor gnu -target mipsel -shared -o %t-so %t-obj
+# RUN: yaml2obj -format=elf %S/Inputs/pic-obj.yaml > %t-so-obj
+# RUN: lld -flavor gnu -target mipsel -shared -o %t-so %t-so-obj
# Build executable
# RUN: llvm-mc -triple=mipsel -filetype=obj -o=%t-obj %s
@@ -50,5 +49,5 @@
.global glob
.ent glob
glob:
- jal ext1
+ jal T1
.end glob
Modified: lld/trunk/test/elf/Mips/exe-got.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/exe-got.test?rev=210004&r1=210003&r2=210004&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/exe-got.test (original)
+++ lld/trunk/test/elf/Mips/exe-got.test Sun Jun 1 23:20:01 2014
@@ -5,14 +5,13 @@
# entry in the local GOT section.
#
# Build shared library
-# RUN: llvm-mc -triple=mipsel -filetype=obj -relocation-model=pic \
-# RUN: -o=%t1 %p/Inputs/ext.s
-# RUN: lld -flavor gnu -target mipsel -shared -o %t2 %t1
+# RUN: yaml2obj -format=elf %S/Inputs/pic-obj.yaml > %t-so-obj
+# RUN: lld -flavor gnu -target mipsel -shared -o %t-so %t-so-obj
# Build executable
# RUN: llvm-mc -triple=mipsel -filetype=obj -o=%t3 %s
# RUN: lld -flavor gnu -target mipsel -e glob \
-# RUN: --output-filetype=yaml -o %t4 %t3 %t2
+# RUN: --output-filetype=yaml -o %t4 %t3 %t-so
# RUN: FileCheck -check-prefix=GOT %s < %t4
# GOT header
@@ -40,7 +39,7 @@
# GOT: - kind: R_MIPS_32
# GOT: offset: 0
# GOT: target: glob
-# Global GOT entry for 'ext1' symbol
+# Global GOT entry for 'T1' symbol
# GOT: - ref-name: L001
# GOT: type: got
# GOT: content: [ 00, 00, 00, 00 ]
@@ -51,12 +50,12 @@
# GOT: references:
# GOT: - kind: LLD_R_MIPS_GLOBAL_GOT
# GOT: offset: 0
-# GOT: target: ext1
+# GOT: target: T1
.abicalls
.global glob
.ent glob
glob:
lw $4,%call16(glob)($28)
- lw $4,%call16(ext1)($28)
+ lw $4,%call16(T1)($28)
.end glob
Modified: lld/trunk/test/elf/Mips/la25-stub.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/la25-stub.test?rev=210004&r1=210003&r2=210004&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/la25-stub.test (original)
+++ lld/trunk/test/elf/Mips/la25-stub.test Sun Jun 1 23:20:01 2014
@@ -3,9 +3,8 @@
# Check LA25 stubs creation when PIC code is called from non-PIC routines.
# Build executable from pic and non-pic code.
-# RUN: llvm-mc -triple=mipsel -filetype=obj -o=%t-npic-o %p/Inputs/ext.s
-# RUN: llvm-mc -triple=mipsel -filetype=obj -relocation-model=pic \
-# RUN: -o=%t-pic-o %p/Inputs/ext1.s
+# RUN: yaml2obj -format=elf %S/Inputs/npic-obj.yaml > %t-npic-o
+# RUN: yaml2obj -format=elf %S/Inputs/pic-obj.yaml > %t-pic-o
# RUN: llvm-mc -triple=mipsel -filetype=obj -o=%t-main-o %s
# RUN: lld -flavor gnu -target mipsel -e glob -o %t-exe \
# RUN: %t-npic-o %t-pic-o %t-main-o
@@ -13,37 +12,40 @@
# RUN: llvm-objdump -disassemble %t-exe | FileCheck -check-prefix=EXE %s
# EXE: Disassembly of section .text:
-# EXE: ext1:
+# EXE: T1N:
# EXE-NEXT: 400140: 00 00 00 00 nop
-# EXE: ext4:
-# EXE-NEXT: 40014c: 00 00 00 00 nop
+# EXE: T1:
+# EXE-NEXT: 400150: 00 00 00 00 nop
# EXE: glob:
-# EXE-NEXT: 400158: 09 f8 20 03 jalr $25
-# EXE-NEXT: 40015c: 00 00 00 00 nop
+# EXE-NEXT: 40015c: 09 f8 20 03 jalr $25
+# EXE-NEXT: 400160: 00 00 00 00 nop
# Jump to 'loc' label address
-# EXE-NEXT: 400160: 5a 00 10 0c jal 4194664
-# EXE-NEXT: 400164: 00 00 00 00 nop
+# EXE-NEXT: 400164: 5b 00 10 0c jal 4194668
+# EXE-NEXT: 400168: 00 00 00 00 nop
#
# EXE: loc:
# Jump to 'glob' non-pic symbol
-# EXE-NEXT: 400168: 56 00 10 0c jal 4194648
-# EXE-NEXT: 40016c: 00 00 00 00 nop
-# Jump to 'ext1' non-pic symbol
-# EXE-NEXT: 400170: 50 00 10 0c jal 4194624
-# EXE-NEXT: 400174: 00 00 00 00 nop
-# Jump to LA25 stub for 'ext4' pic symbol
-# EXE-NEXT: 400178: 60 00 10 0c jal 4194688
-# EXE-NEXT: 40017c: 00 00 00 00 nop
+# EXE-NEXT: 40016c: 57 00 10 0c jal 4194652
+# EXE-NEXT: 400170: 00 00 00 00 nop
+# Jump to 'T1N' non-pic symbol
+# EXE-NEXT: 400174: 50 00 10 0c jal 4194624
+# EXE-NEXT: 400178: 00 00 00 00 nop
+# Jump to LA25 stub for 'T1' pic symbol
+# EXE-NEXT: 40017c: 64 00 10 0c jal 4194704
+# EXE-NEXT: 400180: 00 00 00 00 nop
+# EXE-NEXT: 400184: 00 00 00 00 nop
+# EXE-NEXT: 400188: 00 00 00 00 nop
+# EXE-NEXT: 40018c: 00 00 00 00 nop
# LA25 Stub
-# EXE-NEXT: 400180: 40 00 19 3c lui $25, 64
-# Jump to 'ext4' label address
-# EXE-NEXT: 400184: 53 00 10 08 j 4194636
-# EXE-NEXT: 400188: 4c 01 39 27 addiu $25, $25, 332
-# EXE-NEXT: 40018c: 00 00 00 00 nop
+# EXE-NEXT: 400190: 40 00 19 3c lui $25, 64
+# Jump to 'T1' label address
+# EXE-NEXT: 400194: 54 00 10 08 j 4194640
+# EXE-NEXT: 400198: 50 01 39 27 addiu $25, $25, 336
+# EXE-NEXT: 40019c: 00 00 00 00 nop
.global glob
.ent glob
@@ -52,6 +54,6 @@ glob:
jal loc
loc:
jal glob
- jal ext1
- jal ext4
+ jal T1N
+ jal T1
.end glob
Modified: lld/trunk/test/elf/Mips/plt-header.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/plt-header.test?rev=210004&r1=210003&r2=210004&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/plt-header.test (original)
+++ lld/trunk/test/elf/Mips/plt-header.test Sun Jun 1 23:20:01 2014
@@ -3,13 +3,12 @@
# Check initialization of .plt header entries.
# Build shared library
-# RUN: llvm-mc -triple=mipsel -filetype=obj -relocation-model=pic \
-# RUN: -o=%t1 %p/Inputs/ext.s
-# RUN: lld -flavor gnu -target mipsel -shared -o %t2 %t1
+# RUN: yaml2obj -format=elf %S/Inputs/pic-obj.yaml > %t-obj
+# RUN: lld -flavor gnu -target mipsel -shared -o %t-so %t-obj
# Build executable
# RUN: llvm-mc -triple=mipsel -filetype=obj -o=%t3 %s
-# RUN: lld -flavor gnu -target mipsel -e glob -o %t4 %t3 %t2
+# RUN: lld -flavor gnu -target mipsel -e glob -o %t4 %t3 %t-so
# RUN: llvm-objdump -section-headers -disassemble %t4 | \
# RUN: FileCheck -check-prefix=EXE %s
@@ -38,5 +37,5 @@ glob:
jal loc
loc:
jal glob
- jal ext1
+ jal T1
.end glob
Modified: lld/trunk/test/elf/Mips/r26-1.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/Mips/r26-1.test?rev=210004&r1=210003&r2=210004&view=diff
==============================================================================
--- lld/trunk/test/elf/Mips/r26-1.test (original)
+++ lld/trunk/test/elf/Mips/r26-1.test Sun Jun 1 23:20:01 2014
@@ -3,8 +3,7 @@
# Check handling of R_MIPS_26 relocation.
# Build shared library
-# RUN: llvm-mc -triple=mipsel -filetype=obj -relocation-model=pic \
-# RUN: -o=%t-pic-o %p/Inputs/ext.s
+# RUN: yaml2obj -format=elf %S/Inputs/pic-obj.yaml > %t-pic-o
# RUN: lld -flavor gnu -target mipsel -shared -o %t-so %t-pic-o
# Build executable
@@ -21,14 +20,14 @@
# OBJ-REL-NEXT: Section (2) .rel.text {
# OBJ-REL-NEXT: 0x8 R_MIPS_26 .text 0x0
# OBJ-REL-NEXT: 0x10 R_MIPS_26 glob 0x0
-# OBJ-REL-NEXT: 0x18 R_MIPS_26 ext1 0x0
+# OBJ-REL-NEXT: 0x18 R_MIPS_26 T1 0x0
# OBJ-REL-NEXT: }
# OBJ-REL-NEXT: ]
# Executable file has the only relocation for external symbol
# EXE-REL: Relocations [
# EXE-REL-NEXT: Section (5) .rel.plt {
-# EXE-REL-NEXT: 0x402008 R_MIPS_JUMP_SLOT ext1 0x0
+# EXE-REL-NEXT: 0x402008 R_MIPS_JUMP_SLOT T1 0x0
# EXE-REL-NEXT: }
# EXE-REL-NEXT: ]
@@ -54,7 +53,7 @@
# EXE-NEXT: 4001b0: 68 00 10 0c jal 4194720
# EXE-NEXT: 4001b4: 00 00 00 00 nop
#
-# Jump to the first PLT entry (.plt + 32) for ext1 entry
+# Jump to the first PLT entry (.plt + 32) for T1 entry
# EXE-NEXT: 4001b8: 64 00 10 0c jal 4194704
# EXE-NEXT: 4001bc: 00 00 00 00 nop
@@ -70,5 +69,5 @@ glob:
jal loc
loc:
jal glob
- jal ext1
+ jal T1
.end glob
More information about the llvm-commits
mailing list