summaryrefslogtreecommitdiff
path: root/test/ELF/linkerscript/numbers.s
diff options
context:
space:
mode:
Diffstat (limited to 'test/ELF/linkerscript/numbers.s')
-rw-r--r--test/ELF/linkerscript/numbers.s26
1 files changed, 17 insertions, 9 deletions
diff --git a/test/ELF/linkerscript/numbers.s b/test/ELF/linkerscript/numbers.s
index 653f94bd4e6e..d4fd13fd8197 100644
--- a/test/ELF/linkerscript/numbers.s
+++ b/test/ELF/linkerscript/numbers.s
@@ -28,27 +28,35 @@
# 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
+## Make sure that numbers can be followed by a ":" with and without a space,
+## e.g. "0x100 :" or "0x100:"
+# RUN: echo "SECTIONS { \
+# RUN: .hex1 0x400 : { *(.hex.1) } \
+# RUN: .hex2 0x500:{ *(.hex.2) } \
+# RUN: }" > %t5.script
+# RUN: ld.lld %t --script %t5.script -o %t6
+# RUN: llvm-objdump -section-headers %t6 | FileCheck -check-prefix=SECADDR %s
+# SECADDR: Sections:
+# SECADDR-NEXT: Idx Name Size Address
+# SECADDR-NEXT: 0 00000000 0000000000000000
+# SECADDR-NEXT: 1 .hex1 00000008 0000000000000400
+# SECADDR-NEXT: 2 .hex2 00000008 0000000000000500
+
.globl _start
_start:
nop