summaryrefslogtreecommitdiffstats
path: root/llvm/test/Linker
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2018-10-09 01:17:27 +0000
committerDavid Blaikie <dblaikie@gmail.com>2018-10-09 01:17:27 +0000
commit40a64c4c08d3c1f4c2cdca657d691c97bf09e580 (patch)
treef27c9680b4123eb74e10ea803e085857d34c2ddf /llvm/test/Linker
parent63a8b6c3046d2aaa83f1410c32771e7eb21e7a6c (diff)
downloadbcm5719-llvm-40a64c4c08d3c1f4c2cdca657d691c97bf09e580.tar.gz
bcm5719-llvm-40a64c4c08d3c1f4c2cdca657d691c97bf09e580.zip
llvm-link: Improve diagnostic for module-level metadata mismatch
This might produce hard to read/illegible diagnostics for especially weird/non-trivial module metadata but integers are about all we are using these days, so seems more useful than not. Patch based on work by Kristina Brooks - thanks! Differential Revision: https://reviews.llvm.org/D52952 llvm-svn: 344011
Diffstat (limited to 'llvm/test/Linker')
-rw-r--r--llvm/test/Linker/Inputs/metadata-mismatch-a.ll3
-rw-r--r--llvm/test/Linker/Inputs/metadata-mismatch-b.ll2
-rw-r--r--llvm/test/Linker/metadata-mismatch.test3
3 files changed, 8 insertions, 0 deletions
diff --git a/llvm/test/Linker/Inputs/metadata-mismatch-a.ll b/llvm/test/Linker/Inputs/metadata-mismatch-a.ll
new file mode 100644
index 00000000000..742ae5ca3ef
--- /dev/null
+++ b/llvm/test/Linker/Inputs/metadata-mismatch-a.ll
@@ -0,0 +1,3 @@
+
+!llvm.module.flags = !{!1}
+!1 = !{i32 2, !"Dwarf Version", i32 4}
diff --git a/llvm/test/Linker/Inputs/metadata-mismatch-b.ll b/llvm/test/Linker/Inputs/metadata-mismatch-b.ll
new file mode 100644
index 00000000000..198c479c981
--- /dev/null
+++ b/llvm/test/Linker/Inputs/metadata-mismatch-b.ll
@@ -0,0 +1,2 @@
+!llvm.module.flags = !{!1}
+!1 = !{i32 2, !"Dwarf Version", i32 5}
diff --git a/llvm/test/Linker/metadata-mismatch.test b/llvm/test/Linker/metadata-mismatch.test
new file mode 100644
index 00000000000..9767f8d2e4c
--- /dev/null
+++ b/llvm/test/Linker/metadata-mismatch.test
@@ -0,0 +1,3 @@
+; RUN: llvm-link %p/Inputs/metadata-mismatch-a.ll %p/Inputs/metadata-mismatch-b.ll -S 2>&1 | FileCheck %s
+
+; CHECK: warning: linking module flags 'Dwarf Version': IDs have conflicting values ('i32 5' from {{.*}}/metadata-mismatch-b.ll with 'i32 4' from llvm-link)
OpenPOWER on IntegriCloud