Make a few tests shorter. NFC.

llvm-svn: 300120
This commit is contained in:
Rui Ueyama 2017-04-12 22:38:02 +00:00
parent 78144bc3ab
commit 58c18f8f23
7 changed files with 29 additions and 95 deletions

View File

@ -2,26 +2,11 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
# RUN: echo "SECTIONS { \
# RUN: . = 0x1000; \
# RUN: .aaa : AT(0x2000) \
# RUN: { \
# RUN: *(.aaa) \
# RUN: } \
# RUN: .bbb : \
# RUN: { \
# RUN: *(.bbb) \
# RUN: } \
# RUN: .ccc : AT(0x3000) \
# RUN: { \
# RUN: *(.ccc) \
# RUN: } \
# RUN: .ddd : AT(0x4000) \
# RUN: { \
# RUN: *(.ddd) \
# RUN: } \
# RUN: .eee 0x5000 : AT(0x5000) \
# RUN: { \
# RUN: *(.eee) \
# RUN: } \
# RUN: .aaa : AT(0x2000) { *(.aaa) } \
# RUN: .bbb : { *(.bbb) } \
# RUN: .ccc : AT(0x3000) { *(.ccc) } \
# RUN: .ddd : AT(0x4000) { *(.ddd) } \
# RUN: .eee 0x5000 : AT(0x5000) { *(.eee) } \
# RUN: }" > %t.script
# RUN: ld.lld %t --script %t.script -o %t2
# RUN: llvm-readobj -program-headers %t2 | FileCheck %s

View File

@ -3,16 +3,10 @@
## Check simple RAM-only memory region.
# RUN: echo "MEMORY { \
# RUN: ram (rwx) : ORIGIN = 0x8000, LENGTH = 256K \
# RUN: } \
# RUN: echo "MEMORY { ram (rwx) : ORIGIN = 0x8000, LENGTH = 256K } \
# RUN: SECTIONS { \
# RUN: .text : { \
# RUN: *(.text) \
# RUN: } > ram \
# RUN: .data : { \
# RUN: *(.data) \
# RUN: } > ram \
# RUN: .text : { *(.text) } > ram \
# RUN: .data : { *(.data) } > ram \
# RUN: }" > %t.script
# RUN: ld.lld -o %t1 --script %t.script %t
# RUN: llvm-objdump -section-headers %t1 | FileCheck -check-prefix=RAM %s
@ -27,12 +21,8 @@
# RUN: rom (rx) : org = 0x80000000, len = 64M \
# RUN: } \
# RUN: SECTIONS { \
# RUN: .text : { \
# RUN: *(.text) \
# RUN: } > rom \
# RUN: .data : { \
# RUN: *(.data) \
# RUN: } > ram \
# RUN: .text : { *(.text) } > rom \
# RUN: .data : { *(.data) } > ram \
# RUN: }" > %t.script
# RUN: ld.lld -o %t1 --script %t.script %t
# RUN: llvm-objdump -section-headers %t1 | FileCheck -check-prefix=RAMROM %s
@ -47,12 +37,8 @@
# RUN: rom (rx) : o = 0x80000000, l = 64M \
# RUN: } \
# RUN: SECTIONS { \
# RUN: .text : { \
# RUN: *(.text) \
# RUN: } \
# RUN: .data : { \
# RUN: *(.data) \
# RUN: } > ram \
# RUN: .text : { *(.text) } \
# RUN: .data : { *(.data) } > ram \
# RUN: }" > %t.script
# RUN: ld.lld -o %t1 --script %t.script %t
# RUN: llvm-objdump -section-headers %t1 | FileCheck -check-prefix=ATTRS %s
@ -83,16 +69,10 @@
## Check no region available.
# RUN: echo "MEMORY { \
# RUN: ram (!rx) : ORIGIN = 0x8000, LENGTH = 256K \
# RUN: } \
# RUN: echo "MEMORY { ram (!rx) : ORIGIN = 0x8000, LENGTH = 256K } \
# RUN: SECTIONS { \
# RUN: .text : { \
# RUN: *(.text) \
# RUN: } \
# RUN: .data : { \
# RUN: *(.data) \
# RUN: } > ram \
# RUN: .text : { *(.text) } \
# RUN: .data : { *(.data) } > ram \
# RUN: }" > %t.script
# RUN: not ld.lld -o %t2 --script %t.script %t 2>&1 \
# RUN: | FileCheck -check-prefix=ERR4 %s
@ -107,16 +87,10 @@
## Check region overflow.
# RUN: echo "MEMORY { \
# RUN: ram (rwx) : ORIGIN = 0x0, LENGTH = 2K \
# RUN: } \
# RUN: echo "MEMORY { ram (rwx) : ORIGIN = 0x0, LENGTH = 2K } \
# RUN: SECTIONS { \
# RUN: .text : { \
# RUN: *(.text) \
# RUN: } > ram \
# RUN: .data : { \
# RUN: *(.data) \
# RUN: } > ram \
# RUN: .text : { *(.text) } > ram \
# RUN: .data : { *(.data) } > ram \
# RUN: }" > %t.script
# RUN: not ld.lld -o %t2 --script %t.script %t 2>&1 \
# RUN: | FileCheck -check-prefix=ERR6 %s

View File

@ -28,23 +28,17 @@
# CHECK-NEXT: 6 .mega2 00000008 0000000000200000
## Mailformed number errors.
# RUN: echo "SECTIONS { \
# RUN: . = 0x11h; \
# RUN: }" > %t2.script
# RUN: echo "SECTIONS { . = 0x11h; }" > %t2.script
# RUN: not ld.lld %t --script %t2.script -o %t3 2>&1 | \
# RUN: FileCheck --check-prefix=ERR1 %s
# ERR1: malformed number: 0x11h
# RUN: echo "SECTIONS { \
# RUN: . = 0x11k; \
# RUN: }" > %t3.script
# RUN: echo "SECTIONS { . = 0x11k; }" > %t3.script
# RUN: not ld.lld %t --script %t3.script -o %t4 2>&1 | \
# RUN: FileCheck --check-prefix=ERR2 %s
# ERR2: malformed number: 0x11k
# RUN: echo "SECTIONS { \
# RUN: . = 0x11m; \
# RUN: }" > %t4.script
# RUN: echo "SECTIONS { . = 0x11m; }" > %t4.script
# RUN: not ld.lld %t --script %t4.script -o %t5 2>&1 | \
# RUN: FileCheck --check-prefix=ERR3 %s
# ERR3: malformed number: 0x11m

View File

@ -1,22 +1,10 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
# RUN: echo "SECTIONS { \
# RUN: .aaa 0x2000 : \
# RUN: { \
# RUN: *(.aaa) \
# RUN: } \
# RUN: .bbb 0x1 ? 0x3000 : 0x4000 : \
# RUN: { \
# RUN: *(.bbb) \
# RUN: } \
# RUN: .ccc ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) : \
# RUN: { \
# RUN: *(.ccc) \
# RUN: } \
# RUN: .ddd 0x5001 : \
# RUN: { \
# RUN: *(.ddd) \
# RUN: } \
# RUN: echo "SECTIONS { \
# RUN: .aaa 0x2000 : { *(.aaa) } \
# RUN: .bbb 0x1 ? 0x3000 : 0x4000 : { *(.bbb) } \
# RUN: .ccc ALIGN(CONSTANT(MAXPAGESIZE)) + (. & (CONSTANT(MAXPAGESIZE) - 1)) : { *(.ccc) } \
# RUN: .ddd 0x5001 : { *(.ddd) } \
# RUN: }" > %t.script
# RUN: ld.lld %t --script %t.script -o %tout
# RUN: llvm-readobj -s %tout | FileCheck %s

View File

@ -44,9 +44,7 @@
# CHECK-NEXT: Alignment: 16384
# CHECK-NEXT: }
# RUN: echo "SECTIONS { \
# RUN: symbol = CONSTANT(MAXPAGESIZE); \
# RUN: }" > %t.script
# RUN: echo "SECTIONS { symbol = CONSTANT(MAXPAGESIZE); }" > %t.script
# RUN: ld.lld -z max-page-size=0x4000 -o %t1 --script %t.script %t
# RUN: llvm-objdump -t %t1 | FileCheck -check-prefix CHECK-SCRIPT %s

View File

@ -1,10 +1,7 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
# RUN: echo "SECTIONS { \
# RUN: .text : { *(.text) } \
# RUN: foo : { *(foo) } \
# RUN: } " > %t.script
# RUN: echo "SECTIONS { .text : {*(.text)} foo : {*(foo)}}" > %t.script
# RUN: ld.lld -o %t --script %t.script %t.o -shared
# RUN: llvm-objdump --section-headers %t | FileCheck %s

View File

@ -40,9 +40,7 @@
# CHECK-NEXT: 0000000000029000 *ABS* 00000000 symbol11
# CHECK-NEXT: 0000000000001235 *ABS* 00000000 symbol12
# RUN: echo "SECTIONS { \
# RUN: symbol2 = symbol; \
# RUN: }" > %t2.script
# RUN: echo "SECTIONS { symbol2 = symbol; }" > %t2.script
# RUN: not ld.lld -o %t2 --script %t2.script %t 2>&1 \
# RUN: | FileCheck -check-prefix=ERR %s
# ERR: {{.*}}.script:1: symbol not found: symbol