Compare DataLayout by Value, not by pointer.
This fixes spurious warnings in llvm-link about the datalayout not matching.
Thanks to Zalman Stern for reporting the bug!
llvm-svn: 202276
diff --git a/llvm/test/Linker/Inputs/datalayout-a.ll b/llvm/test/Linker/Inputs/datalayout-a.ll
new file mode 100644
index 0000000..e78478e
--- /dev/null
+++ b/llvm/test/Linker/Inputs/datalayout-a.ll
@@ -0,0 +1 @@
+target datalayout = "e"
diff --git a/llvm/test/Linker/Inputs/datalayout-b.ll b/llvm/test/Linker/Inputs/datalayout-b.ll
new file mode 100644
index 0000000..59cdb68
--- /dev/null
+++ b/llvm/test/Linker/Inputs/datalayout-b.ll
@@ -0,0 +1 @@
+target datalayout = "E"
diff --git a/llvm/test/Linker/datalayout.ll b/llvm/test/Linker/datalayout.ll
new file mode 100644
index 0000000..3ee96eb
--- /dev/null
+++ b/llvm/test/Linker/datalayout.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-link %s %S/Inputs/datalayout-a.ll -S -o - 2>%t.a.err | FileCheck %s
+; RUN: cat %t.a.err | not FileCheck %s 2>&1 | FileCheck --check-prefix=WARN-A %s
+
+; RUN: llvm-link %s %S/Inputs/datalayout-b.ll -S -o - 2>%t.b.err | FileCheck %s
+; RUN: cat %t.b.err | FileCheck --check-prefix=WARN-B %s
+
+target datalayout = "e"
+
+; CHECK: target datalayout = "e"
+
+; this is a hack to check that llvm-link printed no warnings.
+; WARN-A: FileCheck error: '-' is empty.
+
+; WARN-B: WARNING: Linking two modules of different data layouts!