summaryrefslogtreecommitdiff
path: root/test/elf/X86_64/multi-weak-layout.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/elf/X86_64/multi-weak-layout.test')
-rw-r--r--test/elf/X86_64/multi-weak-layout.test52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/elf/X86_64/multi-weak-layout.test b/test/elf/X86_64/multi-weak-layout.test
new file mode 100644
index 000000000000..4bbf1dfc7e90
--- /dev/null
+++ b/test/elf/X86_64/multi-weak-layout.test
@@ -0,0 +1,52 @@
+# Test that we are able to layout multiple weak symbols
+# properly
+
+RUN: lld -flavor gnu -target x86_64 %p/Inputs/multiweaksyms.o \
+RUN: --noinhibit-exec -static --output-filetype=yaml -o %t
+RUN: FileCheck %s -check-prefix=WEAKSYMS < %t
+
+WEAKSYMS: - type: data
+WEAKSYMS: alignment: 2^3
+WEAKSYMS: references:
+WEAKSYMS: - kind: layout-after
+WEAKSYMS: offset: 0
+WEAKSYMS: target: [[L001:[-a-zA-Z0-9_]+]]
+WEAKSYMS: - name: myfn2
+WEAKSYMS: scope: global
+WEAKSYMS: type: data
+WEAKSYMS: merge: as-weak
+WEAKSYMS: alignment: 2^3
+WEAKSYMS: references:
+WEAKSYMS: - kind: layout-after
+WEAKSYMS: offset: 0
+WEAKSYMS: target: [[L001]]
+WEAKSYMS: - ref-name: [[L001]]
+WEAKSYMS: scope: global
+WEAKSYMS: type: data
+WEAKSYMS: content: [ 00, 00, 00, 00, 00, 00, 00, 00 ]
+WEAKSYMS: alignment: 2^3
+WEAKSYMS: references:
+WEAKSYMS: - kind: R_X86_64_64
+WEAKSYMS: offset: 0
+WEAKSYMS: target: test
+WEAKSYMS: - kind: layout-after
+WEAKSYMS: offset: 0
+WEAKSYMS: target: [[L003:[-a-zA-Z0-9_]+]]
+WEAKSYMS: - name: myfn1
+WEAKSYMS: scope: global
+WEAKSYMS: type: data
+WEAKSYMS: merge: as-weak
+WEAKSYMS: alignment: 2^3
+WEAKSYMS: references:
+WEAKSYMS: - kind: layout-after
+WEAKSYMS: offset: 0
+WEAKSYMS: target: [[L003]]
+WEAKSYMS: - ref-name: [[L003]]
+WEAKSYMS: scope: global
+WEAKSYMS: type: data
+WEAKSYMS: content: [ 00, 00, 00, 00, 00, 00, 00, 00 ]
+WEAKSYMS: alignment: 2^3
+WEAKSYMS: references:
+WEAKSYMS: - kind: R_X86_64_64
+WEAKSYMS: offset: 0
+WEAKSYMS: target: test