summaryrefslogtreecommitdiff
path: root/test/ELF/linkerscript/memory-err.s
diff options
context:
space:
mode:
Diffstat (limited to 'test/ELF/linkerscript/memory-err.s')
-rw-r--r--test/ELF/linkerscript/memory-err.s16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ELF/linkerscript/memory-err.s b/test/ELF/linkerscript/memory-err.s
new file mode 100644
index 0000000000000..19517687b78d9
--- /dev/null
+++ b/test/ELF/linkerscript/memory-err.s
@@ -0,0 +1,16 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
+# RUN: echo "MEMORY { name : ORIGIN = DATA_SEGMENT_RELRO_END; }" > %t.script
+# RUN: not ld.lld -shared -o %t2 --script %t.script %t 2>&1 | FileCheck %s
+# CHECK: error: {{.*}}.script:1: unable to calculate page size
+
+# RUN: echo "MEMORY { name : ORIGIN = CONSTANT(COMMONPAGESIZE); }" > %t.script
+# RUN: not ld.lld -shared -o %t2 --script %t.script %t 2>&1 |\
+# RUN: FileCheck %s --check-prefix=ERR2
+# ERR2: error: {{.*}}.script:1: unable to calculate page size
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
+# RUN: echo "MEMORY { name : ORIGIN = .; }" > %t.script
+# RUN: not ld.lld -shared -o %t2 --script %t.script %t 2>&1 |\
+# RUN: FileCheck %s --check-prefix=ERR3
+# ERR3: error: {{.*}}.script:1: unable to get location counter value