summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2017-07-26 01:47:17 +0000
committerDavide Italiano <davide@freebsd.org>2017-07-26 01:47:17 +0000
commit557a0b3a9eb727bdedb2b6ebf0908ae311330092 (patch)
treecb2bfe23a1cb168ebede951a79d64e7c5ff70d01 /llvm/test
parentc2c3d6b87ba929d457ed50ea8e4caae081d13eae (diff)
downloadbcm5719-llvm-557a0b3a9eb727bdedb2b6ebf0908ae311330092.tar.gz
bcm5719-llvm-557a0b3a9eb727bdedb2b6ebf0908ae311330092.zip
[gold] Enable data-sections by default for the gold-plugin.
Follow up to r309056. llvm-svn: 309075
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/tools/gold/X86/Inputs/multiple-data.ll6
-rw-r--r--llvm/test/tools/gold/X86/multiple-data.s28
2 files changed, 34 insertions, 0 deletions
diff --git a/llvm/test/tools/gold/X86/Inputs/multiple-data.ll b/llvm/test/tools/gold/X86/Inputs/multiple-data.ll
new file mode 100644
index 00000000000..57a048dac27
--- /dev/null
+++ b/llvm/test/tools/gold/X86/Inputs/multiple-data.ll
@@ -0,0 +1,6 @@
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+@pat = global i32 33, align 4
+@tin = global i32 33, align 4
+@dipsy = global i32 33, align 4
diff --git a/llvm/test/tools/gold/X86/multiple-data.s b/llvm/test/tools/gold/X86/multiple-data.s
new file mode 100644
index 00000000000..991554b4f0d
--- /dev/null
+++ b/llvm/test/tools/gold/X86/multiple-data.s
@@ -0,0 +1,28 @@
+# RUN: echo ".data.tin" > %t_order_lto.txt
+# RUN: echo ".data.dipsy" >> %t_order_lto.txt
+# RUN: echo ".data.pat" >> %t_order_lto.txt
+
+# RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-unknown-linux-gnu
+# RUN: llvm-as %p/Inputs/multiple-data.ll -o %t2.o
+# RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
+# RUN: -m elf_x86_64 -o %t.exe %t2.o %t.o \
+# RUN: --section-ordering-file=%t_order_lto.txt
+# RUN: llvm-readobj -elf-output-style=GNU -t %t.exe | FileCheck %s
+
+# CHECK: Symbol table '.symtab' contains 9 entries:
+# CHECK-NEXT: Num: Value Size Type Bind Vis Ndx Name
+# CHECK-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+# CHECK-NEXT: 1: 0000000000000000 0 FILE LOCAL DEFAULT ABS ld-temp.o
+# CHECK-NEXT: 2: 0000000000401104 0 NOTYPE GLOBAL DEFAULT ABS _end
+# CHECK-NEXT: 3: 0000000000401104 0 NOTYPE GLOBAL DEFAULT ABS __bss_start
+# CHECK-NEXT: 4: 0000000000401104 0 NOTYPE GLOBAL DEFAULT ABS _edata
+# CHECK-NEXT: 5: 00000000004000e8 0 NOTYPE GLOBAL DEFAULT 1 _start
+# CHECK-NEXT: 6: 00000000004010fc 4 OBJECT GLOBAL DEFAULT 2 dipsy
+# CHECK-NEXT: 7: 00000000004010f8 4 OBJECT GLOBAL DEFAULT 2 tin
+# CHECK-NEXT: 8: 0000000000401100 4 OBJECT GLOBAL DEFAULT 2 pat
+
+.globl _start
+_start:
+ movl $pat, %ecx
+ movl $dipsy, %ebx
+ movl $tin, %eax
OpenPOWER on IntegriCloud