[llvm-readobj][test] - Cleanup and split tests in tools/llvm-readobj folder.

tools/llvm-readobj currently contains tests that are either general for
all file types or that mix file types inside. This patch refactors
these test and leaves only general tests in that folder. All other
tests were moved to ELF/COFF/MachO and wasm accordingly.

I tried to minimize amount of changes, so most of the test parts
remained unchanged. Any further refactorings and improvements for
particular tests should be done independently from this patch.

Differential revision: https://reviews.llvm.org/D71269
diff --git a/llvm/test/tools/llvm-readobj/basic.test b/llvm/test/tools/llvm-readobj/basic.test
index 3f33ff6..89962c3 100644
--- a/llvm/test/tools/llvm-readobj/basic.test
+++ b/llvm/test/tools/llvm-readobj/basic.test
@@ -1,6 +1,8 @@
-# Test case where input file does not exit.
-RUN: not llvm-readobj %t.blah 2>&1 | FileCheck --check-prefix=ENOENT %s
-ENOENT: '{{.*}}.blah': {{[Nn]}}o such file or directory
+## Test case where input file does not exit.
+RUN: not llvm-readobj %t.blah 2>&1 | FileCheck --check-prefix=ENOENT -DTOOL=readobj %s
+RUN: not llvm-readelf %t.blah 2>&1 | FileCheck --check-prefix=ENOENT -DTOOL=readelf %s
+
+ENOENT: llvm-[[TOOL]]{{(\.exe)?}}: error: '{{.*}}.blah': {{[Nn]}}o such file or directory
 
 # Test case where input file is too small to be a recognised object file.
 RUN: touch %t.empty
@@ -13,14 +15,6 @@
 RUN: llvm-readobj --all %t.a 2>&1 | FileCheck --check-prefix=NO-OUTPUT --allow-empty %s
 NO-OUTPUT-NOT: {{.}}
 
-# Test case where no switches are specified.
-RUN: llvm-readobj %p/ELF/Inputs/trivial.obj.elf-x86-64 | FileCheck --check-prefix=HEADER %s
-RUN: llvm-readelf %p/ELF/Inputs/trivial.obj.elf-x86-64 | FileCheck --check-prefix=NO-OUTPUT --allow-empty %s
-HEADER: File: {{.*}}trivial.obj.elf-x86-64
-HEADER: Format: ELF64-x86-64
-HEADER: Arch: x86_64
-HEADER: AddressSize: 64bit
-
 # Test case where switch it not recognised.
 RUN: not llvm-readobj --unknown-switch 2>&1 | FileCheck --check-prefix=UNKNOWN %s
 UNKNOWN: Unknown command line argument '--unknown-switch'