summaryrefslogtreecommitdiffstats
path: root/lld/test
diff options
context:
space:
mode:
Diffstat (limited to 'lld/test')
-rw-r--r--lld/test/elf/Inputs/globalconst.c2
-rw-r--r--lld/test/elf/Inputs/globalconst.o.x86-64bin0 -> 1072 bytes
-rw-r--r--lld/test/elf/mergeglobalatoms.test10
3 files changed, 12 insertions, 0 deletions
diff --git a/lld/test/elf/Inputs/globalconst.c b/lld/test/elf/Inputs/globalconst.c
new file mode 100644
index 00000000000..08395a88e7c
--- /dev/null
+++ b/lld/test/elf/Inputs/globalconst.c
@@ -0,0 +1,2 @@
+/* compile the code with -fmerge-all-constants */
+const char mystr[] = "foobar";
diff --git a/lld/test/elf/Inputs/globalconst.o.x86-64 b/lld/test/elf/Inputs/globalconst.o.x86-64
new file mode 100644
index 00000000000..d8e266e7633
--- /dev/null
+++ b/lld/test/elf/Inputs/globalconst.o.x86-64
Binary files differ
diff --git a/lld/test/elf/mergeglobalatoms.test b/lld/test/elf/mergeglobalatoms.test
new file mode 100644
index 00000000000..10d70363b4b
--- /dev/null
+++ b/lld/test/elf/mergeglobalatoms.test
@@ -0,0 +1,10 @@
+# ELF files can have mergeable strings which are global!, treat them as global
+# defined atoms
+RUN: lld-core -merge-strings=true -reader ELF %p/Inputs/globalconst.o.x86-64 | FileCheck -check-prefix=globalatoms %s
+
+globalatoms: - name: mystr
+globalatoms: scope: global
+globalatoms: type: constant
+globalatoms: content: [ 66, 6F, 6F, 62, 61, 72, 00 ]
+globalatoms: section-choice: custom-required
+globalatoms: section-name: .rodata.str1.1
OpenPOWER on IntegriCloud