aboutsummaryrefslogtreecommitdiffstats
path: root/test/ELF/linkerscript/common-assign.s
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-29 20:59:10 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-29 20:59:10 +0000
commitb025d011dd270230aeb50d7174a2a05616fe81eb (patch)
tree71544f8945a1266763fc1dfac6ac6b17433cfb39 /test/ELF/linkerscript/common-assign.s
parentabe21bdf8e3c7be93c9236c3eec47756e14582bb (diff)
downloadsrc-b025d011dd270230aeb50d7174a2a05616fe81eb.tar.gz
src-b025d011dd270230aeb50d7174a2a05616fe81eb.zip
Vendor import of lld release_40 branch r293443:vendor/lld/lld-release_40-r293443
Notes
Notes: svn path=/vendor/lld/dist/; revision=312964 svn path=/vendor/lld/lld-release_40-r293443/; revision=312965; tag=vendor/lld/lld-release_40-r293443
Diffstat (limited to 'test/ELF/linkerscript/common-assign.s')
-rw-r--r--test/ELF/linkerscript/common-assign.s48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/ELF/linkerscript/common-assign.s b/test/ELF/linkerscript/common-assign.s
new file mode 100644
index 000000000000..4244ae321110
--- /dev/null
+++ b/test/ELF/linkerscript/common-assign.s
@@ -0,0 +1,48 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
+# RUN: echo "SECTIONS { . = SIZEOF_HEADERS; pfoo = foo; pbar = bar; }" > %t.script
+# RUN: ld.lld -o %t1 --script %t.script %t
+# RUN: llvm-readobj -symbols %t1 | FileCheck %s
+
+# CHECK: Symbol {
+# CHECK: Name: bar
+# CHECK-NEXT: Value: 0x134
+# CHECK-NEXT: Size: 4
+# CHECK-NEXT: Binding: Global
+# CHECK-NEXT: Type: Object
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: .bss
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: foo
+# CHECK-NEXT: Value: 0x138
+# CHECK-NEXT: Size: 4
+# CHECK-NEXT: Binding: Global
+# CHECK-NEXT: Type: Object
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: .bss
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: pfoo
+# CHECK-NEXT: Value: 0x138
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Global
+# CHECK-NEXT: Type: None
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: .bss
+# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Name: pbar
+# CHECK-NEXT: Value: 0x134
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Global
+# CHECK-NEXT: Type: None
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: .bss
+# CHECK-NEXT: }
+# CHECK-NEXT: ]
+
+.comm foo,4,4
+.comm bar,4,4
+movl $1, foo(%rip)
+movl $2, bar(%rip)