[lld] 2f4cfa3 - [lld-macho] Avoid explicit -arch in tests by defaulting to x86-64

Jez Ng via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 17 20:41:50 PDT 2020


Author: Jez Ng
Date: 2020-06-17T20:41:27-07:00
New Revision: 2f4cfa3c7adda3f77d1773c80940cb4118c75c1e

URL: https://github.com/llvm/llvm-project/commit/2f4cfa3c7adda3f77d1773c80940cb4118c75c1e
DIFF: https://github.com/llvm/llvm-project/commit/2f4cfa3c7adda3f77d1773c80940cb4118c75c1e.diff

LOG: [lld-macho] Avoid explicit -arch in tests by defaulting to x86-64

Summary:
As mentioned in https://reviews.llvm.org/D81326#2093931, I'm not sure it
makes sense to use the default target triple to determine -arch.
Long-term we should probably detect it from the input object files, but
in the meantime it would be nice not to have to add it to all our tests
by using a convenient default.

Reviewers: #lld-macho

Subscribers: arphaman, llvm-commits

Tags: #llvm

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

Added: 
    

Modified: 
    lld/MachO/Driver.cpp
    lld/test/MachO/arch.s
    lld/test/MachO/archive.s
    lld/test/MachO/dylib.s
    lld/test/MachO/dylink-lazy.s
    lld/test/MachO/dylink.s
    lld/test/MachO/entry-symbol.s
    lld/test/MachO/export-trie.s
    lld/test/MachO/fat-arch.s
    lld/test/MachO/invalid/alignment-too-large.yaml
    lld/test/MachO/invalid/archive-no-index.s
    lld/test/MachO/invalid/bad-archive.s
    lld/test/MachO/invalid/duplicate-symbol.s
    lld/test/MachO/invalid/invalid-executable.s
    lld/test/MachO/invalid/invalid-fat-narch.s
    lld/test/MachO/invalid/invalid-fat-offset.s
    lld/test/MachO/invalid/invalid-relocation-length.yaml
    lld/test/MachO/invalid/invalid-relocation-pcrel.yaml
    lld/test/MachO/invalid/missing-dylib.s
    lld/test/MachO/invalid/no-id-dylink.yaml
    lld/test/MachO/invalid/no-such-file.s
    lld/test/MachO/invalid/order-file-bad-arch.test
    lld/test/MachO/invalid/order-file-bad-objfile.test
    lld/test/MachO/invalid/stub-link.s
    lld/test/MachO/invalid/undefined-symbol.s
    lld/test/MachO/link-search-order.s
    lld/test/MachO/load-commands.s
    lld/test/MachO/no-exports-dylib.s
    lld/test/MachO/order-file.s
    lld/test/MachO/platform-version.test
    lld/test/MachO/relocations.s
    lld/test/MachO/resolution.s
    lld/test/MachO/search-paths.test
    lld/test/MachO/section-headers.s
    lld/test/MachO/section-merge.s
    lld/test/MachO/segments.s
    lld/test/MachO/silent-ignore.test
    lld/test/MachO/static-link.s
    lld/test/MachO/stub-link.s
    lld/test/MachO/sub-library.s
    lld/test/MachO/subsections-section-relocs.s
    lld/test/MachO/subsections-symbol-relocs.s
    lld/test/MachO/symbol-order.s
    lld/test/MachO/symtab.s
    lld/test/MachO/x86-64-reloc-signed.s
    lld/test/MachO/x86-64-reloc-unsigned.s

Removed: 
    


################################################################################
diff  --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp
index adef35be717d..84e31be1bd68 100644
--- a/lld/MachO/Driver.cpp
+++ b/lld/MachO/Driver.cpp
@@ -27,7 +27,6 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/BinaryFormat/MachO.h"
 #include "llvm/BinaryFormat/Magic.h"
-#include "llvm/Config/config.h"
 #include "llvm/Object/Archive.h"
 #include "llvm/Option/ArgList.h"
 #include "llvm/Option/Option.h"
@@ -99,7 +98,7 @@ static Optional<std::string> findLibrary(StringRef name) {
 }
 
 static TargetInfo *createTargetInfo(opt::InputArgList &args) {
-  StringRef arch = llvm::Triple(LLVM_DEFAULT_TARGET_TRIPLE).getArchName();
+  StringRef arch = args.getLastArgValue(OPT_arch, "x86_64");
   config->arch = llvm::MachO::getArchitectureFromName(
       args.getLastArgValue(OPT_arch, arch));
   switch (config->arch) {
@@ -107,7 +106,7 @@ static TargetInfo *createTargetInfo(opt::InputArgList &args) {
   case llvm::MachO::AK_x86_64h:
     return createX86_64TargetInfo();
   default:
-    fatal("missing or unsupported -arch " + args.getLastArgValue(OPT_arch));
+    fatal("missing or unsupported -arch " + arch);
   }
 }
 

diff  --git a/lld/test/MachO/arch.s b/lld/test/MachO/arch.s
index e119eb910d94..a0a1962f6402 100644
--- a/lld/test/MachO/arch.s
+++ b/lld/test/MachO/arch.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-darwin %s -o %t.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o /dev/null %t.o
+# RUN: lld -flavor darwinnew -o /dev/null %t.o
 # RUN: not lld -flavor darwinnew -arch i386 -o /dev/null %t.o 2>&1 | FileCheck %s
 # CHECK: error: missing or unsupported -arch i386
 

diff  --git a/lld/test/MachO/archive.s b/lld/test/MachO/archive.s
index 0d80bdbe8b5a..370980768faa 100644
--- a/lld/test/MachO/archive.s
+++ b/lld/test/MachO/archive.s
@@ -7,7 +7,7 @@
 
 # RUN: rm -f %t/test.a
 # RUN: llvm-ar rcs %t/test.a %t/2.o %t/3.o %t/4.o
-# RUN: lld -flavor darwinnew -arch x86_64 %t/main.o %t/test.a -o %t/test.out
+# RUN: lld -flavor darwinnew %t/main.o %t/test.a -o %t/test.out
 
 ## TODO: Run llvm-nm -p to validate symbol order
 # RUN: llvm-nm %t/test.out | FileCheck %s
@@ -16,7 +16,7 @@
 # CHECK: T _main
 
 ## Linking with the archive first in the command line shouldn't change anything
-# RUN: lld -flavor darwinnew -arch x86_64 %t/test.a %t/main.o -o %t/test.out
+# RUN: lld -flavor darwinnew %t/test.a %t/main.o -o %t/test.out
 # RUN: llvm-nm %t/test.out | FileCheck %s --check-prefix ARCHIVE-FIRST
 # ARCHIVE-FIRST: T _bar
 # ARCHIVE-FIRST: T _boo

diff  --git a/lld/test/MachO/dylib.s b/lld/test/MachO/dylib.s
index 72483e579e6d..507a7de87423 100644
--- a/lld/test/MachO/dylib.s
+++ b/lld/test/MachO/dylib.s
@@ -1,7 +1,7 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
 
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib -install_name @executable_path/libfoo.dylib \
+# RUN: lld -flavor darwinnew -dylib -install_name @executable_path/libfoo.dylib \
 # RUN:   %t.o -o %t.dylib
 # RUN: llvm-objdump --macho --dylib-id %t.dylib | FileCheck %s
 # CHECK: @executable_path/libfoo.dylib
@@ -10,7 +10,7 @@
 ## a flag for a missing entry symbol (since dylibs don't have entry symbols).
 ## Also check that we come up with the right install name if one isn't
 ## specified.
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib %t.o -o %t.defaultInstallName.dylib -e missing_entry
+# RUN: lld -flavor darwinnew -dylib %t.o -o %t.defaultInstallName.dylib -e missing_entry
 # RUN: obj2yaml %t.defaultInstallName.dylib | FileCheck %s -DOUTPUT=%t.defaultInstallName.dylib --check-prefix=DEFAULT-INSTALL-NAME
 # DEFAULT-INSTALL-NAME: [[OUTPUT]]
 

diff  --git a/lld/test/MachO/dylink-lazy.s b/lld/test/MachO/dylink-lazy.s
index 9b8e9ddedfa2..16051b45bd92 100644
--- a/lld/test/MachO/dylink-lazy.s
+++ b/lld/test/MachO/dylink-lazy.s
@@ -4,15 +4,15 @@
 # RUN:   -o %t/libhello.o
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %p/Inputs/libgoodbye.s \
 # RUN:   -o %t/libgoodbye.o
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib -L%S/Inputs/MacOSX.sdk/usr/lib \
+# RUN: lld -flavor darwinnew -dylib -L%S/Inputs/MacOSX.sdk/usr/lib \
 # RUN:   -install_name @executable_path/libhello.dylib %t/libhello.o \
 # RUN:   -o %t/libhello.dylib
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib -L%S/Inputs/MacOSX.sdk/usr/lib \
+# RUN: lld -flavor darwinnew -dylib -L%S/Inputs/MacOSX.sdk/usr/lib \
 # RUN:   -install_name @executable_path/libgoodbye.dylib %t/libgoodbye.o \
 # RUN:   -o %t/libgoodbye.dylib
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/dylink-lazy.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/dylink-lazy \
+# RUN: lld -flavor darwinnew -o %t/dylink-lazy \
 # RUN:   -L%S/Inputs/MacOSX.sdk/usr/lib -L%t -lhello -lgoodbye %t/dylink-lazy.o -lSystem
 
 ## When looking at the __stubs section alone, we are unable to easily tell which

diff  --git a/lld/test/MachO/dylink.s b/lld/test/MachO/dylink.s
index 82a3fb2a3947..e47d9ef8f271 100644
--- a/lld/test/MachO/dylink.s
+++ b/lld/test/MachO/dylink.s
@@ -4,9 +4,9 @@
 # RUN:   -o %t/libhello.o
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %p/Inputs/libgoodbye.s \
 # RUN:   -o %t/libgoodbye.o
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib -install_name \
+# RUN: lld -flavor darwinnew -dylib -install_name \
 # RUN:   @executable_path/libhello.dylib %t/libhello.o -o %t/libhello.dylib
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib -install_name \
+# RUN: lld -flavor darwinnew -dylib -install_name \
 # RUN:   @executable_path/libgoodbye.dylib %t/libgoodbye.o -o %t/libgoodbye.dylib
 
 ## Make sure we are using the export trie and not the symbol table when linking
@@ -18,7 +18,7 @@
 # NOSYM: no symbols
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/dylink.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/dylink -Z -L%t -lhello -lgoodbye %t/dylink.o
+# RUN: lld -flavor darwinnew -o %t/dylink -Z -L%t -lhello -lgoodbye %t/dylink.o
 # RUN: llvm-objdump --bind -d %t/dylink | FileCheck %s
 
 # CHECK: movq [[#%u, HELLO_OFF:]](%rip), %rsi

diff  --git a/lld/test/MachO/entry-symbol.s b/lld/test/MachO/entry-symbol.s
index 2182aa157c7d..159c7c5af042 100644
--- a/lld/test/MachO/entry-symbol.s
+++ b/lld/test/MachO/entry-symbol.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t %t.o -e _not_main
+# RUN: lld -flavor darwinnew -o %t %t.o -e _not_main
 # RUN: llvm-objdump --macho --all-headers --syms %t | FileCheck %s
 # CHECK-LABEL: SYMBOL TABLE
 # CHECK-NEXT: {{0*}}[[#%x, ENTRY_ADDR:]] {{.*}} __TEXT,__text _not_main
@@ -16,9 +16,9 @@
 # CHECK-NEXT: offset [[#ENTRYOFF]]
 
 
-# RUN: not lld -flavor darwinnew -arch x86_64 -o /dev/null %t.o -e _missing 2>&1 | FileCheck %s --check-prefix=UNDEFINED
+# RUN: not lld -flavor darwinnew -o /dev/null %t.o -e _missing 2>&1 | FileCheck %s --check-prefix=UNDEFINED
 # UNDEFINED: error: undefined symbol: _missing
-# RUN: not lld -flavor darwinnew -arch x86_64 -o /dev/null %t.o 2>&1 | FileCheck %s --check-prefix=DEFAULT-ENTRY
+# RUN: not lld -flavor darwinnew -o /dev/null %t.o 2>&1 | FileCheck %s --check-prefix=DEFAULT-ENTRY
 # DEFAULT-ENTRY: error: undefined symbol: _main
 
 .text

diff  --git a/lld/test/MachO/export-trie.s b/lld/test/MachO/export-trie.s
index ae62ff96928c..fc1f6d110dba 100644
--- a/lld/test/MachO/export-trie.s
+++ b/lld/test/MachO/export-trie.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib %t.o -o %t.dylib
+# RUN: lld -flavor darwinnew -dylib %t.o -o %t.dylib
 
 # RUN: llvm-objdump --syms --exports-trie %t.dylib | \
 # RUN:   FileCheck %s --check-prefix=EXPORTS

diff  --git a/lld/test/MachO/fat-arch.s b/lld/test/MachO/fat-arch.s
index 7cdd800728ea..cb5a74b09178 100644
--- a/lld/test/MachO/fat-arch.s
+++ b/lld/test/MachO/fat-arch.s
@@ -2,10 +2,10 @@
 # RUN: llvm-mc -filetype=obj -triple=i386-apple-darwin %s -o %t.i386.o
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.x86_64.o
 # RUN: llvm-lipo %t.i386.o %t.x86_64.o -create -o %t.fat.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o /dev/null %t.fat.o
+# RUN: lld -flavor darwinnew -o /dev/null %t.fat.o
 
 # RUN: llvm-lipo %t.i386.o -create -o %t.noarch.o
-# RUN: not lld -flavor darwinnew -arch x86_64 -o /dev/null %t.noarch.o 2>&1 | \
+# RUN: not lld -flavor darwinnew -o /dev/null %t.noarch.o 2>&1 | \
 # RUN:    FileCheck %s -DFILE=%t.noarch.o
 # CHECK: error: unable to find matching architecture in [[FILE]]
 

diff  --git a/lld/test/MachO/invalid/alignment-too-large.yaml b/lld/test/MachO/invalid/alignment-too-large.yaml
index 41ef85d56238..79950524bcf8 100644
--- a/lld/test/MachO/invalid/alignment-too-large.yaml
+++ b/lld/test/MachO/invalid/alignment-too-large.yaml
@@ -1,5 +1,5 @@
 # RUN: yaml2obj %s -o %t.o
-# RUN: not lld -flavor darwinnew -arch x86_64 -o %t %t.o 2>&1 | FileCheck %s
+# RUN: not lld -flavor darwinnew -o %t %t.o 2>&1 | FileCheck %s
 #
 # CHECK: error: alignment 32 of section __text is too large
 --- !mach-o

diff  --git a/lld/test/MachO/invalid/archive-no-index.s b/lld/test/MachO/invalid/archive-no-index.s
index 17314f49c31b..0f2f023e83c1 100644
--- a/lld/test/MachO/invalid/archive-no-index.s
+++ b/lld/test/MachO/invalid/archive-no-index.s
@@ -8,7 +8,7 @@
 # RUN: rm -f %t/test.a
 # RUN: llvm-ar rcS %t/test.a %t/2.o %t/3.o %t/4.o
 
-# RUN: not lld -flavor darwinnew -arch x86_64 %t/test.o %t/test.a -o /dev/null 2>&1 | FileCheck %s
+# RUN: not lld -flavor darwinnew %t/test.o %t/test.a -o /dev/null 2>&1 | FileCheck %s
 # CHECK: error: {{.*}}.a: archive has no index; run ranlib to add one
 
 .global _main

diff  --git a/lld/test/MachO/invalid/bad-archive.s b/lld/test/MachO/invalid/bad-archive.s
index 4e48c8573c05..9429dc3ec311 100644
--- a/lld/test/MachO/invalid/bad-archive.s
+++ b/lld/test/MachO/invalid/bad-archive.s
@@ -3,7 +3,7 @@
 # RUN: echo "foo" >> %t.a
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
 
-# RUN: not lld -flavor darwinnew -arch x86_64 %t.o %t.a -o /dev/null 2>&1 | FileCheck -DFILE=%t.a %s
+# RUN: not lld -flavor darwinnew %t.o %t.a -o /dev/null 2>&1 | FileCheck -DFILE=%t.a %s
 # CHECK: error: [[FILE]]: failed to parse archive: truncated or malformed archive (remaining size of archive too small for next archive member header at offset 8)
 
 .global _main

diff  --git a/lld/test/MachO/invalid/duplicate-symbol.s b/lld/test/MachO/invalid/duplicate-symbol.s
index ee5f8918ee89..d08f34fc0de0 100644
--- a/lld/test/MachO/invalid/duplicate-symbol.s
+++ b/lld/test/MachO/invalid/duplicate-symbol.s
@@ -1,7 +1,7 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t-dup.o
-# RUN: not lld -flavor darwinnew -arch x86_64 -o /dev/null %t-dup.o %t.o 2>&1 | FileCheck %s
+# RUN: not lld -flavor darwinnew -o /dev/null %t-dup.o %t.o 2>&1 | FileCheck %s
 
 # CHECK: error: duplicate symbol: _main
 

diff  --git a/lld/test/MachO/invalid/invalid-executable.s b/lld/test/MachO/invalid/invalid-executable.s
index 7e2d0e526eff..d8d7accf49c6 100644
--- a/lld/test/MachO/invalid/invalid-executable.s
+++ b/lld/test/MachO/invalid/invalid-executable.s
@@ -1,7 +1,7 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-darwin %s -o %t.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t %t.o
-# RUN: not lld -flavor darwinnew -arch x86_64 -o /dev/null %t 2>&1 | FileCheck %s -DFILE=%t
+# RUN: lld -flavor darwinnew -o %t %t.o
+# RUN: not lld -flavor darwinnew -o /dev/null %t 2>&1 | FileCheck %s -DFILE=%t
 # CHECK: error: [[FILE]]: unhandled file type
 
 .text

diff  --git a/lld/test/MachO/invalid/invalid-fat-narch.s b/lld/test/MachO/invalid/invalid-fat-narch.s
index 265b7b8fa41c..2b74893bff49 100644
--- a/lld/test/MachO/invalid/invalid-fat-narch.s
+++ b/lld/test/MachO/invalid/invalid-fat-narch.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: yaml2obj %s -o %t.o
-# RUN: not lld -flavor darwinnew -arch x86_64 -o /dev/null %t.o 2>&1 | \
+# RUN: not lld -flavor darwinnew -o /dev/null %t.o 2>&1 | \
 # RUN:    FileCheck %s -DFILE=%t.o
 # CHECK: error: [[FILE]]: fat_arch struct extends beyond end of file
 

diff  --git a/lld/test/MachO/invalid/invalid-fat-offset.s b/lld/test/MachO/invalid/invalid-fat-offset.s
index fc662e3f56c7..fed979073525 100644
--- a/lld/test/MachO/invalid/invalid-fat-offset.s
+++ b/lld/test/MachO/invalid/invalid-fat-offset.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: yaml2obj %s -o %t.o
-# RUN: not lld -flavor darwinnew -arch x86_64 -o /dev/null %t.o 2>&1 | \
+# RUN: not lld -flavor darwinnew -o /dev/null %t.o 2>&1 | \
 # RUN:    FileCheck %s -DFILE=%t.o
 # CHECK: error: [[FILE]]: slice extends beyond end of file
 

diff  --git a/lld/test/MachO/invalid/invalid-relocation-length.yaml b/lld/test/MachO/invalid/invalid-relocation-length.yaml
index 74ff1485adb9..e256c4fb7a8a 100644
--- a/lld/test/MachO/invalid/invalid-relocation-length.yaml
+++ b/lld/test/MachO/invalid/invalid-relocation-length.yaml
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: yaml2obj %s -o %t.o
-# RUN: not lld -flavor darwinnew -arch x86_64 -o %t %t.o 2>&1 | FileCheck %s -DFILE=%t.o
+# RUN: not lld -flavor darwinnew -o %t %t.o 2>&1 | FileCheck %s -DFILE=%t.o
 #
 # CHECK: error: invalid relocation at offset 1 of __TEXT,__text in [[FILE]]: relocations of type 0 must have r_length of 2 or 3
 

diff  --git a/lld/test/MachO/invalid/invalid-relocation-pcrel.yaml b/lld/test/MachO/invalid/invalid-relocation-pcrel.yaml
index a6771bd53f9f..ed7c24ead74e 100644
--- a/lld/test/MachO/invalid/invalid-relocation-pcrel.yaml
+++ b/lld/test/MachO/invalid/invalid-relocation-pcrel.yaml
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: yaml2obj %s -o %t.o
-# RUN: not lld -flavor darwinnew -arch x86_64 -o %t %t.o 2>&1 | FileCheck %s -DFILE=%t.o
+# RUN: not lld -flavor darwinnew -o %t %t.o 2>&1 | FileCheck %s -DFILE=%t.o
 #
 # CHECK: error: invalid relocation at offset 1 of __TEXT,__text in [[FILE]]: relocations of type 0 must not be pcrel
 

diff  --git a/lld/test/MachO/invalid/missing-dylib.s b/lld/test/MachO/invalid/missing-dylib.s
index 5f39cf0e199d..ad7e51130c40 100644
--- a/lld/test/MachO/invalid/missing-dylib.s
+++ b/lld/test/MachO/invalid/missing-dylib.s
@@ -1,5 +1,5 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
-# RUN: not lld -flavor darwinnew -arch x86_64 -Z -o %t -lmissing %t.o 2>&1 | FileCheck %s
+# RUN: not lld -flavor darwinnew -Z -o %t -lmissing %t.o 2>&1 | FileCheck %s
 
 # CHECK: error: library not found for -lmissing

diff  --git a/lld/test/MachO/invalid/no-id-dylink.yaml b/lld/test/MachO/invalid/no-id-dylink.yaml
index d8416753a3fb..d5b0b33dcfeb 100644
--- a/lld/test/MachO/invalid/no-id-dylink.yaml
+++ b/lld/test/MachO/invalid/no-id-dylink.yaml
@@ -2,7 +2,7 @@
 # RUN: mkdir -p %t
 # RUN: yaml2obj %s -o %t/libnoid.dylib
 # RUN: echo ".globl _main; .text; _main: ret" | llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t/no-id-dylink.o
-# RUN: not lld -flavor darwinnew -arch x86_64 -o %t/no-id-dylink -Z -L%t -lnoid %t/no-id-dylink.o 2>&1 | FileCheck %s
+# RUN: not lld -flavor darwinnew -o %t/no-id-dylink -Z -L%t -lnoid %t/no-id-dylink.o 2>&1 | FileCheck %s
 # CHECK: error: dylib {{.*}}libnoid.dylib missing LC_ID_DYLIB load command
 
 ## This YAML file was originally generated from linking the following source

diff  --git a/lld/test/MachO/invalid/no-such-file.s b/lld/test/MachO/invalid/no-such-file.s
index 3aaf36398796..0122c6105fba 100644
--- a/lld/test/MachO/invalid/no-such-file.s
+++ b/lld/test/MachO/invalid/no-such-file.s
@@ -1,4 +1,4 @@
 # REQUIRES: x86
-# RUN: not lld -flavor darwinnew -arch x86_64 -o /dev/null %t-no-such-file.o 2>&1 | FileCheck %s
+# RUN: not lld -flavor darwinnew -o /dev/null %t-no-such-file.o 2>&1 | FileCheck %s
 
 # CHECK: error: cannot open {{.*}}no-such-file.o

diff  --git a/lld/test/MachO/invalid/order-file-bad-arch.test b/lld/test/MachO/invalid/order-file-bad-arch.test
index f3a7183b4b9f..84fe6963d244 100644
--- a/lld/test/MachO/invalid/order-file-bad-arch.test
+++ b/lld/test/MachO/invalid/order-file-bad-arch.test
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: echo ".globl _main; .text; _main: ret" | llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t.o
-# RUN: not lld -flavor darwinnew -arch x86_64 -o %t %t.o -order_file %s 2>&1 | FileCheck %s
+# RUN: not lld -flavor darwinnew -o %t %t.o -order_file %s 2>&1 | FileCheck %s
 # CHECK: error: invalid arch "sparc" in order file:  expected one of arm, arm64, i386, x86_64, ppc, ppc64
 # CHECK-EMPTY:
 

diff  --git a/lld/test/MachO/invalid/order-file-bad-objfile.test b/lld/test/MachO/invalid/order-file-bad-objfile.test
index 630073011692..19e9404da42d 100644
--- a/lld/test/MachO/invalid/order-file-bad-objfile.test
+++ b/lld/test/MachO/invalid/order-file-bad-objfile.test
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: echo ".globl _main; .text; _main: ret" | llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t.o
-# RUN: not lld -flavor darwinnew -arch x86_64 -o %t %t.o -order_file %s 2>&1 | FileCheck %s
+# RUN: not lld -flavor darwinnew -o %t %t.o -order_file %s 2>&1 | FileCheck %s
 # CHECK: invalid object file name "helloo" in order file: should end with .o
 # CHECK: invalid object file name "z80" in order file: should end with .o
 # CHECK-EMPTY:

diff  --git a/lld/test/MachO/invalid/stub-link.s b/lld/test/MachO/invalid/stub-link.s
index 7f881036d992..f1c159037024 100644
--- a/lld/test/MachO/invalid/stub-link.s
+++ b/lld/test/MachO/invalid/stub-link.s
@@ -3,7 +3,7 @@
 # RUN: mkdir -p %t
 #
 # RUN: llvm-mc -filetype obj -triple x86_64-apple-ios %s -o %t/test.o
-# RUN: not lld -flavor darwinnew -arch x86_64 -o %t/test -Z -L%S/../Inputs/iPhoneSimulator.sdk/usr/lib -lSystem %t/test.o 2>&1 | FileCheck %s
+# RUN: not lld -flavor darwinnew -o %t/test -Z -L%S/../Inputs/iPhoneSimulator.sdk/usr/lib -lSystem %t/test.o 2>&1 | FileCheck %s
 
 # CHECK: error: undefined symbol __cache_handle_memory_pressure_event
 

diff  --git a/lld/test/MachO/invalid/undefined-symbol.s b/lld/test/MachO/invalid/undefined-symbol.s
index e266cd8854e0..88eabfd1ce02 100644
--- a/lld/test/MachO/invalid/undefined-symbol.s
+++ b/lld/test/MachO/invalid/undefined-symbol.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
-# RUN: not lld -flavor darwinnew -arch x86_64 -Z -o %t %t.o 2>&1 | FileCheck %s -DBASENAME=%basename_t
+# RUN: not lld -flavor darwinnew -Z -o %t %t.o 2>&1 | FileCheck %s -DBASENAME=%basename_t
 # CHECK: error: undefined symbol _foo, referenced from [[BASENAME]]
 
 .globl _main

diff  --git a/lld/test/MachO/link-search-order.s b/lld/test/MachO/link-search-order.s
index ba1aadc5d32f..9819e171c7dd 100644
--- a/lld/test/MachO/link-search-order.s
+++ b/lld/test/MachO/link-search-order.s
@@ -3,14 +3,14 @@
 # RUN: mkdir -p %t
 #
 # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %p/Inputs/libhello.s -o %t/hello.o
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib -install_name @executable_path/libhello.dylib %t/hello.o -o %t/libhello.dylib
+# RUN: lld -flavor darwinnew -dylib -install_name @executable_path/libhello.dylib %t/hello.o -o %t/libhello.dylib
 #
 # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %p/Inputs/libgoodbye.s -o %t/goodbye.o
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib -install_name @executable_path/libgoodbye.dylib %t/goodbye.o -o %t/libgoodbye.dylib
+# RUN: lld -flavor darwinnew -dylib -install_name @executable_path/libgoodbye.dylib %t/goodbye.o -o %t/libgoodbye.dylib
 # RUN: llvm-ar --format=darwin crs %t/libgoodbye.a %t/goodbye.o
 #
 # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %s -o %t/test.o
-# RUN: lld -flavor darwinnew -arch x86_64 -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z -L%t -lhello -lgoodbye -lSystem %t/test.o
+# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z -L%t -lhello -lgoodbye -lSystem %t/test.o
 #
 # RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck %s
 

diff  --git a/lld/test/MachO/load-commands.s b/lld/test/MachO/load-commands.s
index e30b2d7f5597..c9f5d9b5c218 100644
--- a/lld/test/MachO/load-commands.s
+++ b/lld/test/MachO/load-commands.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t %t.o
+# RUN: lld -flavor darwinnew -o %t %t.o
 
 ## Check for the presence of load commands that are essential for a working
 ## executable.

diff  --git a/lld/test/MachO/no-exports-dylib.s b/lld/test/MachO/no-exports-dylib.s
index ee8438e00d69..896c31ef3c2f 100644
--- a/lld/test/MachO/no-exports-dylib.s
+++ b/lld/test/MachO/no-exports-dylib.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib %t.o -o %t.dylib
+# RUN: lld -flavor darwinnew -dylib %t.o -o %t.dylib
 
 # RUN: obj2yaml %t.dylib | FileCheck %s
 # CHECK: export_size: 0

diff  --git a/lld/test/MachO/order-file.s b/lld/test/MachO/order-file.s
index 2b8c2bba0065..4ced92a4ecaf 100644
--- a/lld/test/MachO/order-file.s
+++ b/lld/test/MachO/order-file.s
@@ -14,67 +14,67 @@
 
 # RUN: echo "_foo # just a comment" > %t/ord-1
 # RUN: echo "_main # another comment" >> %t/ord-1
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-1 %t/test.o %t/foo.o -order_file %t/ord-1
+# RUN: lld -flavor darwinnew -o %t/test-1 %t/test.o %t/foo.o -order_file %t/ord-1
 # RUN: llvm-objdump -d %t/test-1 | FileCheck %s --check-prefix=FOO-FIRST
 ## Output should be the same regardless of the command-line order of object files
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-1 %t/foo.o %t/test.o -order_file %t/ord-1
+# RUN: lld -flavor darwinnew -o %t/test-1 %t/foo.o %t/test.o -order_file %t/ord-1
 # RUN: llvm-objdump -d %t/test-1 | FileCheck %s --check-prefix=FOO-FIRST
 
 # RUN: echo "_main # just a comment" > %t/ord-2
 # RUN: echo "_foo # another comment" >> %t/ord-2
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-2 %t/test.o %t/foo.o -order_file %t/ord-2
+# RUN: lld -flavor darwinnew -o %t/test-2 %t/test.o %t/foo.o -order_file %t/ord-2
 # RUN: llvm-objdump -d %t/test-2 | FileCheck %s --check-prefix=FOO-SECOND
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-2 %t/foo.o %t/test.o -order_file %t/ord-2
+# RUN: lld -flavor darwinnew -o %t/test-2 %t/foo.o %t/test.o -order_file %t/ord-2
 # RUN: llvm-objdump -d %t/test-2 | FileCheck %s --check-prefix=FOO-SECOND
 
 # RUN: echo "foo.o:_foo" > %t/ord-file-match
 # RUN: echo "_main" >> %t/ord-file-match
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-file-match %t/test.o %t/foo.o -order_file %t/ord-file-match
+# RUN: lld -flavor darwinnew -o %t/test-file-match %t/test.o %t/foo.o -order_file %t/ord-file-match
 # RUN: llvm-objdump -d %t/test-file-match | FileCheck %s --check-prefix=FOO-FIRST
 ## Output should be the same regardless of the command-line order of object files
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-file-match %t/foo.o %t/test.o -order_file %t/ord-file-match
+# RUN: lld -flavor darwinnew -o %t/test-file-match %t/foo.o %t/test.o -order_file %t/ord-file-match
 # RUN: llvm-objdump -d %t/test-file-match | FileCheck %s --check-prefix=FOO-FIRST
 
 # RUN: echo "bar.o:_foo" > %t/ord-file-nomatch
 # RUN: echo "_main" >> %t/ord-file-nomatch
 # RUN: echo "_foo" >> %t/ord-file-nomatch
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-file-nomatch %t/test.o %t/foo.o -order_file %t/ord-file-nomatch
+# RUN: lld -flavor darwinnew -o %t/test-file-nomatch %t/test.o %t/foo.o -order_file %t/ord-file-nomatch
 # RUN: llvm-objdump -d %t/test-file-nomatch | FileCheck %s --check-prefix=FOO-SECOND
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-file-nomatch %t/foo.o %t/test.o -order_file %t/ord-file-nomatch
+# RUN: lld -flavor darwinnew -o %t/test-file-nomatch %t/foo.o %t/test.o -order_file %t/ord-file-nomatch
 # RUN: llvm-objdump -d %t/test-file-nomatch | FileCheck %s --check-prefix=FOO-SECOND
 
 # RUN: echo "x86_64:_foo" > %t/ord-arch-match
 # RUN: echo "_main" >> %t/ord-arch-match
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-arch-match %t/test.o %t/foo.o -order_file %t/ord-arch-match
+# RUN: lld -flavor darwinnew -o %t/test-arch-match %t/test.o %t/foo.o -order_file %t/ord-arch-match
 # RUN: llvm-objdump -d %t/test-arch-match | FileCheck %s --check-prefix=FOO-FIRST
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-arch-match %t/foo.o %t/test.o -order_file %t/ord-arch-match
+# RUN: lld -flavor darwinnew -o %t/test-arch-match %t/foo.o %t/test.o -order_file %t/ord-arch-match
 # RUN: llvm-objdump -d %t/test-arch-match | FileCheck %s --check-prefix=FOO-FIRST
 
 # RUN: echo "ppc:_foo" > %t/ord-arch-nomatch
 # RUN: echo "_main" >> %t/ord-arch-nomatch
 # RUN: echo "_foo" >> %t/ord-arch-nomatch
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-arch-nomatch %t/test.o %t/foo.o -order_file %t/ord-arch-nomatch
+# RUN: lld -flavor darwinnew -o %t/test-arch-nomatch %t/test.o %t/foo.o -order_file %t/ord-arch-nomatch
 # RUN: llvm-objdump -d %t/test-arch-nomatch | FileCheck %s --check-prefix=FOO-SECOND
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-arch-nomatch %t/foo.o %t/test.o -order_file %t/ord-arch-nomatch
+# RUN: lld -flavor darwinnew -o %t/test-arch-nomatch %t/foo.o %t/test.o -order_file %t/ord-arch-nomatch
 # RUN: llvm-objdump -d %t/test-arch-nomatch | FileCheck %s --check-prefix=FOO-SECOND
 
 # RUN: echo "x86_64:bar.o:_foo" > %t/ord-arch-file-match
 # RUN: echo "_main" >> %t/ord-arch-match
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-arch-match %t/test.o %t/foo.o -order_file %t/ord-arch-match
+# RUN: lld -flavor darwinnew -o %t/test-arch-match %t/test.o %t/foo.o -order_file %t/ord-arch-match
 # RUN: llvm-objdump -d %t/test-arch-match | FileCheck %s --check-prefix=FOO-FIRST
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-arch-match %t/foo.o %t/test.o -order_file %t/ord-arch-match
+# RUN: lld -flavor darwinnew -o %t/test-arch-match %t/foo.o %t/test.o -order_file %t/ord-arch-match
 # RUN: llvm-objdump -d %t/test-arch-match | FileCheck %s --check-prefix=FOO-FIRST
 
 ## Test archives
 
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-archive-1 %t/test.o %t/foo.a -order_file %t/ord-1
+# RUN: lld -flavor darwinnew -o %t/test-archive-1 %t/test.o %t/foo.a -order_file %t/ord-1
 # RUN: llvm-objdump -d %t/test-archive-1 | FileCheck %s --check-prefix=FOO-FIRST
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-archive-1 %t/foo.a %t/test.o -order_file %t/ord-1
+# RUN: lld -flavor darwinnew -o %t/test-archive-1 %t/foo.a %t/test.o -order_file %t/ord-1
 # RUN: llvm-objdump -d %t/test-archive-1 | FileCheck %s --check-prefix=FOO-FIRST
 
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-archive-file-no-match %t/test.o %t/foo.a -order_file %t/ord-file-nomatch
+# RUN: lld -flavor darwinnew -o %t/test-archive-file-no-match %t/test.o %t/foo.a -order_file %t/ord-file-nomatch
 # RUN: llvm-objdump -d %t/test-archive-file-no-match | FileCheck %s --check-prefix=FOO-SECOND
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-archive %t/foo.a %t/test.o -order_file %t/ord-file-nomatch
+# RUN: lld -flavor darwinnew -o %t/test-archive %t/foo.a %t/test.o -order_file %t/ord-file-nomatch
 # RUN: llvm-objdump -d %t/test-archive-file-no-match | FileCheck %s --check-prefix=FOO-SECOND
 
 ## The following tests check that if an address is matched by multiple order
@@ -83,33 +83,33 @@
 # RUN: echo "_foo" > %t/ord-multiple-1
 # RUN: echo "_main" >> %t/ord-multiple-1
 # RUN: echo "foo.o:_foo" >> %t/ord-multiple-1
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-1 %t/test.o %t/foo.o -order_file %t/ord-multiple-1
+# RUN: lld -flavor darwinnew -o %t/test-1 %t/test.o %t/foo.o -order_file %t/ord-multiple-1
 # RUN: llvm-objdump -d %t/test-1 | FileCheck %s --check-prefix=FOO-FIRST
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-1 %t/foo.o %t/test.o -order_file %t/ord-multiple-1
+# RUN: lld -flavor darwinnew -o %t/test-1 %t/foo.o %t/test.o -order_file %t/ord-multiple-1
 # RUN: llvm-objdump -d %t/test-1 | FileCheck %s --check-prefix=FOO-FIRST
 
 # RUN: echo "foo.o:_foo" > %t/ord-multiple-2
 # RUN: echo "_main" >> %t/ord-multiple-2
 # RUN: echo "_foo" >> %t/ord-multiple-2
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-2 %t/test.o %t/foo.o -order_file %t/ord-multiple-2
+# RUN: lld -flavor darwinnew -o %t/test-2 %t/test.o %t/foo.o -order_file %t/ord-multiple-2
 # RUN: llvm-objdump -d %t/test-2 | FileCheck %s --check-prefix=FOO-FIRST
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-2 %t/foo.o %t/test.o -order_file %t/ord-multiple-2
+# RUN: lld -flavor darwinnew -o %t/test-2 %t/foo.o %t/test.o -order_file %t/ord-multiple-2
 # RUN: llvm-objdump -d %t/test-2 | FileCheck %s --check-prefix=FOO-FIRST
 
 # RUN: echo "_foo" > %t/ord-multiple-3
 # RUN: echo "_main" >> %t/ord-multiple-3
 # RUN: echo "_foo" >> %t/ord-multiple-3
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-3 %t/test.o %t/foo.o -order_file %t/ord-multiple-3
+# RUN: lld -flavor darwinnew -o %t/test-3 %t/test.o %t/foo.o -order_file %t/ord-multiple-3
 # RUN: llvm-objdump -d %t/test-3 | FileCheck %s --check-prefix=FOO-FIRST
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-3 %t/foo.o %t/test.o -order_file %t/ord-multiple-3
+# RUN: lld -flavor darwinnew -o %t/test-3 %t/foo.o %t/test.o -order_file %t/ord-multiple-3
 # RUN: llvm-objdump -d %t/test-3 | FileCheck %s --check-prefix=FOO-FIRST
 
 # RUN: echo "foo.o:_foo" > %t/ord-multiple-4
 # RUN: echo "_main" >> %t/ord-multiple-4
 # RUN: echo "foo.o:_foo" >> %t/ord-multiple-4
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-4 %t/test.o %t/foo.o -order_file %t/ord-multiple-4
+# RUN: lld -flavor darwinnew -o %t/test-4 %t/test.o %t/foo.o -order_file %t/ord-multiple-4
 # RUN: llvm-objdump -d %t/test-4 | FileCheck %s --check-prefix=FOO-FIRST
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-4 %t/foo.o %t/test.o -order_file %t/ord-multiple-4
+# RUN: lld -flavor darwinnew -o %t/test-4 %t/foo.o %t/test.o -order_file %t/ord-multiple-4
 # RUN: llvm-objdump -d %t/test-4 | FileCheck %s --check-prefix=FOO-FIRST
 
 ## _foo and _bar both point to the same location. When both symbols appear in
@@ -118,9 +118,9 @@
 # RUN: echo "_bar" > %t/ord-alias
 # RUN: echo "_main" >> %t/ord-alias
 # RUN: echo "_foo" >> %t/ord-alias
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-alias %t/test.o %t/foo.o -order_file %t/ord-alias
+# RUN: lld -flavor darwinnew -o %t/test-alias %t/test.o %t/foo.o -order_file %t/ord-alias
 # RUN: llvm-objdump -d %t/test-alias | FileCheck %s --check-prefix=FOO-FIRST
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-alias %t/foo.o %t/test.o -order_file %t/ord-alias
+# RUN: lld -flavor darwinnew -o %t/test-alias %t/foo.o %t/test.o -order_file %t/ord-alias
 # RUN: llvm-objdump -d %t/test-alias | FileCheck %s --check-prefix=FOO-FIRST
 
 .text

diff  --git a/lld/test/MachO/platform-version.test b/lld/test/MachO/platform-version.test
index 4bd69ea76a27..baa4ced08fb1 100644
--- a/lld/test/MachO/platform-version.test
+++ b/lld/test/MachO/platform-version.test
@@ -1,14 +1,14 @@
-# RUN: not lld -flavor darwinnew -arch x86_64 -platform_version 2>&1 \
+# RUN: not lld -flavor darwinnew -platform_version 2>&1 \
 # RUN:     | FileCheck --check-prefix=MISSING %s
-# RUN: not lld -flavor darwinnew -arch x86_64 -platform_version macos 2>&1 \
+# RUN: not lld -flavor darwinnew -platform_version macos 2>&1 \
 # RUN:     | FileCheck --check-prefix=MISSING %s
-# RUN: not lld -flavor darwinnew -arch x86_64 -platform_version macos 10.15 2>&1 \
+# RUN: not lld -flavor darwinnew -platform_version macos 10.15 2>&1 \
 # RUN:     | FileCheck --check-prefix=MISSING %s
-# RUN: not lld -flavor darwinnew -arch x86_64 -platform_version macos -lfoo 10.15 2>&1 \
+# RUN: not lld -flavor darwinnew -platform_version macos -lfoo 10.15 2>&1 \
 # RUN:     | FileCheck --check-prefix=GOOD %s
-# RUN: not lld -flavor darwinnew -arch x86_64 -platform_version macos 10.15 10.15.4 2>&1 \
+# RUN: not lld -flavor darwinnew -platform_version macos 10.15 10.15.4 2>&1 \
 # RUN:     | FileCheck --check-prefix=GOOD %s
-# RUN: not lld -flavor darwinnew -arch x86_64 -platform_version macos 10.15 10.15.4 foobar 2>&1 \
+# RUN: not lld -flavor darwinnew -platform_version macos 10.15 10.15.4 foobar 2>&1 \
 # RUN:     | FileCheck --check-prefix=FAIL_FILE %s
 
 MISSING: -platform_version: missing argument

diff  --git a/lld/test/MachO/relocations.s b/lld/test/MachO/relocations.s
index e6654562f6c9..b1c828d4d469 100644
--- a/lld/test/MachO/relocations.s
+++ b/lld/test/MachO/relocations.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t %t.o
+# RUN: lld -flavor darwinnew -o %t %t.o
 # RUN: llvm-objdump --section-headers --syms -d %t | FileCheck %s
 
 # CHECK-LABEL: Sections:

diff  --git a/lld/test/MachO/resolution.s b/lld/test/MachO/resolution.s
index 28a30ac5c805..a13bb529cf7f 100644
--- a/lld/test/MachO/resolution.s
+++ b/lld/test/MachO/resolution.s
@@ -2,19 +2,19 @@
 # RUN: mkdir -p %t
 # RUN: echo '.globl _foo, _bar, _baz; _foo: _bar: _baz:' | \
 # RUN:   llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t/libresolution.o
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib -install_name \
+# RUN: lld -flavor darwinnew -dylib -install_name \
 # RUN:   @executable_path/libresolution.dylib %t/libresolution.o -o %t/libresolution.dylib
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib -install_name \
+# RUN: lld -flavor darwinnew -dylib -install_name \
 # RUN:   @executable_path/libresolution2.dylib %t/libresolution.o -o %t/libresolution2.dylib
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/resolution.o
 
 ## Check that we select the symbol defined in the first dylib passed on the
 ## command line.
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/dylib-first -Z -L%t -lresolution -lresolution2 %t/resolution.o
+# RUN: lld -flavor darwinnew -o %t/dylib-first -Z -L%t -lresolution -lresolution2 %t/resolution.o
 # RUN: llvm-objdump --macho --bind %t/dylib-first | FileCheck %s --check-prefix=DYLIB-FIRST
 # DYLIB-FIRST:     libresolution _foo
 
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/dylib2-first -Z -L%t -lresolution2 -lresolution %t/resolution.o
+# RUN: lld -flavor darwinnew -o %t/dylib2-first -Z -L%t -lresolution2 -lresolution %t/resolution.o
 # RUN: llvm-objdump --macho --bind %t/dylib2-first | FileCheck %s --check-prefix=DYLIB2-FIRST
 # DYLIB2-FIRST: libresolution2 _foo
 
@@ -24,7 +24,7 @@
 
 ## Check that we pick the dylib symbol over the undefined symbol in the object
 ## file, even if the object file appears first on the command line.
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/obj-first -Z -L%t %t/resolution.o -lresolution
+# RUN: lld -flavor darwinnew -o %t/obj-first -Z -L%t %t/resolution.o -lresolution
 # RUN: llvm-objdump --macho --bind %t/obj-first | FileCheck %s --check-prefix=OBJ-FIRST
 # OBJ-FIRST: libresolution _foo
 ## But defined symbols should still take precedence.

diff  --git a/lld/test/MachO/search-paths.test b/lld/test/MachO/search-paths.test
index 4a39a7be962a..84e8ba93c616 100644
--- a/lld/test/MachO/search-paths.test
+++ b/lld/test/MachO/search-paths.test
@@ -1,12 +1,12 @@
 RUN: mkdir -p %t
 
-RUN: lld -flavor darwinnew -arch x86_64 -v -L%t 2>&1 | FileCheck -DDIR=%t %s
+RUN: lld -flavor darwinnew -v -L%t 2>&1 | FileCheck -DDIR=%t %s
 CHECK:      Library search paths:
 CHECK-NEXT: [[DIR]]
 CHECK-NEXT: /usr/lib
 CHECK-NEXT: /usr/local/lib
 
-RUN: lld -flavor darwinnew -arch x86_64 -v -L%t -Z 2>&1 | FileCheck -DDIR=%t --check-prefix=CHECK_Z %s
+RUN: lld -flavor darwinnew -v -L%t -Z 2>&1 | FileCheck -DDIR=%t --check-prefix=CHECK_Z %s
 CHECK_Z:      Library search paths:
 CHECK_Z-NEXT: [[DIR]]
 CHECK_Z-NOT:  /usr/

diff  --git a/lld/test/MachO/section-headers.s b/lld/test/MachO/section-headers.s
index 55d5e1c711a3..9fafc5a912b0 100644
--- a/lld/test/MachO/section-headers.s
+++ b/lld/test/MachO/section-headers.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t %t.o
+# RUN: lld -flavor darwinnew -o %t %t.o
 # RUN: llvm-readobj --section-headers %t | FileCheck %s
 
 # CHECK:      Name: __text

diff  --git a/lld/test/MachO/section-merge.s b/lld/test/MachO/section-merge.s
index 0ec9b41501cb..33e1eddd3044 100644
--- a/lld/test/MachO/section-merge.s
+++ b/lld/test/MachO/section-merge.s
@@ -8,7 +8,7 @@
 # RUN:   -o %t/libfunction.o
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s \
 # RUN:   -o %t/main.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/output %t/libfunction.o %t/libgoodbye.o %t/libhello.o %t/main.o
+# RUN: lld -flavor darwinnew -o %t/output %t/libfunction.o %t/libgoodbye.o %t/libhello.o %t/main.o
 
 # RUN: llvm-objdump --syms %t/output | FileCheck %s
 # CHECK:      SYMBOL TABLE:

diff  --git a/lld/test/MachO/segments.s b/lld/test/MachO/segments.s
index 6eba1247af60..acb0f1e90101 100644
--- a/lld/test/MachO/segments.s
+++ b/lld/test/MachO/segments.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t %t.o
+# RUN: lld -flavor darwinnew -o %t %t.o
 # RUN: llvm-readobj --macho-segment %t | FileCheck %s
 
 ## These two segments must always be present at the start of an executable.

diff  --git a/lld/test/MachO/silent-ignore.test b/lld/test/MachO/silent-ignore.test
index 289f37a0f53a..ae68dd8fe81f 100644
--- a/lld/test/MachO/silent-ignore.test
+++ b/lld/test/MachO/silent-ignore.test
@@ -1,9 +1,9 @@
-RUN: lld -flavor darwinnew -arch x86_64 -v \
+RUN: lld -flavor darwinnew -v \
 RUN:   -demangle \
 RUN:   -dynamic \
 RUN:   -no_deduplicate \
 RUN:   -lto_library /lib/foo \
 RUN:   -macosx_version_min 0 \
 RUN:   -syslibroot /path/to/MacOSX.platform/Developer/SDKs/MacOSX.sdk
-RUN: not lld -flavor darwinnew -arch x86_64 -v --not-an-ignored-argument 2>&1 | FileCheck %s
+RUN: not lld -flavor darwinnew -v --not-an-ignored-argument 2>&1 | FileCheck %s
 CHECK: error: unknown argument: --not-an-ignored-argument

diff  --git a/lld/test/MachO/static-link.s b/lld/test/MachO/static-link.s
index 84309f8ef2e6..f8260807df6f 100644
--- a/lld/test/MachO/static-link.s
+++ b/lld/test/MachO/static-link.s
@@ -6,7 +6,7 @@
 # RUN: llvm-ar --format=darwin crs %t/libgoodbye.a %t/goodbye.o
 #
 # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %s -o %t/test.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test -Z -L%t -lgoodbye %t/test.o
+# RUN: lld -flavor darwinnew -o %t/test -Z -L%t -lgoodbye %t/test.o
 #
 # RUN: llvm-objdump --syms -d -r %t/test | FileCheck %s
 

diff  --git a/lld/test/MachO/stub-link.s b/lld/test/MachO/stub-link.s
index 65bd642638a8..1bf65c46a787 100644
--- a/lld/test/MachO/stub-link.s
+++ b/lld/test/MachO/stub-link.s
@@ -3,7 +3,7 @@
 # RUN: mkdir -p %t
 #
 # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %s -o %t/test.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test -Z -L%S/Inputs/MacOSX.sdk/usr/lib -lSystem %t/test.o
+# RUN: lld -flavor darwinnew -o %t/test -Z -L%S/Inputs/MacOSX.sdk/usr/lib -lSystem %t/test.o
 #
 # RUN: llvm-objdump --bind --no-show-raw-insn -d -r %t/test | FileCheck %s
 

diff  --git a/lld/test/MachO/sub-library.s b/lld/test/MachO/sub-library.s
index c98546da200b..e858eaf0bff5 100644
--- a/lld/test/MachO/sub-library.s
+++ b/lld/test/MachO/sub-library.s
@@ -8,10 +8,10 @@
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %p/Inputs/libgoodbye.s \
 # RUN:   -o %t/libgoodbye.o
 # RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t/libsuper.o
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib %t/libhello.o -o %t/libhello.dylib
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib -L%t -sub_library libhello -lhello \
+# RUN: lld -flavor darwinnew -dylib %t/libhello.o -o %t/libhello.dylib
+# RUN: lld -flavor darwinnew -dylib -L%t -sub_library libhello -lhello \
 # RUN:   %t/libgoodbye.o -o %t/libgoodbye.dylib
-# RUN: lld -flavor darwinnew -arch x86_64 -dylib -L%t -sub_library libgoodbye -lgoodbye -install_name \
+# RUN: lld -flavor darwinnew -dylib -L%t -sub_library libgoodbye -lgoodbye -install_name \
 # RUN:   @executable_path/libsuper.dylib %t/libsuper.o -o %t/libsuper.dylib
 
 
@@ -37,7 +37,7 @@
 # SUPER-HEADERS:     name    [[DIR]]/libgoodbye.dylib
 
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/sub-library.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/sub-library -L%t -lsuper %t/sub-library.o
+# RUN: lld -flavor darwinnew -o %t/sub-library -L%t -lsuper %t/sub-library.o
 
 # RUN: llvm-objdump --macho --bind %t/sub-library | FileCheck %s
 # CHECK-LABEL: Bind table:
@@ -46,11 +46,11 @@
 
 
 ## Check that we fail gracefully if the sub-library is missing
-# RUN: not lld -flavor darwinnew -arch x86_64 -dylib -Z -o %t/sub-library -sub_library libmissing %t/sub-library.o 2>&1 \
+# RUN: not lld -flavor darwinnew -dylib -Z -o %t/sub-library -sub_library libmissing %t/sub-library.o 2>&1 \
 # RUN:   | FileCheck %s --check-prefix=MISSING-SUB-LIBRARY
 # MISSING-SUB-LIBRARY: error: -sub_library libmissing does not match a supplied dylib
 # RUN: rm -f %t/libgoodbye.dylib
-# RUN: not lld -flavor darwinnew -arch x86_64 -o %t/sub-library -Z -L%t -lsuper %t/sub-library.o 2>&1 \
+# RUN: not lld -flavor darwinnew -o %t/sub-library -Z -L%t -lsuper %t/sub-library.o 2>&1 \
 # RUN:  | FileCheck %s --check-prefix=MISSING-REEXPORT -DDIR=%t
 # MISSING-REEXPORT: error: unable to read re-exported dylib at [[DIR]]/libgoodbye.dylib
 

diff  --git a/lld/test/MachO/subsections-section-relocs.s b/lld/test/MachO/subsections-section-relocs.s
index 5f981999fb2c..e8a8d7a3ec40 100644
--- a/lld/test/MachO/subsections-section-relocs.s
+++ b/lld/test/MachO/subsections-section-relocs.s
@@ -5,7 +5,7 @@
 # RUN: echo "_bar_str" > %t/order-file
 # RUN: echo "_foo_str" >> %t/order-file
 
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test %t/test.o -order_file %t/order-file
+# RUN: lld -flavor darwinnew -o %t/test %t/test.o -order_file %t/order-file
 # RUN: llvm-objdump --section-headers -d --no-show-raw-insn %t/test | FileCheck %s
 # CHECK-LABEL: Sections:
 # CHECK:       __cstring {{[^ ]*}} {{0*}}[[#%x, CSTRING_ADDR:]]

diff  --git a/lld/test/MachO/subsections-symbol-relocs.s b/lld/test/MachO/subsections-symbol-relocs.s
index b657c37b96fc..475c909377da 100644
--- a/lld/test/MachO/subsections-symbol-relocs.s
+++ b/lld/test/MachO/subsections-symbol-relocs.s
@@ -17,9 +17,9 @@
 # RUN: echo "_main" >> %t/order-file-2
 # RUN: echo "_qux" >> %t/order-file-2
 
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-1 %t/test.o -order_file %t/order-file-1
+# RUN: lld -flavor darwinnew -o %t/test-1 %t/test.o -order_file %t/order-file-1
 # RUN: llvm-objdump -d --no-show-raw-insn %t/test-1 | FileCheck %s
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t/test-2 %t/test.o -order_file %t/order-file-2
+# RUN: lld -flavor darwinnew -o %t/test-2 %t/test.o -order_file %t/order-file-2
 # RUN: llvm-objdump -d --no-show-raw-insn %t/test-2 | FileCheck %s
 # CHECK-LABEL: Disassembly of section __TEXT,__text:
 # CHECK:       <_bar>:

diff  --git a/lld/test/MachO/symbol-order.s b/lld/test/MachO/symbol-order.s
index 04a392be78f3..328ff9e2475e 100644
--- a/lld/test/MachO/symbol-order.s
+++ b/lld/test/MachO/symbol-order.s
@@ -5,7 +5,7 @@
 # RUN: echo ".global f; .section __TEXT,test_f2; f: ret"                | llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t/f2.o
 # RUN: echo ".global f, g; .section __TEXT,test_fg; f: ret; g: callq f" | llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t/fg.o
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/test.o
-# RUN: lld -flavor darwinnew -arch x86_64 -L%S/Inputs/MacOSX.sdk/usr/lib -dylib -o %t/libf1.dylib %t/f1.o -lSystem
+# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib -dylib -o %t/libf1.dylib %t/f1.o -lSystem
 
 # RUN: rm -f %t/libf2_g.a
 # RUN: llvm-ar rcs %t/libf2_g.a %t/f2.o %t/g.o
@@ -13,7 +13,7 @@
 # RUN: rm -f %t/libfg.a
 # RUN: llvm-ar rcs %t/libfg.a %t/fg.o
 
-# RUN: lld -flavor darwinnew -arch x86_64 -L%S/Inputs/MacOSX.sdk/usr/lib %t/libf1.dylib %t/libf2_g.a %t/test.o -o %t/test.out -lSystem
+# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib %t/libf1.dylib %t/libf2_g.a %t/test.o -o %t/test.out -lSystem
 # RUN: llvm-objdump --syms --macho --lazy-bind %t/test.out | FileCheck %s --check-prefix DYLIB-FIRST
 # DYLIB-FIRST:      SYMBOL TABLE:
 # DYLIB-FIRST-DAG:  __TEXT,test_g g
@@ -21,7 +21,7 @@
 # DYLIB-FIRST-NEXT: segment  section            address       dylib            symbol
 # DYLIB-FIRST-NEXT: __DATA   __la_symbol_ptr    {{[0-9a-z]+}} libf1            f
 
-# RUN: lld -flavor darwinnew -arch x86_64 -L%S/Inputs/MacOSX.sdk/usr/lib %t/libf2_g.a %t/libf1.dylib %t/test.o -o %t/test.out -lSystem
+# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib %t/libf2_g.a %t/libf1.dylib %t/test.o -o %t/test.out -lSystem
 # RUN: llvm-objdump --syms --macho --lazy-bind %t/test.out | FileCheck %s --check-prefix ARCHIVE-FIRST
 # ARCHIVE-FIRST:      SYMBOL TABLE:
 # ARCHIVE-FIRST-DAG:  __TEXT,test_f2 f
@@ -30,7 +30,7 @@
 # ARCHIVE-FIRST-NEXT: segment  section            address       dylib            symbol
 # ARCHIVE-FIRST-EMPTY:
 
-# RUN: lld -flavor darwinnew -arch x86_64 -L%S/Inputs/MacOSX.sdk/usr/lib %t/libf1.dylib %t/libfg.a %t/test.o -o %t/test.out -lSystem
+# RUN: lld -flavor darwinnew -L%S/Inputs/MacOSX.sdk/usr/lib %t/libf1.dylib %t/libfg.a %t/test.o -o %t/test.out -lSystem
 # RUN: llvm-objdump --syms --macho --lazy-bind %t/test.out | FileCheck %s --check-prefix ARCHIVE-PRIORITY
 # ARCHIVE-PRIORITY:      SYMBOL TABLE:
 # ARCHIVE-PRIORITY-DAG:  __TEXT,test_fg f

diff  --git a/lld/test/MachO/symtab.s b/lld/test/MachO/symtab.s
index 4082c818b38c..44a016912bd6 100644
--- a/lld/test/MachO/symtab.s
+++ b/lld/test/MachO/symtab.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t %t.o
+# RUN: lld -flavor darwinnew -o %t %t.o
 # RUN: llvm-readobj -symbols %t | FileCheck %s
 
 # CHECK:      Symbols [

diff  --git a/lld/test/MachO/x86-64-reloc-signed.s b/lld/test/MachO/x86-64-reloc-signed.s
index be147cd3c60a..568f65c7c1e3 100644
--- a/lld/test/MachO/x86-64-reloc-signed.s
+++ b/lld/test/MachO/x86-64-reloc-signed.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t %t.o
+# RUN: lld -flavor darwinnew -o %t %t.o
 # RUN: llvm-objdump -D %t | FileCheck %s
 
 # CHECK:      <_main>:

diff  --git a/lld/test/MachO/x86-64-reloc-unsigned.s b/lld/test/MachO/x86-64-reloc-unsigned.s
index 8995b7d58b35..52a3d536139c 100644
--- a/lld/test/MachO/x86-64-reloc-unsigned.s
+++ b/lld/test/MachO/x86-64-reloc-unsigned.s
@@ -1,6 +1,6 @@
 # REQUIRES: x86
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
-# RUN: lld -flavor darwinnew -arch x86_64 -o %t %t.o
+# RUN: lld -flavor darwinnew -o %t %t.o
 # RUN: llvm-objdump --full-contents %t | FileCheck %s
 # CHECK: Contents of section foo:
 # CHECK:  100001000 08100000 01000000


        


More information about the llvm-commits mailing list