summaryrefslogtreecommitdiff
path: root/test/LTO
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-04-12 18:27:00 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-04-12 18:27:00 +0000
commit1c404b475de4dc75d2146d8542487cc9b5a29ae7 (patch)
tree473100174d1755f819b4dbaf69b6d4da6bf45e59 /test/LTO
parentd9096c73918e25fb7d0ba8cb18b75708b04eff84 (diff)
llvm-lto2: Add a dump-symtab subcommand.
This allows us to test the symbol table APIs for LTO input files. Differential Revision: https://reviews.llvm.org/D31920 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300086 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/LTO')
-rw-r--r--test/LTO/Resolution/X86/symtab.ll47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/LTO/Resolution/X86/symtab.ll b/test/LTO/Resolution/X86/symtab.ll
new file mode 100644
index 00000000000..48eb198fb1c
--- /dev/null
+++ b/test/LTO/Resolution/X86/symtab.ll
@@ -0,0 +1,47 @@
+; RUN: llvm-as -o %t %s
+; RUN: llvm-lto2 dump-symtab %t | FileCheck %s
+
+target triple = "i686-pc-windows-msvc18.0.0"
+target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
+
+; CHECK: source filename: src.c
+source_filename = "src.c"
+
+; CHECK: linker opts (COFF only): /include:foo
+!0 = !{i32 6, !"Linker Options", !{!{!"/include:foo"}}}
+!llvm.module.flags = !{ !0 }
+
+; CHECK: H------ _g1
+@g1 = hidden global i32 0
+
+; CHECK: P------ _g2
+@g2 = protected global i32 0
+
+; CHECK: D------ _g3
+@g3 = global i32 0
+
+; CHECK: DU----- _g4
+@g4 = external global i32
+
+; CHECK: D--W--- _g5
+@g5 = weak global i32 0
+
+; CHECK: D--W-O- _g6
+@g6 = linkonce_odr unnamed_addr global i32 0
+
+; CHECK: D-----T _g7
+@g7 = thread_local global i32 0
+
+; CHECK: D-C---- _g8
+; CHECK-NEXT: size 4 align 8
+@g8 = common global i32 0, align 8
+
+; CHECK: D------ _g9
+; CHECK-NEXT: comdat g9
+$g9 = comdat any
+@g9 = global i32 0, comdat
+
+; CHECK: D--WI-- _g10
+; CHECK-NEXT: comdat g9
+; CHECK-NEXT: fallback _g9
+@g10 = weak alias i32, i32* @g9