[LTO] Reject modules without datalayout.

Also, udpate the ~60 failing tests in the tree which did
not contain a valid datalayout.
This fixes PR31123. lld will be updated in a following patch,
immediately after this is committed.

Differential Revision:  https://reviews.llvm.org/D27082

llvm-svn: 289719
diff --git a/llvm/test/tools/llvm-lto2/errors.ll b/llvm/test/tools/llvm-lto2/errors.ll
index cd2394d..25c0543 100644
--- a/llvm/test/tools/llvm-lto2/errors.ll
+++ b/llvm/test/tools/llvm-lto2/errors.ll
@@ -8,4 +8,7 @@
 ; ERR2: unused symbol resolution for {{.*}}.bc,bar
 ; ERR3: invalid character q in resolution: {{.*}}.bc,foo
 ; ERR4: invalid resolution: foo
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
 @foo = global i32 0