llvm-lib: Disallow mixing object files with different machine types
lib.exe doesn't allow creating .lib files with object files that have
differing machine types. Update llvm-lib to match.
The motivation is to make it possible to infer the machine type of a
.lib file in lld, so that it can warn when e.g. a 32-bit .lib file is
passed to a 64-bit link (PR38965).
Fixes PR38782.
Differential Revision: https://reviews.llvm.org/D62913
llvm-svn: 362798
diff --git a/llvm/test/tools/llvm-lib/Inputs/arm64.ll b/llvm/test/tools/llvm-lib/Inputs/arm64.ll
new file mode 100644
index 0000000..db08209
--- /dev/null
+++ b/llvm/test/tools/llvm-lib/Inputs/arm64.ll
@@ -0,0 +1,18 @@
+; ModuleID = 'test2.cc'
+source_filename = "test2.cc"
+target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128"
+target triple = "arm64-pc-windows-msvc19.11.0"
+
+; Function Attrs: noinline nounwind optnone uwtable
+define dso_local void @"?f@@YAXXZ"() #0 {
+entry:
+ ret void
+}
+
+attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+neon" "unsafe-fp-math"="false" "use-soft-float"="false" }
+
+!llvm.module.flags = !{!0}
+!llvm.ident = !{!1}
+
+!0 = !{i32 1, !"wchar_size", i32 2}
+!1 = !{!"clang version 9.0.0 "}