Skip to content

Commit a892c0e

Browse files
committed
[ELF][test] Improve test coverage
1 parent 99951a5 commit a892c0e

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

lld/test/ELF/common-page.s

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,8 @@ _start:
221221
# CHECK-COMMON-NEXT: PF_W (0x2)
222222
# CHECK-COMMON-NEXT: ]
223223
# CHECK-COMMON-NEXT: Alignment: 0
224+
225+
# RUN: not ld.lld -z max-page-size=0x10001 -z common-page-size=0x1001 %t -o /dev/null 2>&1 | FileCheck %s --check-prefix=INVALID
226+
227+
# INVALID: error: max-page-size: value isn't a power of 2
228+
# INVALID-NEXT: error: common-page-size: value isn't a power of 2

lld/test/ELF/linkerscript/memory-err.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
# RUN: not ld.lld -o /dev/null -T %t.script %t.o 2>&1 | FileCheck --check-prefix=ERR5 %s
3636
# ERR5: error: memory region 'ram' not declared
3737

38+
# RUN: echo 'SECTIONS { .text : { *(.text) } AT> ram }' > %t.script
39+
# RUN: not ld.lld -o /dev/null -T %t.script %t.o 2>&1 | FileCheck --check-prefix=ERR5 %s
40+
3841
## Check region overflow.
3942

4043
# RUN: echo 'MEMORY { ram (rwx) : ORIGIN = 0, LENGTH = 2K } \

lld/test/ELF/start-group.s

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# REQUIRES: x86
2+
3+
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
4+
5+
# RUN: not ld.lld --start-group --start-group %t.o 2>&1 | FileCheck %s --check-prefix=NESTED
6+
# NESTED: nested --start-group
7+
8+
# RUN: not ld.lld --end-group 2>&1 | FileCheck %s --check-prefix=END
9+
# RUN: not ld.lld '-)' 2>&1 | FileCheck %s --check-prefix=END
10+
# END: stray --end-group
11+
12+
.globl _start
13+
_start:

lld/test/ELF/warn-backrefs.s

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
# RUN: echo 'GROUP("%t2.a" "%t1.o")' > %t2.lds
3232
# RUN: ld.lld --fatal-warnings --warn-backrefs %t2.lds -o /dev/null
3333
# RUN: ld.lld --fatal-warnings --warn-backrefs '-(' %t2.a %t1.o '-)' -o /dev/null
34+
# RUN: ld.lld --fatal-warnings --warn-backrefs --start-group %t2.a %t1.o --end-group -o /dev/null
3435

3536
## A backward reference from %t1.o to %t2.a (added by %t3.lds).
3637
# RUN: echo 'GROUP("%t2.a")' > %t3.lds

0 commit comments

Comments
 (0)