[llvm-dlltool] [test] Add a testcase for all machine option types. NFC.
authorMartin Storsjö <martin@martin.st>
Mon, 14 Jun 2021 10:28:33 +0000 (13:28 +0300)
committerMartin Storsjö <martin@martin.st>
Thu, 17 Jun 2021 10:02:35 +0000 (13:02 +0300)
The existing tests only test that some options (but not e.g. arm)
are accepted, but it doesn't test their functional effect of
affecting the generated object files.

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

llvm/test/tools/llvm-dlltool/machine-opt.def [new file with mode: 0644]

diff --git a/llvm/test/tools/llvm-dlltool/machine-opt.def b/llvm/test/tools/llvm-dlltool/machine-opt.def
new file mode 100644 (file)
index 0000000..6dce825
--- /dev/null
@@ -0,0 +1,17 @@
+; RUN: llvm-dlltool -m i386 -d %s -l %t.a
+; RUN: llvm-readobj %t.a | FileCheck --check-prefix=I386 %s
+; RUN: llvm-dlltool -m i386:x86-64 -d %s -l %t.a
+; RUN: llvm-readobj %t.a | FileCheck --check-prefix=X86_64 %s
+; RUN: llvm-dlltool -m arm -d %s -l %t.a
+; RUN: llvm-readobj %t.a | FileCheck --check-prefix=ARM %s
+; RUN: llvm-dlltool -m arm64 -d %s -l %t.a
+; RUN: llvm-readobj %t.a | FileCheck --check-prefix=ARM64 %s
+
+LIBRARY test.dll
+EXPORTS
+TestFunction
+
+; I386: Format: COFF-i386
+; X86_64: Format: COFF-x86-64
+; ARM: Format: COFF-ARM{{$}}
+; ARM64: Format: COFF-ARM64