summaryrefslogtreecommitdiffstats
path: root/llvm/test/Assembler
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2018-05-26 02:34:13 +0000
committerTeresa Johnson <tejohnson@google.com>2018-05-26 02:34:13 +0000
commit08d5b4ef0d0839761e3b7546efcd3ee0454742ea (patch)
tree1962452dfea56ccff172d7612ec1a8c982de27e2 /llvm/test/Assembler
parentffebfe10c1cfc2eae92ddd0dc1b212595ac47864 (diff)
downloadbcm5719-llvm-08d5b4ef0d0839761e3b7546efcd3ee0454742ea.tar.gz
bcm5719-llvm-08d5b4ef0d0839761e3b7546efcd3ee0454742ea.zip
[ThinLTO] Print module summary index to assembly
Summary: Implements AsmWriter support for printing the module summary index to assembly with the format discussed in the RFC "LLVM Assembly format for ThinLTO Summary". Implements just enough of the parsing support to recognize and ignore the summary entries. As agreed in the RFC thread, this will be the behavior when assembling the IR. A follow on change will implement parsing/assembling of the summary entries for use by tools that currently build the summary index from bitcode. Reviewers: dexonsmith, pcc Subscribers: inglorion, eraman, steven_wu, dblaikie, llvm-commits Differential Revision: https://reviews.llvm.org/D46699 llvm-svn: 333335
Diffstat (limited to 'llvm/test/Assembler')
-rw-r--r--llvm/test/Assembler/thinlto-bad-summary1.ll18
-rw-r--r--llvm/test/Assembler/thinlto-bad-summary2.ll18
-rw-r--r--llvm/test/Assembler/thinlto-bad-summary3.ll19
3 files changed, 55 insertions, 0 deletions
diff --git a/llvm/test/Assembler/thinlto-bad-summary1.ll b/llvm/test/Assembler/thinlto-bad-summary1.ll
new file mode 100644
index 00000000000..394506317d9
--- /dev/null
+++ b/llvm/test/Assembler/thinlto-bad-summary1.ll
@@ -0,0 +1,18 @@
+; Test that we get appropriate error when parsing summary with a missing
+; summary type label.
+; RUN: not llvm-as %s 2>&1 | FileCheck %s
+
+; CHECK: error: expected 'label' at start of summary entry
+
+; ModuleID = 'thinlto-function-summary-callgraph.ll'
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+; Function Attrs: nounwind uwtable
+define i32 @main() #0 {
+entry:
+ ret i32 1
+}
+
+^0 = module: (path: "{{.*}}/test/Assembler/thinlto-bad-summary1.ll", hash: (0, 0, 0, 0, 0))
+^1 = ()
diff --git a/llvm/test/Assembler/thinlto-bad-summary2.ll b/llvm/test/Assembler/thinlto-bad-summary2.ll
new file mode 100644
index 00000000000..b736c101adc
--- /dev/null
+++ b/llvm/test/Assembler/thinlto-bad-summary2.ll
@@ -0,0 +1,18 @@
+; Test that we get appropriate error when parsing summary that doesn't
+; have a '(' after the summary type label.
+; RUN: not llvm-as %s 2>&1 | FileCheck %s
+
+; CHECK: error: expected '(' at start of summary entry
+
+; ModuleID = 'thinlto-function-summary-callgraph.ll'
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+; Function Attrs: nounwind uwtable
+define i32 @main() #0 {
+entry:
+ ret i32 1
+}
+
+^0 = module: (path: "{{.*}}/test/Assembler/thinlto-bad-summary1.ll", hash: (0, 0, 0, 0, 0))
+^1 = gv: )(
diff --git a/llvm/test/Assembler/thinlto-bad-summary3.ll b/llvm/test/Assembler/thinlto-bad-summary3.ll
new file mode 100644
index 00000000000..1855a3d4dd8
--- /dev/null
+++ b/llvm/test/Assembler/thinlto-bad-summary3.ll
@@ -0,0 +1,19 @@
+; Test that we get appropriate error when parsing summary with unbalanced
+; parentheses.
+; RUN: not llvm-as %s 2>&1 | FileCheck %s
+
+; CHECK: error: found end of file while parsing summary entry
+
+; ModuleID = 'thinlto-function-summary-callgraph.ll'
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+; Function Attrs: nounwind uwtable
+define i32 @main() #0 {
+entry:
+ ret i32 1
+}
+
+^0 = module: (path: "{{.*}}/test/Assembler/thinlto-bad-summary1.ll", hash: (0, 0, 0, 0, 0))
+; Missing a ')'
+^1 = gv: (name: "main", summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1)) ; guid = 15822663052811949562
OpenPOWER on IntegriCloud