Index: lld/MachO/Driver.cpp =================================================================== --- lld/MachO/Driver.cpp +++ lld/MachO/Driver.cpp @@ -578,20 +578,22 @@ map_iterator(s.end(), toLowerDash)); } -// Has the side-effect of setting Config::platformInfo. -static PlatformType parsePlatformVersion(const ArgList &args) { - const Arg *arg = args.getLastArg(OPT_platform_version); - if (!arg) { - error("must specify -platform_version"); - return PLATFORM_UNKNOWN; - } - +struct PlatformVersion { + PlatformType platform = PLATFORM_UNKNOWN; + llvm::VersionTuple minimum; + llvm::VersionTuple sdk; +}; + +static PlatformVersion parsePlatformVersion(const Arg *arg) { + assert(arg->getOption().getID() == OPT_platform_version); StringRef platformStr = arg->getValue(0); StringRef minVersionStr = arg->getValue(1); StringRef sdkVersionStr = arg->getValue(2); + PlatformVersion platformVersion; + // TODO(compnerd) see if we can generate this case list via XMACROS - PlatformType platform = + platformVersion.platform = StringSwitch(lowerDash(platformStr)) .Cases("macos", "1", PLATFORM_MACOS) .Cases("ios", "2", PLATFORM_IOS) @@ -604,20 +606,20 @@ .Cases("watchos-simulator", "9", PLATFORM_WATCHOSSIMULATOR) .Cases("driverkit", "10", PLATFORM_DRIVERKIT) .Default(PLATFORM_UNKNOWN); - if (platform == PLATFORM_UNKNOWN) + if (platformVersion.platform == PLATFORM_UNKNOWN) error(Twine("malformed platform: ") + platformStr); // TODO: check validity of version strings, which varies by platform // NOTE: ld64 accepts version strings with 5 components // llvm::VersionTuple accepts no more than 4 components // Has Apple ever published version strings with 5 components? - if (config->platformInfo.minimum.tryParse(minVersionStr)) + if (platformVersion.minimum.tryParse(minVersionStr)) error(Twine("malformed minimum version: ") + minVersionStr); - if (config->platformInfo.sdk.tryParse(sdkVersionStr)) + if (platformVersion.sdk.tryParse(sdkVersionStr)) error(Twine("malformed sdk version: ") + sdkVersionStr); - return platform; + return platformVersion; } -// Has the side-effect of setting Config::target. +// Has the side-effect of setting Config::target and Config::platformInfo. static TargetInfo *createTargetInfo(InputArgList &args) { StringRef archName = args.getLastArgValue(OPT_arch); if (archName.empty()) { @@ -625,7 +627,29 @@ return nullptr; } - PlatformType platform = parsePlatformVersion(args); + std::vector platformVersions; + for (const Arg *arg : args.filtered(OPT_platform_version)) + platformVersions.push_back(parsePlatformVersion(arg)); + + PlatformType platform; + if (platformVersions.empty()) { + error("must specify -platform_version"); + platform = PLATFORM_UNKNOWN; + } else if (platformVersions.size() > 2) { + error("must specify -platform_version at most twice"); + platform = PLATFORM_UNKNOWN; + } else { + if (platformVersions.size() > 1) { + // FIXME: If you implement support for this, add a diagnostic if + // outputType is not dylib or bundle -- linkers shouldn't be able to + // write zippered executables. + warn("writing zippered outputs not yet implemented, " + "ignoring all but last -platform_version flag"); + } + platform = platformVersions.back().platform; + config->platformInfo.minimum = platformVersions.back().minimum; + config->platformInfo.sdk = platformVersions.back().sdk; + } config->platformInfo.target = MachO::Target(getArchitectureFromName(archName), platform); Index: lld/MachO/InputFiles.cpp =================================================================== --- lld/MachO/InputFiles.cpp +++ lld/MachO/InputFiles.cpp @@ -116,6 +116,7 @@ const char *hdr = input->mb.getBufferStart(); + // "Zippered" object files can have multiple LC_BUILD_VERSION load commands. std::vector platformInfos; for (auto *cmd : findCommands(hdr, LC_BUILD_VERSION)) { PlatformInfo info; Index: lld/test/MachO/U-dynamic-lookup.s =================================================================== --- lld/test/MachO/U-dynamic-lookup.s +++ lld/test/MachO/U-dynamic-lookup.s @@ -2,7 +2,7 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s -# RUN: %lld -dylib -o %t/foo.dylib %t/foo.o +# RUN: %lld-mac -dylib -o %t/foo.dylib %t/foo.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s @@ -10,13 +10,13 @@ # against the Undefined from foo.o. _bar isn't referenced in any object file, # but starts out as Undefined because of the -u flag. _baz isn't referenced # at all. -# RUN: %lld -lSystem %t/main.o -U _foo -U _bar -u _bar -U _baz -o %t/out +# RUN: %lld-mac -lSystem %t/main.o -U _foo -U _bar -u _bar -U _baz -o %t/out # RUN: llvm-objdump --macho --lazy-bind %t/out | FileCheck --check-prefix=DYNAMIC %s # RUN: llvm-nm -m %t/out | FileCheck --check-prefix=DYNAMICSYM %s # Same thing should happen if _foo starts out as an Undefined. # `-U _foo` being passed twice shouldn't have an effect either. -# RUN: %lld -lSystem %t/main.o -u _foo -U _foo -U _foo -u _bar -U _bar -U _baz -o %t/out +# RUN: %lld-mac -lSystem %t/main.o -u _foo -U _foo -U _foo -u _bar -U _bar -U _baz -o %t/out # RUN: llvm-objdump --macho --lazy-bind %t/out | FileCheck --check-prefix=DYNAMIC %s # RUN: llvm-nm -m %t/out | FileCheck --check-prefix=DYNAMICSYM %s @@ -35,14 +35,14 @@ # Test with a Defined. Here, foo.o provides _foo and the symbol doesn't need # to be imported. -# RUN: %lld -lSystem %t/main.o %t/foo.o -U _foo -o %t/out +# RUN: %lld-mac -lSystem %t/main.o %t/foo.o -U _foo -o %t/out # RUN: llvm-objdump --macho --lazy-bind %t/out | FileCheck --check-prefix=NOTDYNAMIC %s # NOTDYNAMIC-NOT: _foo # Here, foo.dylib provides _foo and the symbol doesn't need to be imported # dynamically. -# RUN: %lld -lSystem %t/main.o %t/foo.dylib -U _foo -o %t/out +# RUN: %lld-mac -lSystem %t/main.o %t/foo.dylib -U _foo -o %t/out # RUN: llvm-objdump --macho --lazy-bind %t/out | FileCheck --check-prefix=TWOLEVEL %s # RUN: llvm-nm -m %t/out | FileCheck --check-prefix=TWOLEVELSYM %s @@ -51,14 +51,14 @@ # Test resolving dynamic lookup symbol with weak defined. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/weak-foo.o %t/weak-foo.s -# RUN: %lld -dylib -o %t/weak-foo.dylib %t/weak-foo.o -U _foo +# RUN: %lld-mac -dylib -o %t/weak-foo.dylib %t/weak-foo.o -U _foo # RUN: llvm-objdump --macho --bind --lazy-bind --weak-bind %t/weak-foo.dylib | FileCheck --check-prefix=WEAKDEF %s # RUN: llvm-nm -m %t/weak-foo.dylib | FileCheck --check-prefix=WEAKDEFSYM %s # WEAKDEF-NOT: _foo # WEAKDEFSYM: weak external _foo # Same if foo.dylib provides _foo weakly, except that the symbol is weak then. -# RUN: %lld -lSystem %t/main.o %t/weak-foo.dylib -U _foo -o %t/out +# RUN: %lld-mac -lSystem %t/main.o %t/weak-foo.dylib -U _foo -o %t/out # RUN: llvm-objdump --macho --bind --lazy-bind --weak-bind %t/out | FileCheck --check-prefix=TWOLEVELWEAK %s # RUN: llvm-nm -m %t/out | FileCheck --check-prefix=TWOLEVELWEAKSYM %s Index: lld/test/MachO/abs-symbols.s =================================================================== --- lld/test/MachO/abs-symbols.s +++ lld/test/MachO/abs-symbols.s @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld -lSystem %t.o -o %t +# RUN: %lld-mac -lSystem %t.o -o %t # RUN: llvm-objdump --macho --syms --exports-trie %t | FileCheck %s # CHECK-LABEL: SYMBOL TABLE: Index: lld/test/MachO/add-ast-path.s =================================================================== --- lld/test/MachO/add-ast-path.s +++ lld/test/MachO/add-ast-path.s @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld -lSystem %t.o -o %t -add_ast_path asdf -add_ast_path fdsa +# RUN: %lld-mac -lSystem %t.o -o %t -add_ast_path asdf -add_ast_path fdsa # RUN: dsymutil -s %t | FileCheck %s # CHECK: [ 0] {{[0-9a-f]+}} 32 (N_AST ) 00 0000 0000000000000000 'asdf' # CHECK-NEXT: [ 1] {{[0-9a-f]+}} 32 (N_AST ) 00 0000 0000000000000000 'fdsa' Index: lld/test/MachO/adhoc-codesign-hash.s =================================================================== --- lld/test/MachO/adhoc-codesign-hash.s +++ lld/test/MachO/adhoc-codesign-hash.s @@ -5,9 +5,9 @@ # RUN: llvm-mc -filetype=obj -triple=arm64-apple-iossimulator -o %t/empty-arm64-iossimulator.o %s # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/empty-x86_64-macos.o %s -# RUN: %lld -arch arm64 -dylib -adhoc_codesign -o %t/empty-arm64-macos.dylib %t/empty-arm64-macos.o -# RUN: %lld -arch arm64 -dylib -adhoc_codesign -o %t/empty-arm64-iossimulator.dylib %t/empty-arm64-iossimulator.o -# RUN: %lld -arch x86_64 -dylib -adhoc_codesign -o %t/empty-x86_64-macos.dylib %t/empty-x86_64-macos.o +# RUN: %lld-mac -arch arm64 -dylib -adhoc_codesign -o %t/empty-arm64-macos.dylib %t/empty-arm64-macos.o +# RUN: %lld-mac -arch arm64 -dylib -adhoc_codesign -o %t/empty-arm64-iossimulator.dylib %t/empty-arm64-iossimulator.o +# RUN: %lld-mac -arch x86_64 -dylib -adhoc_codesign -o %t/empty-x86_64-macos.dylib %t/empty-x86_64-macos.o # RUN: obj2yaml %t/empty-arm64-macos.dylib | FileCheck %s -D#DATA_OFFSET=16400 -D#DATA_SIZE=304 # RUN: obj2yaml %t/empty-arm64-iossimulator.dylib | FileCheck %s -D#DATA_OFFSET=16400 -D#DATA_SIZE=304 Index: lld/test/MachO/adhoc-codesign.s =================================================================== --- lld/test/MachO/adhoc-codesign.s +++ lld/test/MachO/adhoc-codesign.s @@ -12,47 +12,47 @@ # Exhaustive test for: # (x86_64-macos, arm64-macos, arm64-ios-simulator) x (default, -adhoc_codesign, -no_adhoc-codesign) x (execute, dylib, bundle) -# RUN: %lld -lSystem -arch x86_64 -execute -o %t/out %t/main-x86_64-macos.o +# RUN: %lld-mac -lSystem -arch x86_64 -execute -o %t/out %t/main-x86_64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out | FileCheck --check-prefix=NO-ADHOC %s -# RUN: %lld -arch x86_64 -dylib -o %t/out %t/foo-x86_64-macos.o +# RUN: %lld-mac -arch x86_64 -dylib -o %t/out %t/foo-x86_64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=NO-ADHOC %s -# RUN: %lld -arch x86_64 -bundle -o %t/out %t/foo-x86_64-macos.o +# RUN: %lld-mac -arch x86_64 -bundle -o %t/out %t/foo-x86_64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=NO-ADHOC %s -# RUN: %lld -lSystem -arch x86_64 -execute -adhoc_codesign -o %t/out %t/main-x86_64-macos.o +# RUN: %lld-mac -lSystem -arch x86_64 -execute -adhoc_codesign -o %t/out %t/main-x86_64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=ADHOC %s -# RUN: %lld -arch x86_64 -dylib -adhoc_codesign -o %t/out %t/foo-x86_64-macos.o +# RUN: %lld-mac -arch x86_64 -dylib -adhoc_codesign -o %t/out %t/foo-x86_64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=ADHOC %s -# RUN: %lld -arch x86_64 -bundle -adhoc_codesign -o %t/out %t/foo-x86_64-macos.o +# RUN: %lld-mac -arch x86_64 -bundle -adhoc_codesign -o %t/out %t/foo-x86_64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=ADHOC %s -# RUN: %lld -lSystem -arch x86_64 -execute -no_adhoc_codesign -o %t/out %t/main-x86_64-macos.o +# RUN: %lld-mac -lSystem -arch x86_64 -execute -no_adhoc_codesign -o %t/out %t/main-x86_64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=NO-ADHOC %s -# RUN: %lld -arch x86_64 -dylib -no_adhoc_codesign -o %t/out %t/foo-x86_64-macos.o +# RUN: %lld-mac -arch x86_64 -dylib -no_adhoc_codesign -o %t/out %t/foo-x86_64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=NO-ADHOC %s -# RUN: %lld -arch x86_64 -bundle -no_adhoc_codesign -o %t/out %t/foo-x86_64-macos.o +# RUN: %lld-mac -arch x86_64 -bundle -no_adhoc_codesign -o %t/out %t/foo-x86_64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=NO-ADHOC %s -# RUN: %lld -lSystem -arch arm64 -execute -o %t/out %t/main-arm64-macos.o +# RUN: %lld-mac -lSystem -arch arm64 -execute -o %t/out %t/main-arm64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out | FileCheck --check-prefix=ADHOC %s -# RUN: %lld -arch arm64 -dylib -o %t/out %t/foo-arm64-macos.o +# RUN: %lld-mac -arch arm64 -dylib -o %t/out %t/foo-arm64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=ADHOC %s -# RUN: %lld -arch arm64 -bundle -o %t/out %t/foo-arm64-macos.o +# RUN: %lld-mac -arch arm64 -bundle -o %t/out %t/foo-arm64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=ADHOC %s -# RUN: %lld -lSystem -arch arm64 -execute -adhoc_codesign -o %t/out %t/main-arm64-macos.o +# RUN: %lld-mac -lSystem -arch arm64 -execute -adhoc_codesign -o %t/out %t/main-arm64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=ADHOC %s -# RUN: %lld -arch arm64 -dylib -adhoc_codesign -o %t/out %t/foo-arm64-macos.o +# RUN: %lld-mac -arch arm64 -dylib -adhoc_codesign -o %t/out %t/foo-arm64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=ADHOC %s -# RUN: %lld -arch arm64 -bundle -adhoc_codesign -o %t/out %t/foo-arm64-macos.o +# RUN: %lld-mac -arch arm64 -bundle -adhoc_codesign -o %t/out %t/foo-arm64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=ADHOC %s -# RUN: %lld -lSystem -arch arm64 -execute -no_adhoc_codesign -o %t/out %t/main-arm64-macos.o +# RUN: %lld-mac -lSystem -arch arm64 -execute -no_adhoc_codesign -o %t/out %t/main-arm64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=NO-ADHOC %s -# RUN: %lld -arch arm64 -dylib -no_adhoc_codesign -o %t/out %t/foo-arm64-macos.o +# RUN: %lld-mac -arch arm64 -dylib -no_adhoc_codesign -o %t/out %t/foo-arm64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=NO-ADHOC %s -# RUN: %lld -arch arm64 -bundle -no_adhoc_codesign -o %t/out %t/foo-arm64-macos.o +# RUN: %lld-mac -arch arm64 -bundle -no_adhoc_codesign -o %t/out %t/foo-arm64-macos.o # RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=NO-ADHOC %s Index: lld/test/MachO/application-extension.s =================================================================== --- lld/test/MachO/application-extension.s +++ lld/test/MachO/application-extension.s @@ -7,16 +7,16 @@ # RUN: llvm-mc -filetype=obj -triple=arm64-apple-macos -o %t/bar.o %t/bar.s ## MH_APP_EXTENSION_SAFE is only set on dylibs, and only if requested. -# RUN: %lld -arch arm64 -dylib -o %t/foo.dylib %t/foo.o +# RUN: %lld-mac -arch arm64 -dylib -o %t/foo.dylib %t/foo.o # RUN: llvm-otool -hv %t/foo.dylib | FileCheck --check-prefix=NOAPPEXT %s -# RUN: %lld -arch arm64 -dylib -o %t/foo-appext.dylib %t/foo.o \ +# RUN: %lld-mac -arch arm64 -dylib -o %t/foo-appext.dylib %t/foo.o \ # RUN: -application_extension # RUN: llvm-otool -hv %t/foo-appext.dylib | FileCheck --check-prefix=APPEXT %s -# RUN: %lld -arch arm64 -dylib -o %t/foo-noappext.dylib %t/foo.o \ +# RUN: %lld-mac -arch arm64 -dylib -o %t/foo-noappext.dylib %t/foo.o \ # RUN: -application_extension -no_application_extension # RUN: llvm-otool -hv %t/foo-noappext.dylib \ # RUN: | FileCheck --check-prefix=NOAPPEXT %s -# RUN: %lld -arch arm64 -bundle -o %t/foo.so %t/foo.o \ +# RUN: %lld-mac -arch arm64 -bundle -o %t/foo.so %t/foo.o \ # RUN: -application_extension # RUN: llvm-otool -hv %t/foo.so | FileCheck --check-prefix=NOAPPEXT %s @@ -24,27 +24,27 @@ # NOAPPEXT-NOT: APP_EXTENSION_SAFE ## The warning is emitted for all target types. -# RUN: %lld -arch arm64 -dylib -o %t/bar.dylib %t/bar.o \ +# RUN: %lld-mac -arch arm64 -dylib -o %t/bar.dylib %t/bar.o \ # RUN: -application_extension %t/foo-appext.dylib -# RUN: %lld -arch arm64 -dylib -o %t/bar.dylib %t/bar.o \ +# RUN: %lld-mac -arch arm64 -dylib -o %t/bar.dylib %t/bar.o \ # RUN: -application_extension -L %t -ltbd-appext -# RUN: not %lld -arch arm64 -dylib -o %t/bar.dylib %t/bar.o \ +# RUN: not %lld-mac -arch arm64 -dylib -o %t/bar.dylib %t/bar.o \ # RUN: -application_extension %t/foo-noappext.dylib \ # RUN: 2>&1 | FileCheck --check-prefix=WARN %s -# RUN: not %lld -arch arm64 -dylib -o %t/bar.dylib %t/bar.o \ +# RUN: not %lld-mac -arch arm64 -dylib -o %t/bar.dylib %t/bar.o \ # RUN: -application_extension -L %t -ltbd-noappext \ # RUN: 2>&1 | FileCheck --check-prefix=WARN %s -# RUN: not %lld -arch arm64 -bundle -o %t/bar.so %t/bar.o \ +# RUN: not %lld-mac -arch arm64 -bundle -o %t/bar.so %t/bar.o \ # RUN: -application_extension %t/foo-noappext.dylib \ # RUN: 2>&1 | FileCheck --check-prefix=WARN %s -# RUN: not %lld -arch arm64 -bundle -o %t/bar.so %t/bar.o \ +# RUN: not %lld-mac -arch arm64 -bundle -o %t/bar.so %t/bar.o \ # RUN: -application_extension -L %t -ltbd-noappext \ # RUN: 2>&1 | FileCheck --check-prefix=WARN %s # WARN: using '-application_extension' with unsafe dylib: ## Test we warn on dylibs loaded indirectly via reexports. -# RUN: not %lld -arch arm64 -dylib -o %t/bar.dylib %t/bar.o \ +# RUN: not %lld-mac -arch arm64 -dylib -o %t/bar.dylib %t/bar.o \ # RUN: -application_extension -L %t -lbaz-noappext-reexport \ # RUN: -u _baz 2>&1 | FileCheck --check-prefix=WARN %s Index: lld/test/MachO/arch-multiple.s =================================================================== --- lld/test/MachO/arch-multiple.s +++ lld/test/MachO/arch-multiple.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t.o %s -# RUN: not %lld -o %t.out -arch_multiple %t.o 2>&1 | FileCheck %s +# RUN: not %lld-mac -o %t.out -arch_multiple %t.o 2>&1 | FileCheck %s # CHECK: error: undefined symbol for arch x86_64: _foo Index: lld/test/MachO/arch.s =================================================================== --- lld/test/MachO/arch.s +++ lld/test/MachO/arch.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-darwin %s -o %t.o -# RUN: %lld -o /dev/null %t.o -# RUN: not %lld -arch i386 -o /dev/null %t.o 2>&1 | FileCheck %s +# RUN: %lld-mac -o /dev/null %t.o +# RUN: not %lld-mac -arch i386 -o /dev/null %t.o 2>&1 | FileCheck %s # CHECK: error: missing or unsupported -arch i386 .text Index: lld/test/MachO/archive-symbol-resolution.s =================================================================== --- lld/test/MachO/archive-symbol-resolution.s +++ lld/test/MachO/archive-symbol-resolution.s @@ -5,14 +5,14 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/f2.s -o %t/f2.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/fg.s -o %t/fg.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o -# RUN: %lld -dylib -o %t/libf1.dylib %t/f1.o -lSystem +# RUN: %lld-mac -dylib -o %t/libf1.dylib %t/f1.o -lSystem # RUN: llvm-ar rcs %t/libf2_g.a %t/f2.o %t/g.o # RUN: llvm-ar rcs %t/libfg.a %t/fg.o ## (Strong) dylib symbols and archive symbols have equal precedence. -# RUN: %lld %t/libf1.dylib %t/libf2_g.a %t/test.o -o %t/test.out -lSystem +# RUN: %lld-mac %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 @@ -20,7 +20,7 @@ # DYLIB-FIRST-NEXT: segment section address dylib symbol # DYLIB-FIRST-NEXT: __DATA __la_symbol_ptr {{[0-9a-z]+}} libf1 f -# RUN: %lld %t/libf2_g.a %t/libf1.dylib %t/test.o -o %t/test.out -lSystem +# RUN: %lld-mac %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 @@ -31,7 +31,7 @@ ## Once an archive member is fetched, all the extern symbols in that member ## take precedence over dylib symbols of the same name. -# RUN: %lld %t/libf1.dylib %t/libfg.a %t/test.o -o %t/test.out -lSystem +# RUN: %lld-mac %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 Index: lld/test/MachO/archive.s =================================================================== --- lld/test/MachO/archive.s +++ lld/test/MachO/archive.s @@ -6,7 +6,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/main.s -o %t/main.o # RUN: llvm-ar rcs %t/test.a %t/2.o %t/3.o %t/4.o -# RUN: %lld %t/main.o %t/test.a -o %t/test.out +# RUN: %lld-mac %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 @@ -15,7 +15,7 @@ # CHECK: T _main ## Linking with the archive first in the command line shouldn't change anything -# RUN: %lld %t/test.a %t/main.o -o %t/test.out +# RUN: %lld-mac %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 @@ -25,23 +25,23 @@ # VISIBLE-NOT: T _undefined # VISIBLE-NOT: T _unused -# RUN: %lld %t/test.a %t/main.o -o %t/all-load -noall_load -all_load +# RUN: %lld-mac %t/test.a %t/main.o -o %t/all-load -noall_load -all_load # RUN: llvm-nm %t/all-load | FileCheck %s --check-prefix ALL-LOAD # ALL-LOAD: T _bar # ALL-LOAD: T _boo # ALL-LOAD: T _main # ALL-LOAD: T _unused -# RUN: %lld %t/test.a %t/main.o -o %t/no-all-load -all_load -noall_load +# RUN: %lld-mac %t/test.a %t/main.o -o %t/no-all-load -all_load -noall_load # RUN: llvm-nm %t/no-all-load | FileCheck %s --check-prefix NO-ALL-LOAD -# RUN: %lld %t/test.a %t/main.o -o %t/no-all-load-only -noall_load +# RUN: %lld-mac %t/test.a %t/main.o -o %t/no-all-load-only -noall_load # RUN: llvm-nm %t/no-all-load-only | FileCheck %s --check-prefix NO-ALL-LOAD # NO-ALL-LOAD-NOT: T _unused ## Multiple archives defining the same symbols aren't an issue, due to lazy ## loading # RUN: cp %t/test.a %t/test2.a -# RUN: %lld %t/test.a %t/test2.a %t/main.o -o /dev/null +# RUN: %lld-mac %t/test.a %t/test2.a %t/main.o -o /dev/null #--- 2.s .globl _boo Index: lld/test/MachO/arm64-reloc-got-load.s =================================================================== --- lld/test/MachO/arm64-reloc-got-load.s +++ lld/test/MachO/arm64-reloc-got-load.s @@ -4,11 +4,11 @@ # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/main.s -o %t/main.o # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/foobar.s -o %t/foobar.o -# RUN: %lld -lSystem -arch arm64 -o %t/static %t/main.o %t/foobar.o +# RUN: %lld-mac -lSystem -arch arm64 -o %t/static %t/main.o %t/foobar.o # RUN: llvm-objdump --macho -d --no-show-raw-insn --syms %t/static | FileCheck %s --check-prefix=STATIC -# RUN: %lld -lSystem -arch arm64 -dylib -o %t/libfoo.dylib %t/foobar.o -# RUN: %lld -lSystem -arch arm64 -o %t/main %t/main.o %t/libfoo.dylib +# RUN: %lld-mac -lSystem -arch arm64 -dylib -o %t/libfoo.dylib %t/foobar.o +# RUN: %lld-mac -lSystem -arch arm64 -o %t/main %t/main.o %t/libfoo.dylib # RUN: llvm-objdump --macho -d --no-show-raw-insn --section-headers %t/main | FileCheck %s --check-prefix=DYLIB # STATIC-LABEL: _main: Index: lld/test/MachO/arm64-reloc-pointer-to-got.s =================================================================== --- lld/test/MachO/arm64-reloc-pointer-to-got.s +++ lld/test/MachO/arm64-reloc-pointer-to-got.s @@ -1,7 +1,7 @@ # REQUIRES: aarch64 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t.o -# RUN: %lld -lSystem -arch arm64 -o %t %t.o +# RUN: %lld-mac -lSystem -arch arm64 -o %t %t.o # RUN: llvm-objdump --macho -d --full-contents --section-headers %t | FileCheck %s ## FIXME: Even though we have reserved a GOT slot for _foo due to Index: lld/test/MachO/arm64-reloc-tlv-load.s =================================================================== --- lld/test/MachO/arm64-reloc-tlv-load.s +++ lld/test/MachO/arm64-reloc-tlv-load.s @@ -4,11 +4,11 @@ # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/main.s -o %t/main.o # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/foobar.s -o %t/foobar.o -# RUN: %lld -lSystem -arch arm64 -o %t/static %t/main.o %t/foobar.o +# RUN: %lld-mac -lSystem -arch arm64 -o %t/static %t/main.o %t/foobar.o # RUN: llvm-objdump --macho -d --no-show-raw-insn --syms %t/static | FileCheck %s --check-prefix=STATIC -# RUN: %lld -lSystem -arch arm64 -dylib -o %t/libfoo.dylib %t/foobar.o -# RUN: %lld -lSystem -arch arm64 -o %t/main %t/main.o %t/libfoo.dylib +# RUN: %lld-mac -lSystem -arch arm64 -dylib -o %t/libfoo.dylib %t/foobar.o +# RUN: %lld-mac -lSystem -arch arm64 -o %t/main %t/main.o %t/libfoo.dylib # RUN: llvm-objdump --macho -d --no-show-raw-insn --section-headers %t/main | FileCheck %s --check-prefix=DYLIB # STATIC-LABEL: _main: Index: lld/test/MachO/arm64-relocs.s =================================================================== --- lld/test/MachO/arm64-relocs.s +++ lld/test/MachO/arm64-relocs.s @@ -1,6 +1,6 @@ # REQUIRES: aarch64 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t.o -# RUN: %lld -dylib -arch arm64 -lSystem -o %t %t.o +# RUN: %lld-mac -dylib -arch arm64 -lSystem -o %t %t.o # RUN: llvm-objdump --syms %t > %t.objdump # RUN: llvm-objdump --macho -d --section=__const %t >> %t.objdump # RUN: FileCheck %s < %t.objdump Index: lld/test/MachO/arm64-stubs.s =================================================================== --- lld/test/MachO/arm64-stubs.s +++ lld/test/MachO/arm64-stubs.s @@ -3,9 +3,9 @@ # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/foo.s -o %t/foo.o # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/bar.s -o %t/bar.o # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/test.s -o %t/test.o -# RUN: %lld -arch arm64 -dylib -install_name @executable_path/libfoo.dylib %t/foo.o -o %t/libfoo.dylib -# RUN: %lld -arch arm64 -dylib -install_name @executable_path/libbar.dylib %t/bar.o -o %t/libbar.dylib -# RUN: %lld -arch arm64 -lSystem %t/libfoo.dylib %t/libbar.dylib %t/test.o -o %t/test +# RUN: %lld-mac -arch arm64 -dylib -install_name @executable_path/libfoo.dylib %t/foo.o -o %t/libfoo.dylib +# RUN: %lld-mac -arch arm64 -dylib -install_name @executable_path/libbar.dylib %t/bar.o -o %t/libbar.dylib +# RUN: %lld-mac -arch arm64 -lSystem %t/libfoo.dylib %t/libbar.dylib %t/test.o -o %t/test # RUN: llvm-objdump --macho -d --no-show-raw-insn --section="__TEXT,__stubs" --section="__TEXT,__stub_helper" %t/test | FileCheck %s Index: lld/test/MachO/arm64-thunk-starvation.s =================================================================== --- lld/test/MachO/arm64-thunk-starvation.s +++ lld/test/MachO/arm64-thunk-starvation.s @@ -1,6 +1,6 @@ # REQUIRES: aarch64 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t.o -# RUN: %lld -arch arm64 -lSystem -o %t.out %t.o +# RUN: %lld-mac -arch arm64 -lSystem -o %t.out %t.o ## Regression test for PR51578. Index: lld/test/MachO/arm64-thunk-visibility.s =================================================================== --- lld/test/MachO/arm64-thunk-visibility.s +++ lld/test/MachO/arm64-thunk-visibility.s @@ -10,7 +10,7 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/foo.s -o %t/foo.o # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/bar.s -o %t/bar.o -# RUN: %lld -arch arm64 -lSystem -o %t.out %t/foo.o %t/bar.o +# RUN: %lld-mac -arch arm64 -lSystem -o %t.out %t/foo.o %t/bar.o #--- foo.s Index: lld/test/MachO/arm64-thunks.s =================================================================== --- lld/test/MachO/arm64-thunks.s +++ lld/test/MachO/arm64-thunks.s @@ -12,7 +12,7 @@ # RUN: rm -rf %t; mkdir %t # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t/input.o -# RUN: %lld -arch arm64 -dead_strip -lSystem -o %t/thunk %t/input.o +# RUN: %lld-mac -arch arm64 -dead_strip -lSystem -o %t/thunk %t/input.o # RUN: llvm-objdump -d --no-show-raw-insn %t/thunk | FileCheck %s # CHECK: Disassembly of section __TEXT,__text: Index: lld/test/MachO/bind-opcodes.s =================================================================== --- lld/test/MachO/bind-opcodes.s +++ lld/test/MachO/bind-opcodes.s @@ -2,8 +2,8 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin --defsym PTR64=0 %t/test.s -o %t/test.o -# RUN: %lld -O2 -dylib %t/foo.o -o %t/libfoo.dylib -# RUN: %lld -O2 -lSystem %t/test.o %t/libfoo.dylib -o %t/test-x86_64 +# RUN: %lld-mac -O2 -dylib %t/foo.o -o %t/libfoo.dylib +# RUN: %lld-mac -O2 -lSystem %t/test.o %t/libfoo.dylib -o %t/test-x86_64 ## Test (64-bit): ## 1/ We emit exactly one BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM per symbol. Index: lld/test/MachO/bitcode-bundle.ll =================================================================== --- lld/test/MachO/bitcode-bundle.ll +++ lld/test/MachO/bitcode-bundle.ll @@ -2,7 +2,7 @@ ; RUN: rm -rf %t; split-file %s %t ; RUN: opt -module-summary %t/test.ll -o %t/test.o ; RUN: opt -module-summary %t/foo.ll -o %t/foo.o -; RUN: %lld -lSystem -bitcode_bundle %t/test.o %t/foo.o -o %t/test +; RUN: %lld-mac -lSystem -bitcode_bundle %t/test.o %t/foo.o -o %t/test ; RUN: llvm-objdump --macho --section=__LLVM,__bundle %t/test | FileCheck %s ; RUN: llvm-readobj --macho-segment %t/test | FileCheck %s --check-prefix=SEGMENT Index: lld/test/MachO/bss.s =================================================================== --- lld/test/MachO/bss.s +++ lld/test/MachO/bss.s @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld -o %t %t.o +# RUN: %lld-mac -o %t %t.o # RUN: llvm-readobj --section-headers --macho-segment %t | FileCheck %s ## Check that __bss takes up zero file size, is at file offset zero, and appears Index: lld/test/MachO/builtin-rename.s =================================================================== --- lld/test/MachO/builtin-rename.s +++ lld/test/MachO/builtin-rename.s @@ -7,9 +7,9 @@ # RUN: %t/renames.s -o %t/renames.o ## Check that section and segment renames happen as expected -# RUN: %lld -o %t/ydata %t/main.o %t/renames.o -lSystem -# RUN: %lld -no_data_const -o %t/ndata %t/main.o %t/renames.o -lSystem -# RUN: %lld -no_pie -o %t/nopie %t/main.o %t/renames.o -lSystem +# RUN: %lld-mac -o %t/ydata %t/main.o %t/renames.o -lSystem +# RUN: %lld-mac -no_data_const -o %t/ndata %t/main.o %t/renames.o -lSystem +# RUN: %lld-mac -no_pie -o %t/nopie %t/main.o %t/renames.o -lSystem # RUN: %lld -platform_version macos 10.14 11.0 -o %t/old %t/main.o %t/renames.o -lSystem # RUN: llvm-objdump --syms %t/ydata | \ Index: lld/test/MachO/bundle-loader.s =================================================================== --- lld/test/MachO/bundle-loader.s +++ lld/test/MachO/bundle-loader.s @@ -5,9 +5,9 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/3.s -o %t/3.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/main.s -o %t/main.o -# RUN: %lld -lSystem -dylib -install_name %t/my_lib.dylib -o %t/mylib.dylib %t/2.o -# RUN: %lld -lSystem %t/2.o %t/main.o -o %t/main -# RUN: %lld -lSystem -bundle -bundle_loader %t/main -o %t/bundle.bundle %t/3.o %t/mylib.dylib +# RUN: %lld-mac -lSystem -dylib -install_name %t/my_lib.dylib -o %t/mylib.dylib %t/2.o +# RUN: %lld-mac -lSystem %t/2.o %t/main.o -o %t/main +# RUN: %lld-mac -lSystem -bundle -bundle_loader %t/main -o %t/bundle.bundle %t/3.o %t/mylib.dylib ## Check bundle.bundle to ensure the `my_func` symbol is from executable # RUN: llvm-nm -m %t/bundle.bundle | FileCheck %s --check-prefix BUNDLE # BUNDLE: (undefined) external my_func (from executable) @@ -15,13 +15,13 @@ # BUNDLE-OBJ: segment section address dylib symbol # BUNDLE-OBJ: __DATA __la_symbol_ptr 0x{{[0-9a-f]*}} main-executable my_fun -# RUN: %lld -lSystem -bundle -bundle_loader %t/main -o %t/bundle2.bundle %t/3.o %t/2.o +# RUN: %lld-mac -lSystem -bundle -bundle_loader %t/main -o %t/bundle2.bundle %t/3.o %t/2.o ## Check bundle.bundle to ensure the `my_func` symbol is not from executable # RUN: llvm-nm -m %t/bundle2.bundle | FileCheck %s --check-prefix BUNDLE2 # BUNDLE2: (__TEXT,__text) external my_func # Test that bundle_loader can only be used with MachO bundle output. -# RUN: not %lld -lSystem -bundle_loader %t/main -o %t/bundle3.bundle 2>&1 | FileCheck %s --check-prefix ERROR +# RUN: not %lld-mac -lSystem -bundle_loader %t/main -o %t/bundle3.bundle 2>&1 | FileCheck %s --check-prefix ERROR # ERROR: -bundle_loader can only be used with MachO bundle output #--- 2.s Index: lld/test/MachO/cfstring-dedup.s =================================================================== --- lld/test/MachO/cfstring-dedup.s +++ lld/test/MachO/cfstring-dedup.s @@ -2,7 +2,7 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo1.s -o %t/foo1.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo2.s -o %t/foo2.o -# RUN: %lld -dylib --icf=all -framework CoreFoundation %t/foo1.o %t/foo2.o -o %t/foo +# RUN: %lld-mac -dylib --icf=all -framework CoreFoundation %t/foo1.o %t/foo2.o -o %t/foo # RUN: llvm-objdump --macho --rebase --bind --syms -d %t/foo | FileCheck %s # CHECK: (__TEXT,__text) section Index: lld/test/MachO/cgprofile-icf.s =================================================================== --- lld/test/MachO/cgprofile-icf.s +++ lld/test/MachO/cgprofile-icf.s @@ -2,9 +2,9 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t -# RUN: %lld -e A %t -o %t.out --icf=all +# RUN: %lld-mac -e A %t -o %t.out --icf=all # RUN: llvm-nm --numeric-sort %t.out | FileCheck %s -# RUN: %lld -e A %t -o %t2.out +# RUN: %lld-mac -e A %t -o %t2.out # RUN: llvm-nm --numeric-sort %t2.out | FileCheck %s --check-prefix=NOICF .text Index: lld/test/MachO/cgprofile-obj.s =================================================================== --- lld/test/MachO/cgprofile-obj.s +++ lld/test/MachO/cgprofile-obj.s @@ -1,9 +1,9 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld -lSystem -e A -o %t.out %t.o +# RUN: %lld-mac -lSystem -e A -o %t.out %t.o # RUN: llvm-nm --numeric-sort %t.out | FileCheck %s -# RUN: %lld --no-call-graph-profile-sort -lSystem -e A -o %t.out %t.o +# RUN: %lld-mac --no-call-graph-profile-sort -lSystem -e A -o %t.out %t.o # RUN: llvm-nm --numeric-sort %t.out | FileCheck %s --check-prefix=NO-CG .text Index: lld/test/MachO/cgprofile-orderfile.s =================================================================== --- lld/test/MachO/cgprofile-orderfile.s +++ lld/test/MachO/cgprofile-orderfile.s @@ -3,9 +3,9 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o -# RUN: %lld -e A %t/test.o -order_file %t/order_file -o %t/test +# RUN: %lld-mac -e A %t/test.o -order_file %t/order_file -o %t/test # RUN: llvm-nm --numeric-sort %t/test | FileCheck %s -# RUN: %lld -e A %t/test.o -o %t/test +# RUN: %lld-mac -e A %t/test.o -o %t/test # RUN: llvm-nm --numeric-sort %t/test | FileCheck %s --check-prefix NO-ORDER Index: lld/test/MachO/cgprofile-print.s =================================================================== --- lld/test/MachO/cgprofile-print.s +++ lld/test/MachO/cgprofile-print.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t -# RUN: %lld -e A %t -o %t2 --print-symbol-order=%t3 +# RUN: %lld-mac -e A %t -o %t2 --print-symbol-order=%t3 # RUN: FileCheck %s --input-file %t3 # CHECK: B Index: lld/test/MachO/color-diagnostics.test =================================================================== --- lld/test/MachO/color-diagnostics.test +++ lld/test/MachO/color-diagnostics.test @@ -1,20 +1,20 @@ # Windows command prompt doesn't support ANSI escape sequences. # REQUIRES: shell -# RUN: not %lld --color-diagnostics /nosuchfile 2>&1 \ +# RUN: not %lld-mac --color-diagnostics /nosuchfile 2>&1 \ # RUN: | FileCheck -check-prefix=COLOR %s -# RUN: not %lld --color-diagnostics=always /nosuchfile 2>&1 \ +# RUN: not %lld-mac --color-diagnostics=always /nosuchfile 2>&1 \ # RUN: | FileCheck -check-prefix=COLOR %s # COLOR: {{lld: .\[0;31merror: .\[0mcannot open /nosuchfile}} -# RUN: not %lld --color-diagnostics=foobar 2>&1 | FileCheck -check-prefix=ERR %s +# RUN: not %lld-mac --color-diagnostics=foobar 2>&1 | FileCheck -check-prefix=ERR %s # ERR: unknown option: --color-diagnostics=foobar -# RUN: not %lld /nosuchfile 2>&1 | FileCheck -check-prefix=NOCOLOR %s -# RUN: not %lld --color-diagnostics=never /nosuchfile 2>&1 \ +# RUN: not %lld-mac /nosuchfile 2>&1 | FileCheck -check-prefix=NOCOLOR %s +# RUN: not %lld-mac --color-diagnostics=never /nosuchfile 2>&1 \ # RUN: | FileCheck -check-prefix=NOCOLOR %s -# RUN: not %lld --color-diagnostics=always --no-color-diagnostics \ +# RUN: not %lld-mac --color-diagnostics=always --no-color-diagnostics \ # RUN: /nosuchfile 2>&1 | FileCheck -check-prefix=NOCOLOR %s # NOCOLOR: lld: error: cannot open /nosuchfile Index: lld/test/MachO/common-symbol-coalescing.s =================================================================== --- lld/test/MachO/common-symbol-coalescing.s +++ lld/test/MachO/common-symbol-coalescing.s @@ -9,26 +9,26 @@ ## Check that we pick the definition with the larger size, regardless of ## its alignment. -# RUN: %lld %t/test.o %t/smaller-size.o -order_file %t/order -o %t/test +# RUN: %lld-mac %t/test.o %t/smaller-size.o -order_file %t/order -o %t/test # RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=8 -# RUN: %lld %t/smaller-size.o %t/test.o -order_file %t/order -o %t/test +# RUN: %lld-mac %t/smaller-size.o %t/test.o -order_file %t/order -o %t/test # RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=8 ## When the sizes are equal, we pick the symbol whose file occurs later in the ## command-line argument list. -# RUN: %lld %t/test.o %t/same-size.o -order_file %t/order -o %t/test +# RUN: %lld-mac %t/test.o %t/same-size.o -order_file %t/order -o %t/test # RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=16 -# RUN: %lld %t/same-size.o %t/test.o -order_file %t/order -o %t/test +# RUN: %lld-mac %t/same-size.o %t/test.o -order_file %t/order -o %t/test # RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=8 -# RUN: %lld %t/test.o %t/zero-align.o -order_file %t/order -o %t/test +# RUN: %lld-mac %t/test.o %t/zero-align.o -order_file %t/order -o %t/test # RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=16 -# RUN: %lld %t/zero-align.o %t/test.o -order_file %t/order -o %t/test +# RUN: %lld-mac %t/zero-align.o %t/test.o -order_file %t/order -o %t/test # RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=16 -# RUN: %lld %t/test.o %t/zero-align-round-up.o -order_file %t/order -o %t/test +# RUN: %lld-mac %t/test.o %t/zero-align-round-up.o -order_file %t/order -o %t/test # RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=16 -# RUN: %lld %t/zero-align-round-up.o %t/test.o -order_file %t/order -o %t/test +# RUN: %lld-mac %t/zero-align-round-up.o %t/test.o -order_file %t/order -o %t/test # RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=16 # CHECK-LABEL: Sections: Index: lld/test/MachO/common-symbol-resolution.s =================================================================== --- lld/test/MachO/common-symbol-resolution.s +++ lld/test/MachO/common-symbol-resolution.s @@ -9,7 +9,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/calls-foo.s -o %t/calls-foo.o -# RUN: %lld -lSystem -order_file %t/order -dylib %t/libfoo.o -o %t/libfoo.dylib +# RUN: %lld-mac -lSystem -order_file %t/order -dylib %t/libfoo.o -o %t/libfoo.dylib # RUN: llvm-ar rcs %t/defined.a %t/defined.o # RUN: llvm-ar rcs %t/weak-defined-and-common.a %t/weak-defined.o %t/common.o @@ -20,38 +20,38 @@ ## regardless of whether it is weak. Moreover, the resolved symbol in the output ## file will always be non-weak, even if the winning input symbol definition was ## weak. -# RUN: %lld -lSystem -order_file %t/order %t/common.o %t/weak-common.o %t/test.o -o %t/test +# RUN: %lld-mac -lSystem -order_file %t/order %t/common.o %t/weak-common.o %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=LARGER-COMMON -# RUN: %lld -lSystem -order_file %t/order %t/weak-common.o %t/common.o %t/test.o -o %t/test +# RUN: %lld-mac -lSystem -order_file %t/order %t/weak-common.o %t/common.o %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=LARGER-COMMON ## Defined symbols are the only ones that take precedence over common symbols. -# RUN: %lld -lSystem -order_file %t/order %t/defined.o %t/common.o %t/test.o -o %t/test +# RUN: %lld-mac -lSystem -order_file %t/order %t/defined.o %t/common.o %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=DEFINED -# RUN: %lld -lSystem -order_file %t/order %t/common.o %t/defined.o %t/test.o -o %t/test +# RUN: %lld-mac -lSystem -order_file %t/order %t/common.o %t/defined.o %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=DEFINED -# RUN: %lld -lSystem -order_file %t/order %t/weak-defined.o %t/common.o %t/test.o -o %t/test +# RUN: %lld-mac -lSystem -order_file %t/order %t/weak-defined.o %t/common.o %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=WEAK-DEFINED -# RUN: %lld -lSystem -order_file %t/order %t/common.o %t/weak-defined.o %t/test.o -o %t/test +# RUN: %lld-mac -lSystem -order_file %t/order %t/common.o %t/weak-defined.o %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=WEAK-DEFINED ## Common symbols take precedence over archive symbols. -# RUN: %lld -lSystem -order_file %t/order %t/defined.a %t/weak-common.o %t/test.o -o %t/test +# RUN: %lld-mac -lSystem -order_file %t/order %t/defined.a %t/weak-common.o %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=LARGER-COMMON -# RUN: %lld -lSystem -order_file %t/order %t/weak-common.o %t/defined.a %t/test.o -o %t/test +# RUN: %lld-mac -lSystem -order_file %t/order %t/weak-common.o %t/defined.a %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=LARGER-COMMON ## Defined symbols have the same precedence as common symbols within an archive. -# RUN: %lld -lSystem -order_file %t/order %t/weak-defined-and-common.a %t/calls-foo.o -o %t/calls-foo +# RUN: %lld-mac -lSystem -order_file %t/order %t/weak-defined-and-common.a %t/calls-foo.o -o %t/calls-foo # RUN: llvm-objdump --syms %t/calls-foo | FileCheck %s --check-prefix=WEAK-DEFINED -# RUN: %lld -lSystem -order_file %t/order %t/calls-foo.o %t/common-and-weak-defined.a -o %t/calls-foo +# RUN: %lld-mac -lSystem -order_file %t/order %t/calls-foo.o %t/common-and-weak-defined.a -o %t/calls-foo # RUN: llvm-objdump --syms %t/calls-foo | FileCheck %s --check-prefix=COMMON ## Common symbols take precedence over dylib symbols. -# RUN: %lld -lSystem -order_file %t/order %t/libfoo.dylib %t/weak-common.o %t/test.o -o %t/test +# RUN: %lld-mac -lSystem -order_file %t/order %t/libfoo.dylib %t/weak-common.o %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=LARGER-COMMON -# RUN: %lld -lSystem -order_file %t/order %t/weak-common.o %t/libfoo.dylib %t/test.o -o %t/test +# RUN: %lld-mac -lSystem -order_file %t/order %t/weak-common.o %t/libfoo.dylib %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=LARGER-COMMON # LARGER-COMMON-DAG: [[#%x, FOO_ADDR:]] g O __DATA,__common _foo Index: lld/test/MachO/compact-unwind-both-local-and-dylib-personality.s =================================================================== --- lld/test/MachO/compact-unwind-both-local-and-dylib-personality.s +++ lld/test/MachO/compact-unwind-both-local-and-dylib-personality.s @@ -15,11 +15,11 @@ ## check that we can link with 4 personalities without crashing: ## ___gxx_personality_v0 (libc++.tbd), ___gxx_personality_v0(local), _personality_1, and _personality_2 -# RUN: %lld -lSystem -lc++ %t/user_2.o %t/combined.o -o %t/a.out +# RUN: %lld-mac -lSystem -lc++ %t/user_2.o %t/combined.o -o %t/a.out ## ___gxx_personality_v0 (global), ___gxx_personality_v0(libc++.tbd), _personality_1, and _personality_2 -# RUN: %lld -lSystem -lc++ %t/user_3.o %t/user_2.o -o %t/b.out +# RUN: %lld-mac -lSystem -lc++ %t/user_3.o %t/user_2.o -o %t/b.out ## ___gxx_personality_v0 (global), ___gxx_personality_v0(local), _personality_1, and _personality_2 -# RUN: %lld -lSystem -dylib %t/user_3.o %t/combined.o %t/user_2.o -o %t/c.out +# RUN: %lld-mac -lSystem -dylib %t/user_3.o %t/combined.o %t/user_2.o -o %t/c.out ## Postlink checks. # RUN: llvm-nm %t/a.out | FileCheck %s --check-prefix=POSTCHECK @@ -55,7 +55,7 @@ ## Error cases. ## Check that dylib symbols are picked (which means without libc++, we'd get an undefined symbol error. -# RUN: not %lld -lSystem %t/user_2.o %t/combined.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERRORCHECK +# RUN: not %lld-mac -lSystem %t/user_2.o %t/combined.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERRORCHECK # ERRORCHECK: {{.*}} undefined symbol: ___gxx_personality_v0 #--- user_3.s Index: lld/test/MachO/compact-unwind-generated.test =================================================================== --- lld/test/MachO/compact-unwind-generated.test +++ lld/test/MachO/compact-unwind-generated.test @@ -16,6 +16,6 @@ # RUN: %python %S/tools/generate-cfi-funcs.py --seed=johnnyapple >%t.s # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 -o %t.o %t.s -# RUN: %lld -Z -L%S/Inputs/MacOSX.sdk/usr/lib -lSystem -o %t %t.o +# RUN: %lld-mac -Z -L%S/Inputs/MacOSX.sdk/usr/lib -lSystem -o %t %t.o # RUN: llvm-objdump --unwind-info --syms %t %t.o >%t.dump # RUN: %python %S/tools/validate-unwind-info.py %t.dump Index: lld/test/MachO/compact-unwind-stack-ind.s =================================================================== --- lld/test/MachO/compact-unwind-stack-ind.s +++ lld/test/MachO/compact-unwind-stack-ind.s @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %s -o %t.o -# RUN: %lld -arch x86_64 -dylib %t.o -o %t.dylib +# RUN: %lld-mac -arch x86_64 -dylib %t.o -o %t.dylib # RUN: llvm-objdump --macho --syms --unwind-info %t.dylib | FileCheck %s ## Both _f and _g have the same compact unwind encoding, Index: lld/test/MachO/compact-unwind-sym-relocs.s =================================================================== --- lld/test/MachO/compact-unwind-sym-relocs.s +++ lld/test/MachO/compact-unwind-sym-relocs.s @@ -28,7 +28,7 @@ # RUN: rm -rf %t; mkdir -p %t # RUN: yaml2obj %s -o %t/foo.o -# RUN: %lld -dylib -lc++ %t/foo.o -o %t/foo +# RUN: %lld-mac -dylib -lc++ %t/foo.o -o %t/foo # RUN: llvm-objdump --macho --syms --unwind-info %t/foo | FileCheck %s # CHECK: SYMBOL TABLE: Index: lld/test/MachO/compact-unwind.s =================================================================== --- lld/test/MachO/compact-unwind.s +++ lld/test/MachO/compact-unwind.s @@ -2,16 +2,16 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/my-personality.s -o %t/x86_64-my-personality.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/main.s -o %t/x86_64-main.o -# RUN: %lld -arch x86_64 -lSystem -lc++ %t/x86_64-my-personality.o %t/x86_64-main.o -o %t/x86_64-personality-first +# RUN: %lld-mac -arch x86_64 -lSystem -lc++ %t/x86_64-my-personality.o %t/x86_64-main.o -o %t/x86_64-personality-first # RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --rebase %t/x86_64-personality-first | FileCheck %s --check-prefixes=FIRST,CHECK -D#%x,BASE=0x100000000 -DSEG=__TEXT -# RUN: %lld -dead_strip -arch x86_64 -lSystem -lc++ %t/x86_64-main.o %t/x86_64-my-personality.o -o %t/x86_64-personality-second +# RUN: %lld-mac -dead_strip -arch x86_64 -lSystem -lc++ %t/x86_64-main.o %t/x86_64-my-personality.o -o %t/x86_64-personality-second # RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --rebase %t/x86_64-personality-second | FileCheck %s --check-prefixes=SECOND,CHECK -D#%x,BASE=0x100000000 -DSEG=__TEXT # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin19.0.0 %t/my-personality.s -o %t/arm64-my-personality.o # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin19.0.0 %t/main.s -o %t/arm64-main.o -# RUN: %lld -arch arm64 -lSystem -lc++ %t/arm64-my-personality.o %t/arm64-main.o -o %t/arm64-personality-first +# RUN: %lld-mac -arch arm64 -lSystem -lc++ %t/arm64-my-personality.o %t/arm64-main.o -o %t/arm64-personality-first # RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --rebase %t/arm64-personality-first | FileCheck %s --check-prefixes=FIRST,CHECK -D#%x,BASE=0x100000000 -DSEG=__TEXT -# RUN: %lld -dead_strip -arch arm64 -lSystem -lc++ %t/arm64-main.o %t/arm64-my-personality.o -o %t/arm64-personality-second +# RUN: %lld-mac -dead_strip -arch arm64 -lSystem -lc++ %t/arm64-main.o %t/arm64-my-personality.o -o %t/arm64-personality-second # RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --rebase %t/arm64-personality-second | FileCheck %s --check-prefixes=SECOND,CHECK -D#%x,BASE=0x100000000 -DSEG=__TEXT # RUN: llvm-mc -filetype=obj -triple=arm64_32-apple-watchos %t/my-personality.s -o %t/arm64-32-my-personality.o @@ -21,9 +21,9 @@ # RUN: %lld-watchos -dead_strip -lSystem -lc++ %t/arm64-32-main.o %t/arm64-32-my-personality.o -o %t/arm64-32-personality-second # RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --rebase %t/arm64-32-personality-second | FileCheck %s --check-prefixes=SECOND,CHECK -D#%x,BASE=0x4000 -DSEG=__TEXT -# RUN: %lld -arch x86_64 -rename_section __TEXT __gcc_except_tab __RODATA __gcc_except_tab -lSystem -lc++ %t/x86_64-my-personality.o %t/x86_64-main.o -o %t/x86_64-personality-first +# RUN: %lld-mac -arch x86_64 -rename_section __TEXT __gcc_except_tab __RODATA __gcc_except_tab -lSystem -lc++ %t/x86_64-my-personality.o %t/x86_64-main.o -o %t/x86_64-personality-first # RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --rebase %t/x86_64-personality-first | FileCheck %s --check-prefixes=FIRST,CHECK -D#%x,BASE=0x100000000 -DSEG=__RODATA -# RUN: %lld -dead_strip -arch x86_64 -rename_section __TEXT __gcc_except_tab __RODATA __gcc_except_tab -lSystem -lc++ %t/x86_64-main.o %t/x86_64-my-personality.o -o %t/x86_64-personality-second +# RUN: %lld-mac -dead_strip -arch x86_64 -rename_section __TEXT __gcc_except_tab __RODATA __gcc_except_tab -lSystem -lc++ %t/x86_64-main.o %t/x86_64-my-personality.o -o %t/x86_64-personality-second # RUN: llvm-objdump --macho --unwind-info --syms --indirect-symbols --rebase %t/x86_64-personality-second | FileCheck %s --check-prefixes=SECOND,CHECK -D#%x,BASE=0x100000000 -DSEG=__RODATA # FIRST: Indirect symbols for (__DATA_CONST,__got) @@ -71,7 +71,7 @@ ## remains after dead-stripping. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 \ # RUN: %t/empty-after-dead-strip.s -o %t/x86_64-empty-after-dead-strip.o -# RUN: %lld -dylib -dead_strip -arch x86_64 -lSystem \ +# RUN: %lld-mac -dylib -dead_strip -arch x86_64 -lSystem \ # RUN: %t/x86_64-empty-after-dead-strip.o -o %t/x86_64-empty-after-strip.dylib # RUN: llvm-objdump --macho --unwind-info %t/x86_64-empty-after-strip.dylib | \ # RUN: FileCheck %s --check-prefixes=NOUNWIND --allow-empty Index: lld/test/MachO/cstring-align.s =================================================================== --- lld/test/MachO/cstring-align.s +++ lld/test/MachO/cstring-align.s @@ -16,24 +16,24 @@ ## get dedup'ed, meaning that the output strings get their offsets "naturally" ## preserved. -# RUN: %lld -dylib %t/align-empty.o %t/align-4-0.o %t/align-16-0.o -o %t/align-4-0-16-0 +# RUN: %lld-mac -dylib %t/align-empty.o %t/align-4-0.o %t/align-16-0.o -o %t/align-4-0-16-0 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/align-4-0-16-0 | \ # RUN: FileCheck %s -D#OFF1=4 -D#OFF2=16 -# RUN: %lld -dylib %t/align-empty.o %t/align-16-0.o %t/align-4-0.o -o %t/align-16-0-4-0 +# RUN: %lld-mac -dylib %t/align-empty.o %t/align-16-0.o %t/align-4-0.o -o %t/align-16-0-4-0 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/align-16-0-4-0 | \ # RUN: FileCheck %s -D#OFF1=16 -D#OFF2=20 -# RUN: %lld -dylib %t/align-empty.o %t/align-4-2.o %t/align-16-0.o -o %t/align-4-2-16-0 +# RUN: %lld-mac -dylib %t/align-empty.o %t/align-4-2.o %t/align-16-0.o -o %t/align-4-2-16-0 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/align-4-2-16-0 | \ # RUN: FileCheck %s -D#OFF1=6 -D#OFF2=16 -# RUN: %lld -dylib %t/align-empty.o %t/align-16-0.o %t/align-4-2.o -o %t/align-16-0-4-2 +# RUN: %lld-mac -dylib %t/align-empty.o %t/align-16-0.o %t/align-4-2.o -o %t/align-16-0-4-2 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/align-16-0-4-2 | \ # RUN: FileCheck %s -D#OFF1=16 -D#OFF2=22 -# RUN: %lld -dylib %t/align-empty.o %t/align-4-0.o %t/align-16-2.o -o %t/align-4-0-16-2 +# RUN: %lld-mac -dylib %t/align-empty.o %t/align-4-0.o %t/align-16-2.o -o %t/align-4-0-16-2 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/align-4-0-16-2 | \ # RUN: FileCheck %s -D#OFF1=4 -D#OFF2=18 -# RUN: %lld -dylib %t/align-empty.o %t/align-16-2.o %t/align-4-0.o -o %t/align-16-2-4-0 +# RUN: %lld-mac -dylib %t/align-empty.o %t/align-16-2.o %t/align-4-0.o -o %t/align-16-2-4-0 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/align-16-2-4-0 | \ # RUN: FileCheck %s -D#OFF1=18 -D#OFF2=20 @@ -46,42 +46,42 @@ ## The dedup cases are more interesting... ## Same offset, different alignments => pick higher alignment -# RUN: %lld -dylib --deduplicate-literals %t/align-empty.o %t/align-4-0.o %t/align-16-0.o -o %t/dedup-4-0-16-0 +# RUN: %lld-mac -dylib --deduplicate-literals %t/align-empty.o %t/align-4-0.o %t/align-16-0.o -o %t/dedup-4-0-16-0 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/dedup-4-0-16-0 | \ # RUN: FileCheck %s --check-prefix=DEDUP -D#OFF=16 -# RUN: %lld -dylib --deduplicate-literals %t/align-empty.o %t/align-16-0.o %t/align-4-0.o -o %t/dedup-16-0-4-0 +# RUN: %lld-mac -dylib --deduplicate-literals %t/align-empty.o %t/align-16-0.o %t/align-4-0.o -o %t/dedup-16-0-4-0 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/dedup-16-0-4-0 | \ # RUN: FileCheck %s --check-prefix=DEDUP -D#OFF=16 ## 16 byte alignment vs 2 byte offset => align to 16 bytes -# RUN: %lld -dylib --deduplicate-literals %t/align-empty.o %t/align-4-2.o %t/align-16-0.o -o %t/dedup-4-2-16-0 +# RUN: %lld-mac -dylib --deduplicate-literals %t/align-empty.o %t/align-4-2.o %t/align-16-0.o -o %t/dedup-4-2-16-0 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/dedup-4-2-16-0 | \ # RUN: FileCheck %s --check-prefix=DEDUP -D#OFF=16 -# RUN: %lld -dylib --deduplicate-literals %t/align-empty.o %t/align-16-0.o %t/align-4-2.o -o %t/dedup-16-0-4-2 +# RUN: %lld-mac -dylib --deduplicate-literals %t/align-empty.o %t/align-16-0.o %t/align-4-2.o -o %t/dedup-16-0-4-2 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/dedup-16-0-4-2 | \ # RUN: FileCheck %s --check-prefix=DEDUP -D#OFF=16 ## 4 byte alignment vs 2 byte offset => align to 4 bytes -# RUN: %lld -dylib --deduplicate-literals %t/align-empty.o %t/align-4-0.o %t/align-16-2.o -o %t/dedup-4-0-16-2 +# RUN: %lld-mac -dylib --deduplicate-literals %t/align-empty.o %t/align-4-0.o %t/align-16-2.o -o %t/dedup-4-0-16-2 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/dedup-4-0-16-2 | \ # RUN: FileCheck %s --check-prefix=DEDUP -D#OFF=4 -# RUN: %lld -dylib --deduplicate-literals %t/align-empty.o %t/align-16-2.o %t/align-4-0.o -o %t/dedup-16-2-4-0 +# RUN: %lld-mac -dylib --deduplicate-literals %t/align-empty.o %t/align-16-2.o %t/align-4-0.o -o %t/dedup-16-2-4-0 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/dedup-16-2-4-0 | \ # RUN: FileCheck %s --check-prefix=DEDUP -D#OFF=4 ## Both inputs are 4-byte aligned, one via offset and the other via section alignment -# RUN: %lld -dylib --deduplicate-literals %t/align-empty.o %t/align-4-0.o %t/align-16-4.o -o %t/dedup-4-0-16-4 +# RUN: %lld-mac -dylib --deduplicate-literals %t/align-empty.o %t/align-4-0.o %t/align-16-4.o -o %t/dedup-4-0-16-4 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/dedup-4-0-16-4 | \ # RUN: FileCheck %s --check-prefix=DEDUP -D#OFF=4 -# RUN: %lld -dylib --deduplicate-literals %t/align-empty.o %t/align-16-4.o %t/align-4-0.o -o %t/dedup-16-4-4-0 +# RUN: %lld-mac -dylib --deduplicate-literals %t/align-empty.o %t/align-16-4.o %t/align-4-0.o -o %t/dedup-16-4-4-0 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/dedup-16-4-4-0 | \ # RUN: FileCheck %s --check-prefix=DEDUP -D#OFF=4 ## 8-byte offset vs 4-byte section alignment => align to 8 bytes -# RUN: %lld -dylib --deduplicate-literals %t/align-empty.o %t/align-4-0.o %t/align-16-8.o -o %t/dedup-4-0-16-8 +# RUN: %lld-mac -dylib --deduplicate-literals %t/align-empty.o %t/align-4-0.o %t/align-16-8.o -o %t/dedup-4-0-16-8 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/dedup-4-0-16-8 | \ # RUN: FileCheck %s --check-prefix=DEDUP -D#OFF=8 -# RUN: %lld -dylib --deduplicate-literals %t/align-empty.o %t/align-16-8.o %t/align-4-0.o -o %t/dedup-16-8-4-0 +# RUN: %lld-mac -dylib --deduplicate-literals %t/align-empty.o %t/align-16-8.o %t/align-4-0.o -o %t/dedup-16-8-4-0 # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/dedup-16-8-4-0 | \ # RUN: FileCheck %s --check-prefix=DEDUP -D#OFF=8 Index: lld/test/MachO/cstring-dedup.s =================================================================== --- lld/test/MachO/cstring-dedup.s +++ lld/test/MachO/cstring-dedup.s @@ -2,7 +2,7 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/more-foo.s -o %t/more-foo.o -# RUN: %lld -dylib --deduplicate-literals %t/test.o %t/more-foo.o -o %t/test +# RUN: %lld-mac -dylib --deduplicate-literals %t/test.o %t/more-foo.o -o %t/test # RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/test | \ # RUN: FileCheck %s --check-prefix=STR --implicit-check-not foo --implicit-check-not bar # RUN: llvm-objdump --macho --section="__DATA,ptrs" --syms %t/test | FileCheck %s Index: lld/test/MachO/data-in-code.s =================================================================== --- lld/test/MachO/data-in-code.s +++ lld/test/MachO/data-in-code.s @@ -4,7 +4,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/bar.s -o %t/bar.o -# RUN: %lld -lSystem %t/foo.o %t/bar.o -o %t/main.exe +# RUN: %lld-mac -lSystem %t/foo.o %t/bar.o -o %t/main.exe # RUN: llvm-otool -l %t/main.exe > %t/objdump # RUN: llvm-objdump --macho --data-in-code %t/main.exe >> %t/objdump # RUN: FileCheck %s < %t/objdump @@ -25,12 +25,12 @@ # CHECK-NEXT: [[#%x,TEXT + 28]] 24 JUMP_TABLE32 # CHECK-NEXT: [[#%x,TEXT + 68]] 12 JUMP_TABLE32 -# RUN: %lld -lSystem %t/foo.o %t/bar.o -no_data_in_code_info -o %t/main.exe +# RUN: %lld-mac -lSystem %t/foo.o %t/bar.o -no_data_in_code_info -o %t/main.exe # RUN: llvm-otool -l %t/main.exe | FileCheck --check-prefix=OMIT %s # OMIT-NOT: LC_DATA_IN_CODE -# RUN: %lld -lSystem %t/foo.o %t/bar.o -no_data_in_code_info -data_in_code_info -o %t/main.exe +# RUN: %lld-mac -lSystem %t/foo.o %t/bar.o -no_data_in_code_info -data_in_code_info -o %t/main.exe # RUN: llvm-otool -l %t/main.exe > %t/objdump # RUN: llvm-objdump --macho --data-in-code %t/main.exe >> %t/objdump # RUN: FileCheck %s < %t/objdump Index: lld/test/MachO/dead-strip-align.s =================================================================== --- lld/test/MachO/dead-strip-align.s +++ lld/test/MachO/dead-strip-align.s @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld -lSystem -o %t.out %t.o -dead_strip +# RUN: %lld-mac -lSystem -o %t.out %t.o -dead_strip # RUN: llvm-otool -l %t.out | FileCheck --check-prefix=SECT %s # RUN: llvm-otool -vs __TEXT __cstring %t.out | FileCheck %s Index: lld/test/MachO/dead-strip-dylibs.s =================================================================== --- lld/test/MachO/dead-strip-dylibs.s +++ lld/test/MachO/dead-strip-dylibs.s @@ -3,21 +3,21 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc %t/bar.s -triple=x86_64-apple-macos -filetype=obj -o %t/bar.o -# RUN: %lld -dylib %t/bar.o -o %t/bar.dylib -# RUN: %lld -dylib %t/bar.o -o %t/libbar.dylib -# RUN: %lld -dylib -mark_dead_strippable_dylib %t/bar.o -o %t/bar-strip.dylib +# RUN: %lld-mac -dylib %t/bar.o -o %t/bar.dylib +# RUN: %lld-mac -dylib %t/bar.o -o %t/libbar.dylib +# RUN: %lld-mac -dylib -mark_dead_strippable_dylib %t/bar.o -o %t/bar-strip.dylib # RUN: llvm-mc %t/foo.s -triple=x86_64-apple-macos -filetype=obj -o %t/foo.o -# RUN: %lld -dylib %t/foo.o -o %t/foo_with_bar.dylib %t/bar.dylib -sub_library bar -# RUN: %lld -dylib %t/foo.o -o %t/foo.dylib +# RUN: %lld-mac -dylib %t/foo.o -o %t/foo_with_bar.dylib %t/bar.dylib -sub_library bar +# RUN: %lld-mac -dylib %t/foo.o -o %t/foo.dylib # RUN: llvm-mc %t/weak-foo.s -triple=x86_64-apple-macos -filetype=obj -o %t/weak-foo.o -# RUN: %lld -dylib %t/weak-foo.o -o %t/weak-foo.dylib +# RUN: %lld-mac -dylib %t/weak-foo.o -o %t/weak-foo.dylib # RUN: llvm-mc %t/main.s -triple=x86_64-apple-macos -filetype=obj -o %t/main.o ## foo_with_bar.dylib's reexport should be dropped since it's linked implicitly. -# RUN: %lld -lSystem %t/main.o -o %t/main %t/foo_with_bar.dylib +# RUN: %lld-mac -lSystem %t/main.o -o %t/main %t/foo_with_bar.dylib # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOBAR %s # NOBAR-NOT: bar.dylib # NOBAR: /usr/lib/libSystem.dylib @@ -26,19 +26,19 @@ # NOBAR-NOT: bar.dylib ## If bar.dylib is linked explicitly, it should not be dropped. -# RUN: %lld -lSystem %t/main.o -o %t/main %t/foo_with_bar.dylib %t/bar.dylib +# RUN: %lld-mac -lSystem %t/main.o -o %t/main %t/foo_with_bar.dylib %t/bar.dylib # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=BAR %s # BAR: /usr/lib/libSystem.dylib # BAR: foo_with_bar.dylib # BAR: bar.dylib ## ...except if -dead-strip_dylibs is passed... -# RUN: %lld -lSystem %t/main.o -o %t/main %t/foo_with_bar.dylib %t/bar.dylib \ +# RUN: %lld-mac -lSystem %t/main.o -o %t/main %t/foo_with_bar.dylib %t/bar.dylib \ # RUN: -dead_strip_dylibs # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOBAR %s ## ...or bar is explicitly marked dead-strippable. -# RUN: %lld -lSystem %t/main.o -o %t/main %t/foo.dylib %t/bar-strip.dylib +# RUN: %lld-mac -lSystem %t/main.o -o %t/main %t/foo.dylib %t/bar-strip.dylib # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOBARSTRIP %s # NOBARSTRIP-NOT: bar-strip.dylib # NOBARSTRIP: /usr/lib/libSystem.dylib @@ -48,23 +48,23 @@ ## Even libraries explicitly reexported with -reexport_library are stripped ## if they are not referenced. -# RUN: %lld -lSystem %t/main.o -o %t/main %t/foo_with_bar.dylib \ +# RUN: %lld-mac -lSystem %t/main.o -o %t/main %t/foo_with_bar.dylib \ # RUN: -reexport_library %t/bar.dylib -dead_strip_dylibs # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOBAR %s # RUN: llvm-otool -l %t/main | FileCheck --check-prefix=NOREEXPORT %s # NOREEXPORT-NOT: LC_REEXPORT_DYLIB ## But -needed_library and -needed-l win over -dead_strip_dylibs again. -# RUN: %lld -lSystem %t/main.o -o %t/main %t/foo_with_bar.dylib \ +# RUN: %lld-mac -lSystem %t/main.o -o %t/main %t/foo_with_bar.dylib \ # RUN: -needed_library %t/bar.dylib -dead_strip_dylibs # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=BAR %s -# RUN: %lld -lSystem %t/main.o -o %t/main %t/foo_with_bar.dylib \ +# RUN: %lld-mac -lSystem %t/main.o -o %t/main %t/foo_with_bar.dylib \ # RUN: -L%t -needed-lbar -dead_strip_dylibs # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=BAR %s ## LC_LINKER_OPTION does not count as an explicit reference. # RUN: llvm-mc %t/linkopt_bar.s -triple=x86_64-apple-macos -filetype=obj -o %t/linkopt_bar.o -# RUN: %lld -lSystem %t/main.o %t/linkopt_bar.o -o %t/main -L %t %t/foo.dylib +# RUN: %lld-mac -lSystem %t/main.o %t/linkopt_bar.o -o %t/main -L %t %t/foo.dylib # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOLIBBAR %s # NOLIBBAR-NOT: libbar.dylib # NOLIBBAR: /usr/lib/libSystem.dylib @@ -73,9 +73,9 @@ # NOLIBBAR-NOT: libbar.dylib ## ...but with an additional explicit reference it's not stripped again. -# RUN: %lld -lSystem %t/main.o %t/linkopt_bar.o -o %t/main -L %t %t/foo.dylib -lbar +# RUN: %lld-mac -lSystem %t/main.o %t/linkopt_bar.o -o %t/main -L %t %t/foo.dylib -lbar # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=LIBBAR %s -# RUN: %lld -lSystem %t/main.o -o %t/main -L %t %t/foo.dylib -lbar %t/linkopt_bar.o +# RUN: %lld-mac -lSystem %t/main.o -o %t/main -L %t %t/foo.dylib -lbar %t/linkopt_bar.o # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=LIBBAR %s # LIBBAR-DAG: /usr/lib/libSystem.dylib # LIBBAR-DAG: libbar.dylib @@ -89,31 +89,31 @@ ## In practice, every executable uses dynamic linking, which uses ## dyld_stub_binder, which keeps libSystem alive.) ## Test all permutations of (Undefined, Defined, DylibSymbol). -# RUN: %lld -lSystem -dead_strip_dylibs %t/main.o %t/foo.o %t/foo.dylib -o %t/main +# RUN: %lld-mac -lSystem -dead_strip_dylibs %t/main.o %t/foo.o %t/foo.dylib -o %t/main # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOFOO %s -# RUN: %lld -lSystem -dead_strip_dylibs %t/main.o %t/foo.dylib %t/foo.dylib %t/foo.o -o %t/main +# RUN: %lld-mac -lSystem -dead_strip_dylibs %t/main.o %t/foo.dylib %t/foo.dylib %t/foo.o -o %t/main # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOFOO %s -# RUN: %lld -lSystem -dead_strip_dylibs %t/foo.o %t/main.o %t/foo.dylib -o %t/main +# RUN: %lld-mac -lSystem -dead_strip_dylibs %t/foo.o %t/main.o %t/foo.dylib -o %t/main # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOFOO %s -# RUN: %lld -lSystem -dead_strip_dylibs %t/foo.dylib %t/foo.dylib %t/main.o %t/foo.o -o %t/main +# RUN: %lld-mac -lSystem -dead_strip_dylibs %t/foo.dylib %t/foo.dylib %t/main.o %t/foo.o -o %t/main # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOFOO %s -# RUN: %lld -lSystem -dead_strip_dylibs %t/foo.o %t/foo.dylib %t/main.o -o %t/main +# RUN: %lld-mac -lSystem -dead_strip_dylibs %t/foo.o %t/foo.dylib %t/main.o -o %t/main # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOFOO %s -# RUN: %lld -lSystem -dead_strip_dylibs %t/foo.dylib %t/foo.dylib %t/foo.o %t/main.o -o %t/main +# RUN: %lld-mac -lSystem -dead_strip_dylibs %t/foo.dylib %t/foo.dylib %t/foo.o %t/main.o -o %t/main # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOFOO %s # NOFOO-NOT: foo.dylib ## When linking a weak and a strong symbol from two dylibs, we should keep the ## strong one. -# RUN: %lld -lSystem -dead_strip_dylibs %t/main.o %t/foo.dylib %t/weak-foo.dylib -o %t/main +# RUN: %lld-mac -lSystem -dead_strip_dylibs %t/main.o %t/foo.dylib %t/weak-foo.dylib -o %t/main # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOWEAK %s -# RUN: %lld -lSystem -dead_strip_dylibs %t/main.o %t/weak-foo.dylib %t/foo.dylib -o %t/main +# RUN: %lld-mac -lSystem -dead_strip_dylibs %t/main.o %t/weak-foo.dylib %t/foo.dylib -o %t/main # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOWEAK %s -# RUN: %lld -lSystem -dead_strip_dylibs %t/foo.dylib %t/weak-foo.dylib %t/main.o -o %t/main +# RUN: %lld-mac -lSystem -dead_strip_dylibs %t/foo.dylib %t/weak-foo.dylib %t/main.o -o %t/main # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOWEAK %s -# RUN: %lld -lSystem -dead_strip_dylibs %t/weak-foo.dylib %t/foo.dylib %t/main.o -o %t/main +# RUN: %lld-mac -lSystem -dead_strip_dylibs %t/weak-foo.dylib %t/foo.dylib %t/main.o -o %t/main # RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOWEAK %s # NOWEAK-NOT: weak-foo.dylib # NOWEAK: /foo.dylib Index: lld/test/MachO/dead-strip.s =================================================================== --- lld/test/MachO/dead-strip.s +++ lld/test/MachO/dead-strip.s @@ -7,7 +7,7 @@ ## Check that .private_extern symbols are marked as local in the symbol table ## and aren't in the export trie. -# RUN: %lld -lSystem -dead_strip -map %t/map -u _ref_private_extern_u \ +# RUN: %lld-mac -lSystem -dead_strip -map %t/map -u _ref_private_extern_u \ # RUN: %t/basics.o -o %t/basics # RUN: llvm-objdump --syms --section-headers %t/basics | \ # RUN: FileCheck --check-prefix=EXEC --implicit-check-not _unref %s @@ -58,7 +58,7 @@ ## Run dead stripping on code without any dead symbols. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos \ # RUN: %t/no-dead-symbols.s -o %t/no-dead-symbols.o -# RUN: %lld -lSystem -dead_strip -map %t/no-dead-symbols-map \ +# RUN: %lld-mac -lSystem -dead_strip -map %t/no-dead-symbols-map \ # RUN: %t/no-dead-symbols.o -o %t/no-dead-symbols ## Mark the end of the file with a string. # RUN: FileCheck --check-prefix=NODEADSYMBOLS %s < %t/no-dead-symbols-map @@ -70,10 +70,10 @@ # NODEADSYMBOLS-NEXT: # Address File Name # NODEADSYMBOLS-EMPTY: -# RUN: %lld -dylib -dead_strip -u _ref_private_extern_u %t/basics.o -o %t/basics.dylib +# RUN: %lld-mac -dylib -dead_strip -u _ref_private_extern_u %t/basics.o -o %t/basics.dylib # RUN: llvm-objdump --syms %t/basics.dylib | \ # RUN: FileCheck --check-prefix=DYLIB --implicit-check-not _unref %s -# RUN: %lld -bundle -dead_strip -u _ref_private_extern_u %t/basics.o -o %t/basics.dylib +# RUN: %lld-mac -bundle -dead_strip -u _ref_private_extern_u %t/basics.o -o %t/basics.dylib # RUN: llvm-objdump --syms %t/basics.dylib | \ # RUN: FileCheck --check-prefix=DYLIB --implicit-check-not _unref %s # DYLIB-LABEL: SYMBOL TABLE: @@ -90,7 +90,7 @@ # DYLIB-DAG: g {{.*}} _no_dead_strip_globl ## Extern symbols aren't stripped from executables with -export_dynamic -# RUN: %lld -lSystem -dead_strip -export_dynamic -u _ref_private_extern_u \ +# RUN: %lld-mac -lSystem -dead_strip -export_dynamic -u _ref_private_extern_u \ # RUN: %t/basics.o -o %t/basics-export-dyn # RUN: llvm-objdump --syms --section-headers %t/basics-export-dyn | \ # RUN: FileCheck --check-prefix=EXECDYN %s @@ -118,7 +118,7 @@ ## Absolute symbol handling. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos \ # RUN: %t/abs.s -o %t/abs.o -# RUN: %lld -lSystem -dead_strip %t/abs.o -o %t/abs +# RUN: %lld-mac -lSystem -dead_strip %t/abs.o -o %t/abs # RUN: llvm-objdump --macho --syms --exports-trie %t/abs | \ # RUN: FileCheck --check-prefix=ABS %s #ABS-LABEL: SYMBOL TABLE: @@ -133,7 +133,7 @@ ## Check that symbols from -exported_symbol(s_list) are preserved. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos \ # RUN: %t/exported-symbol.s -o %t/exported-symbol.o -# RUN: %lld -lSystem -dead_strip -exported_symbol _my_exported_symbol \ +# RUN: %lld-mac -lSystem -dead_strip -exported_symbol _my_exported_symbol \ # RUN: %t/exported-symbol.o -o %t/exported-symbol # RUN: llvm-objdump --syms %t/exported-symbol | \ # RUN: FileCheck --check-prefix=EXPORTEDSYMBOL --implicit-check-not _unref %s @@ -145,7 +145,7 @@ ## Check that mod_init_funcs and mod_term_funcs are not stripped. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos \ # RUN: %t/mod-funcs.s -o %t/mod-funcs.o -# RUN: %lld -lSystem -dead_strip %t/mod-funcs.o -o %t/mod-funcs +# RUN: %lld-mac -lSystem -dead_strip %t/mod-funcs.o -o %t/mod-funcs # RUN: llvm-objdump --syms %t/mod-funcs | \ # RUN: FileCheck --check-prefix=MODFUNCS --implicit-check-not _unref %s # MODFUNCS-LABEL: SYMBOL TABLE: @@ -160,10 +160,10 @@ ## not be in the import table and should have no import stubs. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos \ # RUN: %t/dylib.s -o %t/dylib.o -# RUN: %lld -dylib -dead_strip %t/dylib.o -o %t/dylib.dylib +# RUN: %lld-mac -dylib -dead_strip %t/dylib.o -o %t/dylib.dylib # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos \ # RUN: %t/strip-dylib-ref.s -o %t/strip-dylib-ref.o -# RUN: %lld -lSystem -dead_strip %t/strip-dylib-ref.o %t/dylib.dylib \ +# RUN: %lld-mac -lSystem -dead_strip %t/strip-dylib-ref.o %t/dylib.dylib \ # RUN: -o %t/strip-dylib-ref -U _ref_undef_fun -U _unref_undef_fun # RUN: llvm-objdump --syms --bind --lazy-bind --weak-bind %t/strip-dylib-ref | \ # RUN: FileCheck --check-prefix=STRIPDYLIB --implicit-check-not _unref %s @@ -194,13 +194,13 @@ # STUBS-NOT: jmp ## An undefined symbol referenced from a dead-stripped function shouldn't ## produce a diagnostic: -# RUN: %lld -lSystem -dead_strip %t/strip-dylib-ref.o %t/dylib.dylib \ +# RUN: %lld-mac -lSystem -dead_strip %t/strip-dylib-ref.o %t/dylib.dylib \ # RUN: -o %t/strip-dylib-ref -U _ref_undef_fun ## Check that referenced undefs are kept with -undefined dynamic_lookup. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos \ # RUN: %t/ref-undef.s -o %t/ref-undef.o -# RUN: %lld -lSystem -dead_strip %t/ref-undef.o \ +# RUN: %lld-mac -lSystem -dead_strip %t/ref-undef.o \ # RUN: -o %t/ref-undef -undefined dynamic_lookup # RUN: llvm-objdump --syms --lazy-bind %t/ref-undef | \ # RUN: FileCheck --check-prefix=STRIPDYNLOOKUP %s @@ -212,7 +212,7 @@ ## S_ATTR_LIVE_SUPPORT tests. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos \ # RUN: %t/live-support.s -o %t/live-support.o -# RUN: %lld -lSystem -dead_strip %t/live-support.o %t/dylib.dylib \ +# RUN: %lld-mac -lSystem -dead_strip %t/live-support.o %t/dylib.dylib \ # RUN: -U _ref_undef_fun -U _unref_undef_fun -o %t/live-support # RUN: llvm-objdump --syms %t/live-support | \ # RUN: FileCheck --check-prefix=LIVESUPP --implicit-check-not _unref %s @@ -232,7 +232,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos \ # RUN: %t/live-support-iterations.s -o %t/live-support-iterations.o -# RUN: %lld -lSystem -dead_strip %t/live-support-iterations.o \ +# RUN: %lld-mac -lSystem -dead_strip %t/live-support-iterations.o \ # RUN: -o %t/live-support-iterations # RUN: llvm-objdump --syms %t/live-support-iterations | \ # RUN: FileCheck --check-prefix=LIVESUPP2 --implicit-check-not _unref %s @@ -254,7 +254,7 @@ ## (Need to use darwin19.0.0 to make -mc emit __LD,__compact_unwind.) # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 \ # RUN: %t/unwind.s -o %t/unwind.o -# RUN: %lld -lc++ -lSystem -dead_strip %t/unwind.o -o %t/unwind +# RUN: %lld-mac -lc++ -lSystem -dead_strip %t/unwind.o -o %t/unwind # RUN: llvm-objdump --syms %t/unwind | \ # RUN: FileCheck --check-prefix=UNWIND --implicit-check-not unref %s # RUN: llvm-otool -l %t/unwind | FileCheck --check-prefix=UNWINDSECT %s @@ -281,7 +281,7 @@ # RUN: %t/weak-ref.s -o %t/weak-ref.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos \ # RUN: %t/strong-dead-ref.s -o %t/strong-dead-ref.o -# RUN: %lld -lSystem -dead_strip %t/weak-ref.o %t/strong-dead-ref.o \ +# RUN: %lld-mac -lSystem -dead_strip %t/weak-ref.o %t/strong-dead-ref.o \ # RUN: %t/dylib.dylib -o %t/weak-ref # RUN: llvm-otool -l %t/weak-ref | FileCheck -DDIR=%t --check-prefix=WEAK %s # WEAK: cmd LC_LOAD_DYLIB @@ -295,10 +295,10 @@ ## "this overrides a weak import" opcode if it is dead-stripped. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos \ # RUN: %t/weak-dylib.s -o %t/weak-dylib.o -# RUN: %lld -dylib -dead_strip %t/weak-dylib.o -o %t/weak-dylib.dylib +# RUN: %lld-mac -dylib -dead_strip %t/weak-dylib.o -o %t/weak-dylib.dylib # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos \ # RUN: %t/dead-weak-override.s -o %t/dead-weak-override.o -# RUN: %lld -dead_strip %t/dead-weak-override.o %t/weak-dylib.dylib \ +# RUN: %lld-mac -dead_strip %t/dead-weak-override.o %t/weak-dylib.dylib \ # RUN: -o %t/dead-weak-override # RUN: llvm-objdump --macho --weak-bind --private-header \ # RUN: %t/dead-weak-override | FileCheck --check-prefix=DEADWEAK %s @@ -310,7 +310,7 @@ ## Stripped symbols should not be in the debug info stabs entries. # RUN: llvm-mc -g -filetype=obj -triple=x86_64-apple-macos \ # RUN: %t/debug.s -o %t/debug.o -# RUN: %lld -lSystem -dead_strip %t/debug.o -o %t/debug +# RUN: %lld-mac -lSystem -dead_strip %t/debug.o -o %t/debug # RUN: dsymutil -s %t/debug | FileCheck --check-prefix=EXECSTABS %s # EXECSTABS-NOT: N_FUN {{.*}} '_unref' # EXECSTABS: N_FUN {{.*}} '_main' @@ -318,7 +318,7 @@ # RUN: llvm-mc -g -filetype=obj -triple=x86_64-apple-macos \ # RUN: %t/literals.s -o %t/literals.o -# RUN: %lld -dylib -dead_strip --deduplicate-literals %t/literals.o -o %t/literals +# RUN: %lld-mac -dylib -dead_strip --deduplicate-literals %t/literals.o -o %t/literals # RUN: llvm-objdump --macho --section="__TEXT,__cstring" --section="__DATA,str_ptrs" \ # RUN: --section="__TEXT,__literals" %t/literals | FileCheck %s --check-prefix=LIT Index: lld/test/MachO/demangle.s =================================================================== --- lld/test/MachO/demangle.s +++ lld/test/MachO/demangle.s @@ -2,8 +2,8 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: not %lld %t.o -o /dev/null 2>&1 | FileCheck %s -# RUN: not %lld -demangle %t.o -o /dev/null 2>&1 | \ +# RUN: not %lld-mac %t.o -o /dev/null 2>&1 | FileCheck %s +# RUN: not %lld-mac -demangle %t.o -o /dev/null 2>&1 | \ # RUN: FileCheck --check-prefix=DEMANGLE %s # CHECK: undefined symbol: __Z1fv Index: lld/test/MachO/dependency-info.s =================================================================== --- lld/test/MachO/dependency-info.s +++ lld/test/MachO/dependency-info.s @@ -2,12 +2,12 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s -# RUN: %lld -dylib -o %t/libfoo.dylib %t/foo.o +# RUN: %lld-mac -dylib -o %t/libfoo.dylib %t/foo.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/bar.o %t/bar.s # RUN: llvm-ar csr %t/bar.a %t/bar.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s -# RUN: %lld %t/main.o %t/bar.a %t/libfoo.dylib -lSystem -o %t/test.out -dependency_info %t/deps_info.out +# RUN: %lld-mac %t/main.o %t/bar.a %t/libfoo.dylib -lSystem -o %t/test.out -dependency_info %t/deps_info.out # RUN: %python %S/Inputs/DependencyDump.py %t/deps_info.out | FileCheck %s # CHECK: lld-version: {{.*}}LLD {{.*}} Index: lld/test/MachO/discard-llvm-sections.s =================================================================== --- lld/test/MachO/discard-llvm-sections.s +++ lld/test/MachO/discard-llvm-sections.s @@ -8,7 +8,7 @@ ## 1/ Test that LLD does not produce duplicate symbols errors when linking global symbols ## with the same name under the LLVM segment. -# RUN: %lld -dylib %t/foo.o %t/bar.o -o %t/libDuplicate.dylib +# RUN: %lld-mac -dylib %t/foo.o %t/bar.o -o %t/libDuplicate.dylib ## 2/ Test that all sections within an LLVM segment are dropped. # RUN: llvm-objdump --section-headers %t/libDuplicate.dylib | FileCheck %s @@ -21,7 +21,7 @@ ## symbols # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin --defsym TEXT=0 %t/foo.s -o %t/foo.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin --defsym TEXT=0 %t/bar.s -o %t/bar.o -# RUN: not %lld -dylib %t/foo.o %t/bar.o -o %t/libDuplicate.dylib 2>&1 | FileCheck %s --check-prefix=DUP +# RUN: not %lld-mac -dylib %t/foo.o %t/bar.o -o %t/libDuplicate.dylib 2>&1 | FileCheck %s --check-prefix=DUP # DUP: error: duplicate symbol: _llvm.foo Index: lld/test/MachO/driver.test =================================================================== --- lld/test/MachO/driver.test +++ lld/test/MachO/driver.test @@ -1,6 +1,6 @@ -# RUN: %lld --version | FileCheck -check-prefix=VERSION %s +# RUN: %lld-mac --version | FileCheck -check-prefix=VERSION %s VERSION: LLD -# RUN: not %lld ---help 2>&1 | FileCheck -check-prefix=SPELLHELP %s +# RUN: not %lld-mac ---help 2>&1 | FileCheck -check-prefix=SPELLHELP %s SPELLHELP: error: unknown argument '---help', did you mean '--help' # FIXME: We should also output a "no input files" error Index: lld/test/MachO/dso-handle.s =================================================================== --- lld/test/MachO/dso-handle.s +++ lld/test/MachO/dso-handle.s @@ -1,12 +1,12 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld -lSystem %t.o -o %t +# RUN: %lld-mac -lSystem %t.o -o %t # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s # CHECK: leaq {{.*}} ## 0x100000000 # CHECK-NEXT: leaq {{.*}} ## 0x100000000 -# RUN: %lld -dylib %t.o -o %t.dylib +# RUN: %lld-mac -dylib %t.o -o %t.dylib # RUN: llvm-objdump -d --no-show-raw-insn --rebase --section-headers %t.dylib | FileCheck %s --check-prefix=DYLIB-CHECK # DYLIB-CHECK: leaq {{.*}} ## 0x0 # DYLIB-CHECK-NEXT: leaq {{.*}} ## 0x0 Index: lld/test/MachO/dyld-stub-binder.s =================================================================== --- lld/test/MachO/dyld-stub-binder.s +++ lld/test/MachO/dyld-stub-binder.s @@ -5,35 +5,35 @@ # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/test.s -o %t/test.o ## Dylibs that don't do lazy dynamic calls don't need dyld_stub_binder. -# RUN: %lld -arch arm64 -dylib %t/foo.o -o %t/libfoo.dylib +# RUN: %lld-mac -arch arm64 -dylib %t/foo.o -o %t/libfoo.dylib # RUN: llvm-nm -m %t/libfoo.dylib | FileCheck --check-prefix=NOSTUB %s ## Binaries that don't do lazy dynamic calls but are linked against ## libSystem.dylib get a reference to dyld_stub_binder even if it's ## not needed. -# RUN: %lld -arch arm64 -lSystem -dylib %t/foo.o -o %t/libfoo.dylib +# RUN: %lld-mac -arch arm64 -lSystem -dylib %t/foo.o -o %t/libfoo.dylib # RUN: llvm-nm -m %t/libfoo.dylib | FileCheck --check-prefix=STUB %s ## Dylibs that do lazy dynamic calls do need dyld_stub_binder. -# RUN: not %lld -arch arm64 -dylib %t/bar.o %t/libfoo.dylib \ +# RUN: not %lld-mac -arch arm64 -dylib %t/bar.o %t/libfoo.dylib \ # RUN: -o %t/libbar.dylib 2>&1 | FileCheck --check-prefix=MISSINGSTUB %s -# RUN: %lld -arch arm64 -lSystem -dylib %t/bar.o %t/libfoo.dylib \ +# RUN: %lld-mac -arch arm64 -lSystem -dylib %t/bar.o %t/libfoo.dylib \ # RUN: -o %t/libbar.dylib # RUN: llvm-nm -m %t/libbar.dylib | FileCheck --check-prefix=STUB %s ## As do executables. -# RUN: not %lld -arch arm64 %t/libfoo.dylib %t/libbar.dylib %t/test.o \ +# RUN: not %lld-mac -arch arm64 %t/libfoo.dylib %t/libbar.dylib %t/test.o \ # RUN: -o %t/test 2>&1 | FileCheck --check-prefix=MISSINGSTUB %s -# RUN: %lld -arch arm64 -lSystem %t/libfoo.dylib %t/libbar.dylib %t/test.o \ +# RUN: %lld-mac -arch arm64 -lSystem %t/libfoo.dylib %t/libbar.dylib %t/test.o \ # RUN: -o %t/test # RUN: llvm-nm -m %t/test | FileCheck --check-prefix=STUB %s ## Test dynamic lookup of dyld_stub_binder. -# RUN: %lld -arch arm64 %t/libfoo.dylib %t/libbar.dylib %t/test.o \ +# RUN: %lld-mac -arch arm64 %t/libfoo.dylib %t/libbar.dylib %t/test.o \ # RUN: -o %t/test -undefined dynamic_lookup # RUN: llvm-nm -m %t/test | FileCheck --check-prefix=DYNSTUB %s -# RUN: %lld -arch arm64 %t/libfoo.dylib %t/libbar.dylib %t/test.o \ +# RUN: %lld-mac -arch arm64 %t/libfoo.dylib %t/libbar.dylib %t/test.o \ # RUN: -o %t/test -U dyld_stub_binder # RUN: llvm-nm -m %t/test | FileCheck --check-prefix=DYNSTUB %s Index: lld/test/MachO/dylib-stub.yaml =================================================================== --- lld/test/MachO/dylib-stub.yaml +++ lld/test/MachO/dylib-stub.yaml @@ -12,7 +12,7 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o # RUN: yaml2obj %t/fat.dylib.yaml > %t/fat.dylib -# RUN: %lld -lSystem %t/test.o %t/fat.dylib -o %t/test +# RUN: %lld-mac -lSystem %t/test.o %t/fat.dylib -o %t/test # RUN: llvm-objdump --macho --lazy-bind %t/test | FileCheck %s # CHECK: __DATA __la_symbol_ptr 0x100002000 foo _foo Index: lld/test/MachO/dylib-version.s =================================================================== --- lld/test/MachO/dylib-version.s +++ lld/test/MachO/dylib-version.s @@ -1,45 +1,45 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: not %lld -o %t/executable %t.o -o /dev/null \ +# RUN: not %lld-mac -o %t/executable %t.o -o /dev/null \ # RUN: -compatibility_version 10 -current_version 11 2>&1 | \ # RUN: FileCheck --check-prefix=NEEDDYLIB %s -# RUN: not %lld -execute -o %t/executable %t.o -o /dev/null \ +# RUN: not %lld-mac -execute -o %t/executable %t.o -o /dev/null \ # RUN: -compatibility_version 10 -current_version 11 2>&1 | \ # RUN: FileCheck --check-prefix=NEEDDYLIB %s -# RUN: not %lld -bundle -o %t/executable %t.o -o /dev/null \ +# RUN: not %lld-mac -bundle -o %t/executable %t.o -o /dev/null \ # RUN: -compatibility_version 10 -current_version 11 2>&1 | \ # RUN: FileCheck --check-prefix=NEEDDYLIB %s # NEEDDYLIB: error: -compatibility_version 10: only valid with -dylib # NEEDDYLIB: error: -current_version 11: only valid with -dylib -# RUN: not %lld -dylib -o %t/executable %t.o -o /dev/null \ +# RUN: not %lld-mac -dylib -o %t/executable %t.o -o /dev/null \ # RUN: -compatibility_version 1.2.3.4 -current_version 1.2.3.4.5 2>&1 | \ # RUN: FileCheck --check-prefix=MALFORMED %s # MALFORMED: error: -compatibility_version 1.2.3.4: malformed version # MALFORMED: error: -current_version 1.2.3.4.5: malformed version -# RUN: not %lld -dylib -o %t/executable %t.o -o /dev/null \ +# RUN: not %lld-mac -dylib -o %t/executable %t.o -o /dev/null \ # RUN: -compatibility_version 80000.1 -current_version 1.2.3 2>&1 | \ # RUN: FileCheck --check-prefix=BADMAJOR %s # BADMAJOR: error: -compatibility_version 80000.1: malformed version -# RUN: not %lld -dylib -o %t/executable %t.o -o /dev/null \ +# RUN: not %lld-mac -dylib -o %t/executable %t.o -o /dev/null \ # RUN: -compatibility_version 8.300 -current_version 1.2.3 2>&1 | \ # RUN: FileCheck --check-prefix=BADMINOR %s # BADMINOR: error: -compatibility_version 8.300: malformed version -# RUN: not %lld -dylib -o %t/executable %t.o -o /dev/null \ +# RUN: not %lld-mac -dylib -o %t/executable %t.o -o /dev/null \ # RUN: -compatibility_version 8.8.300 -current_version 1.2.3 2>&1 | \ # RUN: FileCheck --check-prefix=BADSUBMINOR %s # BADSUBMINOR: error: -compatibility_version 8.8.300: malformed version -# RUN: %lld -dylib -o %t/executable %t.o -o %t.dylib \ +# RUN: %lld-mac -dylib -o %t/executable %t.o -o %t.dylib \ # RUN: -compatibility_version 1.2.3 -current_version 2.5.6 # RUN: llvm-objdump --macho --all-headers %t.dylib | FileCheck %s Index: lld/test/MachO/dylib.s =================================================================== --- lld/test/MachO/dylib.s +++ 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 -dylib -install_name @executable_path/libfoo.dylib \ +# RUN: %lld-mac -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 -dylib %t.o -o %t.defaultInstallName.dylib -e missing_entry +# RUN: %lld-mac -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]] Index: lld/test/MachO/dylink-ordinal.s =================================================================== --- lld/test/MachO/dylink-ordinal.s +++ lld/test/MachO/dylink-ordinal.s @@ -4,7 +4,7 @@ # RUN: rm -rf %t; split-file --no-leading-lines %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/main.s -o %t/main.o -# RUN: %lld -o %t/main -L%t -lFoo -lBar -lSystem %t/main.o +# RUN: %lld-mac -o %t/main -L%t -lFoo -lBar -lSystem %t/main.o # RUN: llvm-objdump --lazy-bind -d --no-show-raw-insn %t/main | FileCheck %s # CHECK: callq 0x[[#%x,FOO_OFF:]] Index: lld/test/MachO/dylink.s =================================================================== --- lld/test/MachO/dylink.s +++ lld/test/MachO/dylink.s @@ -4,10 +4,10 @@ # 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 -dylib -install_name @executable_path/libhello.dylib \ +# RUN: %lld-mac -dylib -install_name @executable_path/libhello.dylib \ # RUN: -compatibility_version 10 -current_version 11 \ # RUN: %t/libhello.o -o %t/libhello.dylib -# RUN: %lld -dylib -install_name \ +# RUN: %lld-mac -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 @@ -19,7 +19,7 @@ # NOSYM: no symbols # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/dylink.o -# RUN: %lld -o %t/dylink -L%t -lhello -lgoodbye %t/dylink.o +# RUN: %lld-mac -o %t/dylink -L%t -lhello -lgoodbye %t/dylink.o # RUN: llvm-objdump --bind -d --no-show-raw-insn %t/dylink | FileCheck %s # CHECK: movq [[#%u, HELLO_OFF:]](%rip), %rsi @@ -48,7 +48,7 @@ # RUN: llvm-objdump --macho --all-headers %t/dylink | FileCheck %s \ # RUN: --check-prefix=LOAD --implicit-check-not LC_LOAD_DYLIB ## Check that we don't create duplicate LC_LOAD_DYLIBs. -# RUN: %lld -o %t/dylink -L%t -lhello -lhello -lgoodbye -lgoodbye %t/dylink.o +# RUN: %lld-mac -o %t/dylink -L%t -lhello -lhello -lgoodbye -lgoodbye %t/dylink.o # RUN: llvm-objdump --macho --all-headers %t/dylink | FileCheck %s \ # RUN: --check-prefix=LOAD --implicit-check-not LC_LOAD_DYLIB Index: lld/test/MachO/encryption-info.s =================================================================== --- lld/test/MachO/encryption-info.s +++ lld/test/MachO/encryption-info.s @@ -3,10 +3,10 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/test.o # RUN: llvm-mc -filetype=obj -triple=arm64_32-apple-watchos %s -o %t/watchos-test.o -# RUN: %lld -lSystem -o %t/test %t/test.o +# RUN: %lld-mac -lSystem -o %t/test %t/test.o # RUN: llvm-objdump --macho --all-headers %t/test | FileCheck %s --check-prefix=NO-ENCRYPTION -DSUFFIX=_64 -# RUN: %lld -lSystem -encryptable -o %t/test %t/test.o +# RUN: %lld-mac -lSystem -encryptable -o %t/test %t/test.o # RUN: llvm-objdump --macho --all-headers %t/test | FileCheck %s --check-prefix=ENCRYPTION -DSUFFIX=_64 -D#PAGE_SIZE=4096 # RUN: %lld-watchos -lSystem -o %t/watchos-test %t/watchos-test.o Index: lld/test/MachO/entry-symbol.s =================================================================== --- lld/test/MachO/entry-symbol.s +++ lld/test/MachO/entry-symbol.s @@ -2,9 +2,9 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/not-main.s -o %t/not-main.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/libfoo.s -o %t/libfoo.o -# RUN: %lld -lSystem -dylib %t/libfoo.o -o %t/libfoo.dylib +# RUN: %lld-mac -lSystem -dylib %t/libfoo.o -o %t/libfoo.dylib -# RUN: %lld -lSystem -o %t/not-main %t/not-main.o -e _not_main +# RUN: %lld-mac -lSystem -o %t/not-main %t/not-main.o -e _not_main # RUN: llvm-objdump --macho --all-headers --syms %t/not-main | FileCheck %s # CHECK-LABEL: SYMBOL TABLE @@ -21,10 +21,10 @@ # CHECK-NEXT: cmdsize 24 # CHECK-NEXT: entryoff [[#ENTRYOFF]] -# RUN: %lld -lSystem -o %t/dysym-main %t/not-main.o %t/libfoo.dylib -e _dysym_main +# RUN: %lld-mac -lSystem -o %t/dysym-main %t/not-main.o %t/libfoo.dylib -e _dysym_main # RUN: llvm-objdump --macho --all-headers --indirect-symbols --lazy-bind %t/dysym-main | FileCheck %s --check-prefix=DYSYM -DDYLIB=libfoo -# RUN: %lld -lSystem -o %t/dyn-lookup %t/not-main.o -e _dysym_main -undefined dynamic_lookup +# RUN: %lld-mac -lSystem -o %t/dyn-lookup %t/not-main.o -e _dysym_main -undefined dynamic_lookup # RUN: llvm-objdump --macho --all-headers --indirect-symbols --lazy-bind %t/dyn-lookup | FileCheck %s --check-prefix=DYSYM -DDYLIB=flat-namespace # DYSYM-LABEL: Indirect symbols for (__TEXT,__stubs) 1 entries @@ -37,7 +37,7 @@ # DYSYM-NEXT: segment section address dylib symbol # DYSYM-NEXT: __DATA __la_symbol_ptr {{.*}} [[DYLIB]] _dysym_main -# RUN: %lld -lSystem -o %t/weak-dysym-main %t/not-main.o %t/libfoo.dylib -e _weak_dysym_main +# RUN: %lld-mac -lSystem -o %t/weak-dysym-main %t/not-main.o %t/libfoo.dylib -e _weak_dysym_main # RUN: llvm-objdump --macho --all-headers --indirect-symbols --bind --weak-bind %t/weak-dysym-main | FileCheck %s --check-prefix=WEAK-DYSYM # WEAK-DYSYM-LABEL: Indirect symbols for (__TEXT,__stubs) 1 entries # WEAK-DYSYM-NEXT: address index name @@ -52,13 +52,13 @@ # WEAK-DYSYM-NEXT: segment section address type addend symbol # WEAK-DYSYM-NEXT: __DATA __la_symbol_ptr {{.*}} pointer 0 _weak_dysym_main -# RUN: %lld -dylib -lSystem -o %t/dysym-main.dylib %t/not-main.o %t/libfoo.dylib -e _dysym_main +# RUN: %lld-mac -dylib -lSystem -o %t/dysym-main.dylib %t/not-main.o %t/libfoo.dylib -e _dysym_main # RUN: llvm-objdump --macho --indirect-symbols --lazy-bind %t/dysym-main.dylib | FileCheck %s --check-prefix=DYLIB-NO-MAIN # DYLIB-NO-MAIN-NOT: _dysym_main -# RUN: not %lld -o /dev/null %t/not-main.o -e _missing 2>&1 | FileCheck %s --check-prefix=UNDEFINED +# RUN: not %lld-mac -o /dev/null %t/not-main.o -e _missing 2>&1 | FileCheck %s --check-prefix=UNDEFINED # UNDEFINED: error: undefined symbol: _missing -# RUN: not %lld -o /dev/null %t/not-main.o 2>&1 | FileCheck %s --check-prefix=DEFAULT-ENTRY +# RUN: not %lld-mac -o /dev/null %t/not-main.o 2>&1 | FileCheck %s --check-prefix=DEFAULT-ENTRY # DEFAULT-ENTRY: error: undefined symbol: _main # DEFAULT-ENTRY-NEXT: >>> referenced by the entry point Index: lld/test/MachO/error-limit.test =================================================================== --- lld/test/MachO/error-limit.test +++ lld/test/MachO/error-limit.test @@ -3,7 +3,7 @@ XFAIL: main-run-twice ## Check that we only see 20 (the default error-limit) "cannot open" errors -RUN: not %lld A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 2>&1 | \ +RUN: not %lld-mac A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 2>&1 | \ RUN: FileCheck -check-prefix=DEFAULT %s DEFAULT: cannot open A: @@ -12,7 +12,7 @@ DEFAULT-NEXT: too many errors emitted, stopping now (use --error-limit=0 to see all errors) ## Check that we only see 5 "cannot open" errors when --error-limit=5 -RUN: not %lld --error-limit=5 A B C D E F G H I J 2>&1 \ +RUN: not %lld-mac --error-limit=5 A B C D E F G H I J 2>&1 \ RUN: | FileCheck -check-prefix=LIMIT5 %s LIMIT5: cannot open A: @@ -21,7 +21,7 @@ LIMIT5-NEXT: too many errors emitted, stopping now (use --error-limit=0 to see all errors) ## Check that we see all "cannot open" errors when --error-limit=0 (unimited) -RUN: not %lld --error-limit=0 A B C D E F G H I J K L M N O P Q R S T U V W 2>&1 | \ +RUN: not %lld-mac --error-limit=0 A B C D E F G H I J K L M N O P Q R S T U V W 2>&1 | \ RUN: FileCheck -check-prefix=UNLIMITED %s UNLIMITED: cannot open A: Index: lld/test/MachO/export-options.s =================================================================== --- lld/test/MachO/export-options.s +++ lld/test/MachO/export-options.s @@ -6,7 +6,7 @@ # RUN: llvm-ar --format=darwin rcs %t/lazydef.a %t/lazydef.o ## Check that mixing exported and unexported symbol options yields an error -# RUN: not %lld -dylib %t/default.o -o /dev/null \ +# RUN: not %lld-mac -dylib %t/default.o -o /dev/null \ # RUN: -exported_symbol a -unexported_symbol b 2>&1 | \ # RUN: FileCheck --check-prefix=CONFLICT %s @@ -15,7 +15,7 @@ ## Check that an exported literal name with no symbol definition yields an error ## but that an exported glob-pattern with no matching symbol definition is OK -# RUN: not %lld -dylib %t/default.o -o /dev/null \ +# RUN: not %lld-mac -dylib %t/default.o -o /dev/null \ # RUN: -exported_symbol absent_literal \ # RUN: -exported_symbol absent_gl?b 2>&1 | \ # RUN: FileCheck --check-prefix=UNDEF %s @@ -25,14 +25,14 @@ # UNDEF-NOT: error: {{.*}} absent_gl{{.}}b ## Check that dynamic_lookup suppresses the error -# RUN: %lld -dylib %t/default.o -undefined dynamic_lookup -o %t/dyn-lookup \ +# RUN: %lld-mac -dylib %t/default.o -undefined dynamic_lookup -o %t/dyn-lookup \ # RUN: -exported_symbol absent_literal # RUN: llvm-objdump --macho --syms %t/dyn-lookup | FileCheck %s --check-prefix=DYN # DYN: *UND* absent_literal ## Check that exported literal symbols are present in output's ## symbol table, even lazy symbols which would otherwise be omitted -# RUN: %lld -dylib %t/default.o %t/lazydef.a -o %t/lazydef \ +# RUN: %lld-mac -dylib %t/default.o %t/lazydef.a -o %t/lazydef \ # RUN: -exported_symbol _keep_globl \ # RUN: -exported_symbol _keep_lazy # RUN: llvm-objdump --syms %t/lazydef | \ @@ -42,7 +42,7 @@ # EXPORT-DAG: g F __TEXT,__text _keep_lazy ## Check that exported symbol is global -# RUN: %no-fatal-warnings-lld -dylib %t/default.o -o %t/hidden-export \ +# RUN: %no-fatal-warnings-lld-mac -dylib %t/default.o -o %t/hidden-export \ # RUN: -exported_symbol _private_extern 2>&1 | \ # RUN: FileCheck --check-prefix=PRIVATE %s @@ -55,7 +55,7 @@ # EMPTY-TRIE-EMPTY: ## Check that the export trie is unaltered -# RUN: %lld -dylib %t/default.o -o %t/default +# RUN: %lld-mac -dylib %t/default.o -o %t/default # RUN: llvm-objdump --macho --exports-trie %t/default | \ # RUN: FileCheck --check-prefix=DEFAULT %s @@ -68,7 +68,7 @@ ## by a deny list. Both lists are designed to yield the same result. ## Check the allow list -# RUN: %lld -dylib %t/default.o -o %t/allowed \ +# RUN: %lld-mac -dylib %t/default.o -o %t/allowed \ # RUN: -exported_symbol _keep_globl # RUN: llvm-objdump --macho --exports-trie %t/allowed | \ # RUN: FileCheck --check-prefix=TRIE %s @@ -76,7 +76,7 @@ # RUN: FileCheck --check-prefix=NM %s ## Check the deny list -# RUN: %lld -dylib %t/default.o -o %t/denied \ +# RUN: %lld-mac -dylib %t/default.o -o %t/denied \ # RUN: -unexported_symbol _hide_globl # RUN: llvm-objdump --macho --exports-trie %t/denied | \ # RUN: FileCheck --check-prefix=TRIE %s @@ -97,7 +97,7 @@ ## Check that only string-literal patterns match ## Check that comments and blank lines are stripped from symbol list -# RUN: %lld -dylib %t/symdefs.o -o %t/literal \ +# RUN: %lld-mac -dylib %t/symdefs.o -o %t/literal \ # RUN: -exported_symbols_list %t/literals.txt # RUN: llvm-objdump --macho --exports-trie %t/literal | \ # RUN: FileCheck --check-prefix=LITERAL %s @@ -109,7 +109,7 @@ ## Check that only glob patterns match ## Check that comments and blank lines are stripped from symbol list -# RUN: %lld -dylib %t/symdefs.o -o %t/globby \ +# RUN: %lld-mac -dylib %t/symdefs.o -o %t/globby \ # RUN: -exported_symbols_list %t/globbys.txt # RUN: llvm-objdump --macho --exports-trie %t/globby | \ # RUN: FileCheck --check-prefix=GLOBBY %s @@ -129,17 +129,17 @@ # RUN: %t/weak-private-extern.s -o %t/weak-private-extern.o ## Test that we can export the autohide symbol but not when it's also ## private-extern -# RUN: %lld -dylib -exported_symbol "_foo" %t/autohide.o -o %t/exp-autohide.dylib +# RUN: %lld-mac -dylib -exported_symbol "_foo" %t/autohide.o -o %t/exp-autohide.dylib # RUN: llvm-nm -g %t/exp-autohide.dylib | FileCheck %s --check-prefix=EXP-AUTOHIDE -# RUN: not %lld -dylib -exported_symbol "_foo" %t/autohide-private-extern.o \ +# RUN: not %lld-mac -dylib -exported_symbol "_foo" %t/autohide-private-extern.o \ # RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=AUTOHIDE-PRIVATE -# RUN: not %lld -dylib -exported_symbol "_foo" %t/autohide.o \ +# RUN: not %lld-mac -dylib -exported_symbol "_foo" %t/autohide.o \ # RUN: %t/glob-private-extern.o -o /dev/null 2>&1 | \ # RUN: FileCheck %s --check-prefix=AUTOHIDE-PRIVATE -# RUN: not %lld -dylib -exported_symbol "_foo" %t/autohide.o \ +# RUN: not %lld-mac -dylib -exported_symbol "_foo" %t/autohide.o \ # RUN: %t/weak-private-extern.o -o /dev/null 2>&1 | \ # RUN: FileCheck %s --check-prefix=AUTOHIDE-PRIVATE Index: lld/test/MachO/export-trie.s =================================================================== --- lld/test/MachO/export-trie.s +++ lld/test/MachO/export-trie.s @@ -6,7 +6,7 @@ ## the image base starts at a non-zero address. This allows us to verify that ## addresses in the export trie are correctly encoded as relative to the image ## base. -# RUN: %lld %t.o -o %t +# RUN: %lld-mac %t.o -o %t # RUN: llvm-objdump --syms --exports-trie %t | FileCheck %s --check-prefix=EXPORTS # EXPORTS-LABEL: SYMBOL TABLE: Index: lld/test/MachO/fat-arch.s =================================================================== --- lld/test/MachO/fat-arch.s +++ 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 -o /dev/null %t.fat.o +# RUN: %lld-mac -o /dev/null %t.fat.o # RUN: llvm-lipo %t.i386.o -create -o %t.noarch.o -# RUN: not %lld -o /dev/null %t.noarch.o 2>&1 | \ +# RUN: not %lld-mac -o /dev/null %t.noarch.o 2>&1 | \ # RUN: FileCheck %s -DFILE=%t.noarch.o # CHECK: error: unable to find matching architecture in [[FILE]] Index: lld/test/MachO/fatal-warnings.s =================================================================== --- lld/test/MachO/fatal-warnings.s +++ lld/test/MachO/fatal-warnings.s @@ -1,9 +1,9 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t1.o -# RUN: %no-fatal-warnings-lld %t1.o -o /dev/null -single_module 2>&1 \ +# RUN: %no-fatal-warnings-lld-mac %t1.o -o /dev/null -single_module 2>&1 \ # RUN: | FileCheck -check-prefix=WARNING %s -# RUN: not %no-fatal-warnings-lld %t1.o -fatal_warnings -o /dev/null \ +# RUN: not %no-fatal-warnings-lld-mac %t1.o -fatal_warnings -o /dev/null \ # RUN: -single_module 2>&1 | FileCheck -check-prefix=ERROR %s # ERROR: error: Option `-single_module' is deprecated Index: lld/test/MachO/filelist.s =================================================================== --- lld/test/MachO/filelist.s +++ lld/test/MachO/filelist.s @@ -13,25 +13,25 @@ # RUN: echo "%t/first.o" > filelist # RUN: echo "%t/second.o" >> filelist -# RUN: %lld -filelist filelist %t/test.o -o %t/test +# RUN: %lld-mac -filelist filelist %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=FIRST # RUN: echo "%t/second.o" > filelist # RUN: echo "%t/first.o" >> filelist -# RUN: %lld -filelist filelist %t/test.o -o %t/test +# RUN: %lld-mac -filelist filelist %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=SECOND # RUN: echo "%t/first.o" > filelist -# RUN: %lld -filelist filelist %t/second.o %t/test.o -o %t/test +# RUN: %lld-mac -filelist filelist %t/second.o %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=FIRST -# RUN: %lld %t/second.o -filelist filelist %t/test.o -o %t/test +# RUN: %lld-mac %t/second.o -filelist filelist %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=SECOND # RUN: echo "%t/first.o" > filelist-1 # RUN: echo "%t/second.o" > filelist-2 -# RUN: %lld -filelist filelist-1 -filelist filelist-2 %t/test.o -o %t/test +# RUN: %lld-mac -filelist filelist-1 -filelist filelist-2 %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=FIRST -# RUN: %lld -filelist filelist-2 -filelist filelist-1 %t/test.o -o %t/test +# RUN: %lld-mac -filelist filelist-2 -filelist filelist-1 %t/test.o -o %t/test # RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=SECOND #--- first.s Index: lld/test/MachO/final-output.s =================================================================== --- lld/test/MachO/final-output.s +++ lld/test/MachO/final-output.s @@ -4,10 +4,10 @@ ## -final_output sets the default for -install_name, but an explicit ## -install_name wins -# RUN: %lld -dylib -o %t.dylib -final_output /lib/foo.dylib %t.o +# RUN: %lld-mac -dylib -o %t.dylib -final_output /lib/foo.dylib %t.o # RUN: llvm-otool -D %t.dylib | FileCheck -DID=/lib/foo.dylib %s -# RUN: %lld -dylib -o %t.dylib -install_name /foo/bar.dylib \ +# RUN: %lld-mac -dylib -o %t.dylib -install_name /foo/bar.dylib \ # RUN: -final_output /lib/foo.dylib %t.o # RUN: llvm-otool -D %t.dylib | FileCheck -DID=/foo/bar.dylib %s Index: lld/test/MachO/flat-namespace-dysyms.s =================================================================== --- lld/test/MachO/flat-namespace-dysyms.s +++ lld/test/MachO/flat-namespace-dysyms.s @@ -2,19 +2,19 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s -# RUN: %lld -dylib -o %t/foo.dylib %t/foo.o +# RUN: %lld-mac -dylib -o %t/foo.dylib %t/foo.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/bar.o %t/bar.s -# RUN: %lld -lSystem -dylib -o %t/bar.dylib %t/bar.o %t/foo.dylib +# RUN: %lld-mac -lSystem -dylib -o %t/bar.dylib %t/bar.o %t/foo.dylib # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/baz.o %t/baz.s -# RUN: %lld -lSystem -dylib -o %t/baz.dylib %t/baz.o %t/bar.dylib +# RUN: %lld-mac -lSystem -dylib -o %t/baz.dylib %t/baz.o %t/bar.dylib # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s ## With flat_namespace, the linker automatically looks in foo.dylib and ## bar.dylib too, but it doesn't add a LC_LOAD_DYLIB for it. -# RUN: %lld -flat_namespace -lSystem %t/main.o %t/baz.dylib -o %t/out -t \ +# RUN: %lld-mac -flat_namespace -lSystem %t/main.o %t/baz.dylib -o %t/out -t \ # RUN: --reproduce %t/repro.tar | FileCheck --check-prefix=T %s ## FIXME: The `bar.dylib` line should use `T-NEXT`, but on Windows we load ## libSystem.tbd with different slash styles and end up loading it twice @@ -68,7 +68,7 @@ # Undefined symbols should still cause errors by default. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos \ # RUN: -o %t/main-with-undef.o %t/main-with-undef.s -# RUN: not %lld -flat_namespace -lSystem %t/main-with-undef.o %t/bar.dylib \ +# RUN: not %lld-mac -flat_namespace -lSystem %t/main-with-undef.o %t/bar.dylib \ # RUN: -o %t/out 2>&1 | FileCheck --check-prefix=UNDEF %s # UNDEF: error: undefined symbol: _quux Index: lld/test/MachO/flat-namespace-interposable.s =================================================================== --- lld/test/MachO/flat-namespace-interposable.s +++ lld/test/MachO/flat-namespace-interposable.s @@ -8,9 +8,9 @@ ## spurious bindings. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s -# RUN: %lld -lSystem -flat_namespace -o %t/foo %t/foo.o -# RUN: %lld -lSystem -dylib -flat_namespace -o %t/foo.dylib %t/foo.o -# RUN: %lld -lSystem -bundle -flat_namespace -o %t/foo.bundle %t/foo.o +# RUN: %lld-mac -lSystem -flat_namespace -o %t/foo %t/foo.o +# RUN: %lld-mac -lSystem -dylib -flat_namespace -o %t/foo.dylib %t/foo.o +# RUN: %lld-mac -lSystem -bundle -flat_namespace -o %t/foo.bundle %t/foo.o # RUN: llvm-objdump --macho --bind --lazy-bind --weak-bind %t/foo | FileCheck \ # RUN: %s --check-prefix=EXEC --implicit-check-not=_private_extern # RUN: llvm-objdump --macho --bind --lazy-bind --weak-bind %t/foo.dylib | \ Index: lld/test/MachO/force-load-swift-libs.ll =================================================================== --- lld/test/MachO/force-load-swift-libs.ll +++ lld/test/MachO/force-load-swift-libs.ll @@ -6,14 +6,14 @@ ; RUN: llvm-as %t/lc-linker-opt.ll -o %t/lc-linker-opt.o ; RUN: llvm-as %t/no-lc-linker-opt.ll -o %t/no-lc-linker-opt.o -; RUN: %lld -lSystem -force_load_swift_libs -L%t %t/lc-linker-opt.o -o %t/lc-linker-opt +; RUN: %lld-mac -lSystem -force_load_swift_libs -L%t %t/lc-linker-opt.o -o %t/lc-linker-opt ; RUN: llvm-objdump --macho --syms %t/lc-linker-opt | FileCheck %s --check-prefix=HAS-SWIFT -; RUN: %lld -lSystem -L%t %t/lc-linker-opt.o -o %t/lc-linker-opt-no-force +; RUN: %lld-mac -lSystem -L%t %t/lc-linker-opt.o -o %t/lc-linker-opt-no-force ; RUN: llvm-objdump --macho --syms %t/lc-linker-opt-no-force | FileCheck %s --check-prefix=NO-SWIFT ;; Swift libraries passed on the CLI don't get force-loaded! -; RUN: %lld -lSystem -force_load_swift_libs -lswiftFoo -L%t %t/no-lc-linker-opt.o -o %t/no-lc-linker-opt +; RUN: %lld-mac -lSystem -force_load_swift_libs -lswiftFoo -L%t %t/no-lc-linker-opt.o -o %t/no-lc-linker-opt ; RUN: llvm-objdump --macho --syms %t/no-lc-linker-opt | FileCheck %s --check-prefix=NO-SWIFT ; HAS-SWIFT: _swift_foo Index: lld/test/MachO/force-load.s =================================================================== --- lld/test/MachO/force-load.s +++ lld/test/MachO/force-load.s @@ -7,26 +7,26 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o -# RUN: %lld -lSystem -force_load %t/foo.a %t/foo.o %t/test.o -o %t/test-force-load-first +# RUN: %lld-mac -lSystem -force_load %t/foo.a %t/foo.o %t/test.o -o %t/test-force-load-first # FORCE-LOAD-FIRST: __TEXT,archive _foo # RUN: llvm-objdump --syms %t/test-force-load-first | FileCheck %s --check-prefix=FORCE-LOAD-FIRST -# RUN: %lld %t/foo.o -lSystem -force_load %t/foo.a %t/test.o -o %t/test-force-load-second +# RUN: %lld-mac %t/foo.o -lSystem -force_load %t/foo.a %t/test.o -o %t/test-force-load-second # RUN: llvm-objdump --syms %t/test-force-load-second | FileCheck %s --check-prefix=FORCE-LOAD-SECOND # FORCE-LOAD-SECOND: __TEXT,obj _foo ## Force-loading the same path twice is fine -# RUN: %lld -lSystem %t/foo.o -force_load %t/foo.a -force_load %t/foo.a %t/test.o -o /dev/null +# RUN: %lld-mac -lSystem %t/foo.o -force_load %t/foo.a -force_load %t/foo.a %t/test.o -o /dev/null ## Note that we do not call realpath() before dedup'ing the force-load ## arguments, so this is an error. -# RUN: cd %t; not %lld -lSystem %t/foo.o -force_load %t/foo.a -force_load foo.a \ +# RUN: cd %t; not %lld-mac -lSystem %t/foo.o -force_load %t/foo.a -force_load foo.a \ # RUN: %t/test.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=DUP # DUP: error: duplicate symbol: _bar ## Force-loading two different paths w/o conflicting symbols is fine -# RUN: %lld -lSystem -force_load %t/foo.a -force_load %t/baz.a %t/test.o -o %t/test-two-force-loads +# RUN: %lld-mac -lSystem -force_load %t/foo.a -force_load %t/baz.a %t/test.o -o %t/test-two-force-loads # RUN: llvm-objdump --syms %t/test-two-force-loads | FileCheck %s --check-prefix=TWICE # TWICE-DAG: __TEXT,archive _foo # TWICE-DAG: __TEXT,archive _bar Index: lld/test/MachO/framework.s =================================================================== --- lld/test/MachO/framework.s +++ lld/test/MachO/framework.s @@ -2,20 +2,20 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o # RUN: mkdir -p %t/Foo.framework/Versions/A -# RUN: %lld -dylib -install_name %t/Foo.framework/Versions/A/Foo %t/foo.o -o %t/Foo.framework/Versions/A/Foo -# RUN: %lld -dylib -install_name %t/Foo.framework/Versions/A/Foobar %t/foo.o -o %t/Foo.framework/Versions/A/Foobar +# RUN: %lld-mac -dylib -install_name %t/Foo.framework/Versions/A/Foo %t/foo.o -o %t/Foo.framework/Versions/A/Foo +# RUN: %lld-mac -dylib -install_name %t/Foo.framework/Versions/A/Foobar %t/foo.o -o %t/Foo.framework/Versions/A/Foobar # RUN: ln -sf A %t/Foo.framework/Versions/Current # RUN: ln -sf Versions/Current/Foo %t/Foo.framework/Foo # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o -# RUN: %lld -lSystem -F%t -framework Foo %t/test.o -o %t/test +# RUN: %lld-mac -lSystem -F%t -framework Foo %t/test.o -o %t/test # RUN: llvm-objdump --macho --lazy-bind %t/test | FileCheck %s --check-prefix=NOSUFFIX # NOSUFFIX: __DATA __la_symbol_ptr 0x{{[0-9a-f]*}} {{.*}}Foo _foo -# RUN: %lld -lSystem -F%t -framework Foo,baz %t/test.o -o %t/test-wrong-suffix +# RUN: %lld-mac -lSystem -F%t -framework Foo,baz %t/test.o -o %t/test-wrong-suffix # RUN: llvm-objdump --macho --lazy-bind %t/test-wrong-suffix | FileCheck %s --check-prefix=NOSUFFIX -# RUN: %lld -lSystem -F%t -framework Foo,bar %t/test.o -o %t/test-suffix +# RUN: %lld-mac -lSystem -F%t -framework Foo,bar %t/test.o -o %t/test-suffix # RUN: llvm-objdump --macho --lazy-bind %t/test-suffix | FileCheck %s --check-prefix=SUFFIX # SUFFIX: __DATA __la_symbol_ptr 0x{{[0-9a-f]*}} {{.*}}Foobar _foo Index: lld/test/MachO/function-starts.s =================================================================== --- lld/test/MachO/function-starts.s +++ lld/test/MachO/function-starts.s @@ -3,7 +3,7 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/basic.s -o %t/basic.o -# RUN: %lld -lSystem %t/basic.o -o %t/basic +# RUN: %lld-mac -lSystem %t/basic.o -o %t/basic # RUN: llvm-objdump --syms %t/basic > %t/objdump # RUN: llvm-objdump --macho --function-starts %t/basic >> %t/objdump # RUN: FileCheck %s --check-prefix=BASIC < %t/objdump @@ -18,7 +18,7 @@ # BASIC: [[#MAIN]] # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/alias.s -o %t/alias.o -# RUN: %lld -lSystem %t/alias.o -o %t/alias +# RUN: %lld-mac -lSystem %t/alias.o -o %t/alias # RUN: llvm-objdump --syms %t/alias > %t/objdump # RUN: llvm-objdump --macho --function-starts %t/alias >> %t/objdump # RUN: FileCheck %s --check-prefix=ALIAS < %t/objdump @@ -31,18 +31,18 @@ # ALIAS: [[#F1]] # ALIAS: [[#MAIN]] -# RUN: %lld %t/basic.o -no_function_starts -o %t/basic-no-function-starts +# RUN: %lld-mac %t/basic.o -no_function_starts -o %t/basic-no-function-starts # RUN: llvm-objdump --macho --function-starts %t/basic-no-function-starts | FileCheck %s --check-prefix=NO-FUNCTION-STARTS # NO-FUNCTION-STARTS: basic-no-function-starts: # NO-FUNCTION-STARTS-EMPTY: -# RUN: %lld -lSystem %t/basic.o -no_function_starts -function_starts -o %t/basic-explicit +# RUN: %lld-mac -lSystem %t/basic.o -no_function_starts -function_starts -o %t/basic-explicit # RUN: llvm-objdump --syms %t/basic > %t/objdump # RUN: llvm-objdump --macho --function-starts %t/basic >> %t/objdump # RUN: FileCheck %s --check-prefix=BASIC < %t/objdump # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/local.s -o %t/local.o -# RUN: %lld -lSystem %t/local.o -o %t/local +# RUN: %lld-mac -lSystem %t/local.o -o %t/local # RUN: llvm-objdump --syms %t/local > %t/objdump # RUN: llvm-objdump --macho --function-starts %t/local >> %t/objdump # RUN: FileCheck %s --check-prefix=LOCAL < %t/objdump Index: lld/test/MachO/header.s =================================================================== --- lld/test/MachO/header.s +++ lld/test/MachO/header.s @@ -6,12 +6,12 @@ # RUN: llvm-mc -filetype=obj -triple=arm64_32-apple-watchos %s -o %t/arm64-32-test.o # RUN: llvm-mc -filetype=obj -triple=armv7-apple-watchos %s -o %t/arm-test.o -# RUN: %lld -lSystem -arch x86_64 -o %t/x86-64-executable %t/x86-64-test.o -# RUN: %lld -lSystem -arch arm64 -o %t/arm64-executable %t/arm64-test.o +# RUN: %lld-mac -lSystem -arch x86_64 -o %t/x86-64-executable %t/x86-64-test.o +# RUN: %lld-mac -lSystem -arch arm64 -o %t/arm64-executable %t/arm64-test.o # RUN: %lld-watchos -lSystem -o %t/arm64-32-executable %t/arm64-32-test.o # RUN: %lld-watchos -lSystem -arch armv7 -o %t/arm-executable %t/arm-test.o -# RUN: %lld -arch x86_64 -dylib -o %t/x86-64-dylib %t/x86-64-test.o +# RUN: %lld-mac -arch x86_64 -dylib -o %t/x86-64-dylib %t/x86-64-test.o ## NOTE: recent versions of ld64 don't emit LIB64 for x86-64-executable, maybe we should follow suit # RUN: llvm-objdump --macho --private-header %t/x86-64-executable | FileCheck %s --check-prefix=EXEC -DCPU=X86_64 -DSUBTYPE=ALL -DCAPS=LIB64 Index: lld/test/MachO/headerpad.s =================================================================== --- lld/test/MachO/headerpad.s +++ lld/test/MachO/headerpad.s @@ -12,7 +12,7 @@ ################ Check default behavior # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/test.o -# RUN: %lld -o %t/test %t/test.o +# RUN: %lld-mac -o %t/test %t/test.o # RUN: llvm-objdump --macho --all-headers %t/test | FileCheck %s --check-prefix=PADx # # PADx: magic {{.+}} ncmds sizeofcmds flags @@ -24,9 +24,9 @@ # PADx-NEXT: offset [[#%u, CMDSIZE + 0x20 + 0x20]] ################ Zero pad, no LCDylibs -# RUN: %lld -o %t/test %t/test.o -headerpad 0 +# RUN: %lld-mac -o %t/test %t/test.o -headerpad 0 # RUN: llvm-objdump --macho --all-headers %t/test | FileCheck %s --check-prefix=PAD0 -# RUN: %lld -o %t/test %t/test.o -headerpad 0 -headerpad_max_install_names +# RUN: %lld-mac -o %t/test %t/test.o -headerpad 0 -headerpad_max_install_names # RUN: llvm-objdump --macho --all-headers %t/test | FileCheck %s --check-prefix=PAD0 # # PAD0: magic {{.+}} ncmds sizeofcmds flags @@ -38,11 +38,11 @@ # PAD0-NEXT: offset [[#%u, CMDSIZE + 0x20 + 0]] ################ Each lexical form of a hex number, no LCDylibs -# RUN: %lld -o %t/test %t/test.o -headerpad 11 +# RUN: %lld-mac -o %t/test %t/test.o -headerpad 11 # RUN: llvm-objdump --macho --all-headers %t/test | FileCheck %s --check-prefix=PAD11 -# RUN: %lld -o %t/test %t/test.o -headerpad 0x11 +# RUN: %lld-mac -o %t/test %t/test.o -headerpad 0x11 # RUN: llvm-objdump --macho --all-headers %t/test | FileCheck %s --check-prefix=PAD11 -# RUN: %lld -o %t/test %t/test.o -headerpad 0X11 -headerpad_max_install_names +# RUN: %lld-mac -o %t/test %t/test.o -headerpad 0X11 -headerpad_max_install_names # RUN: llvm-objdump --macho --all-headers %t/test | FileCheck %s --check-prefix=PAD11 # # PAD11: magic {{.+}} ncmds sizeofcmds flags @@ -55,13 +55,13 @@ ################ Each & all 3 kinds of LCDylib # RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t/null.o -# RUN: %lld -o %t/libnull.dylib %t/null.o -dylib \ +# RUN: %lld-mac -o %t/libnull.dylib %t/null.o -dylib \ # RUN: -headerpad_max_install_names # RUN: llvm-objdump --macho --all-headers %t/libnull.dylib | FileCheck %s --check-prefix=PADMAX -# RUN: %lld -o %t/libnull.dylib %t/null.o -dylib \ +# RUN: %lld-mac -o %t/libnull.dylib %t/null.o -dylib \ # RUN: -headerpad_max_install_names -lSystem # RUN: llvm-objdump --macho --all-headers %t/libnull.dylib | FileCheck %s --check-prefix=PADMAX -# RUN: %lld -o %t/libnull.dylib %t/null.o -dylib \ +# RUN: %lld-mac -o %t/libnull.dylib %t/null.o -dylib \ # RUN: -headerpad_max_install_names \ # RUN: -lSystem -sub_library libSystem # RUN: llvm-objdump --macho --all-headers %t/libnull.dylib | FileCheck %s --check-prefix=PADMAX @@ -75,7 +75,7 @@ # PADMAX-NEXT: offset [[#%u, CMDSIZE + 0x20 + mul(0x400, N - 9)]] ################ All 3 kinds of LCDylib swamped by a larger override -# RUN: %lld -o %t/libnull.dylib %t/null.o -dylib \ +# RUN: %lld-mac -o %t/libnull.dylib %t/null.o -dylib \ # RUN: -headerpad_max_install_names -headerpad 0x1001 \ # RUN: -lSystem -sub_library libSystem # RUN: llvm-objdump --macho --all-headers %t/libnull.dylib | FileCheck %s --check-prefix=PADOVR Index: lld/test/MachO/icf-arm64.s =================================================================== --- lld/test/MachO/icf-arm64.s +++ lld/test/MachO/icf-arm64.s @@ -3,7 +3,7 @@ # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin19.0.0 %t/main.s -o %t/main.o # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin19.0.0 %t/f2.s -o %t/f2.o -# RUN: %lld -arch arm64 -lSystem --icf=all -o %t/main %t/main.o %t/f2.o +# RUN: %lld-mac -arch arm64 -lSystem --icf=all -o %t/main %t/main.o %t/f2.o # RUN: llvm-objdump -d --syms --print-imm-hex %t/main | FileCheck %s # CHECK-LABEL: SYMBOL TABLE: Index: lld/test/MachO/icf-literals.s =================================================================== --- lld/test/MachO/icf-literals.s +++ lld/test/MachO/icf-literals.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: rm -rf %t; mkdir %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/test.o -# RUN: %lld -lSystem --icf=all -o %t/test %t/test.o +# RUN: %lld-mac -lSystem --icf=all -o %t/test %t/test.o # RUN: llvm-objdump --macho --syms -d %t/test | FileCheck %s # CHECK: _main: Index: lld/test/MachO/icf-options.s =================================================================== --- lld/test/MachO/icf-options.s +++ lld/test/MachO/icf-options.s @@ -2,19 +2,19 @@ # RUN: rm -rf %t; mkdir %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/main.o -# RUN: %lld -lSystem --icf=all -o %t/all %t/main.o 2>&1 \ +# RUN: %lld-mac -lSystem --icf=all -o %t/all %t/main.o 2>&1 \ # RUN: | FileCheck %s --check-prefix=DIAG-EMPTY --allow-empty -# RUN: %lld -lSystem --icf=none -o %t/none %t/main.o 2>&1 \ +# RUN: %lld-mac -lSystem --icf=none -o %t/none %t/main.o 2>&1 \ # RUN: | FileCheck %s --check-prefix=DIAG-EMPTY --allow-empty -# RUN: %lld -lSystem -no_deduplicate -o %t/no_dedup %t/main.o 2>&1 \ +# RUN: %lld-mac -lSystem -no_deduplicate -o %t/no_dedup %t/main.o 2>&1 \ # RUN: | FileCheck %s --check-prefix=DIAG-EMPTY --allow-empty -# RUN: not %lld -lSystem --icf=safe -o %t/safe %t/main.o 2>&1 \ +# RUN: not %lld-mac -lSystem --icf=safe -o %t/safe %t/main.o 2>&1 \ # RUN: | FileCheck %s --check-prefix=DIAG-SAFE -# RUN: not %lld -lSystem --icf=junk -o %t/junk %t/main.o 2>&1 \ +# RUN: not %lld-mac -lSystem --icf=junk -o %t/junk %t/main.o 2>&1 \ # RUN: | FileCheck %s --check-prefix=DIAG-JUNK -# RUN: %lld -lSystem --icf=all -no_deduplicate -o %t/none2 %t/main.o 2>&1 \ +# RUN: %lld-mac -lSystem --icf=all -no_deduplicate -o %t/none2 %t/main.o 2>&1 \ # RUN: | FileCheck %s --check-prefix=DIAG-EMPTY --allow-empty -# RUN: %lld -lSystem -no_deduplicate --icf=all -o %t/all2 %t/main.o 2>&1 \ +# RUN: %lld-mac -lSystem -no_deduplicate --icf=all -o %t/all2 %t/main.o 2>&1 \ # RUN: | FileCheck %s --check-prefix=DIAG-EMPTY --allow-empty # DIAG-EMPTY-NOT: {{.}} Index: lld/test/MachO/icf-scale.s =================================================================== --- lld/test/MachO/icf-scale.s +++ lld/test/MachO/icf-scale.s @@ -2,7 +2,7 @@ # RUN: rm -rf %t* # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld -lSystem --icf=all -o %t %t.o +# RUN: %lld-mac -lSystem --icf=all -o %t %t.o # RUN: llvm-objdump -d --syms %t | FileCheck %s ## When ICF has fewer than 1 Ki functions to segregate into equivalence classes, Index: lld/test/MachO/icf-undef.s =================================================================== --- lld/test/MachO/icf-undef.s +++ lld/test/MachO/icf-undef.s @@ -4,12 +4,12 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/test.s -o %t/test.o ## Check that we correctly dedup sections that reference dynamic-lookup symbols. -# RUN: %lld -lSystem -dylib --icf=all -undefined dynamic_lookup -o %t/test %t/test.o +# RUN: %lld-mac -lSystem -dylib --icf=all -undefined dynamic_lookup -o %t/test %t/test.o # RUN: llvm-objdump --macho --syms %t/test | FileCheck %s ## Check that we still raise an error when using regular undefined symbol ## treatment. -# RUN: not %lld -lSystem -dylib --icf=all -o /dev/null %t/test.o 2>&1 | \ +# RUN: not %lld-mac -lSystem -dylib --icf=all -o /dev/null %t/test.o 2>&1 | \ # RUN: FileCheck %s --check-prefix=ERR # CHECK: [[#%x,ADDR:]] l F __TEXT,__text _foo Index: lld/test/MachO/icf.s =================================================================== --- lld/test/MachO/icf.s +++ lld/test/MachO/icf.s @@ -9,7 +9,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/main.s -o %t/main.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/abs.s -o %t/abs.o -# RUN: %lld -lSystem --icf=all -o %t/main %t/main.o %t/abs.o +# RUN: %lld-mac -lSystem --icf=all -o %t/main %t/main.o %t/abs.o # RUN: llvm-objdump -d --syms %t/main | FileCheck %s # CHECK-LABEL: SYMBOL TABLE: Index: lld/test/MachO/implicit-dylibs.s =================================================================== --- lld/test/MachO/implicit-dylibs.s +++ lld/test/MachO/implicit-dylibs.s @@ -18,28 +18,28 @@ # RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t/libunused.o # RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t/reexporter.o -# RUN: %lld -dylib -lSystem %t/libfoo.o -o %t/libfoo.dylib -# RUN: %lld -dylib -lSystem %t/libtoplevel.o -o %t/usr/lib/libtoplevel.dylib -install_name /usr/lib/libtoplevel.dylib -# RUN: %lld -dylib -lSystem %t/libsublevel.o -o %t/usr/lib/system/libsublevel.dylib -install_name /usr/lib/system/libsublevel.dylib -# RUN: %lld -dylib -lSystem %t/libunused.o -o %t/usr/lib/libunused.dylib -install_name /usr/lib/libunused.dylib +# RUN: %lld-mac -dylib -lSystem %t/libfoo.o -o %t/libfoo.dylib +# RUN: %lld-mac -dylib -lSystem %t/libtoplevel.o -o %t/usr/lib/libtoplevel.dylib -install_name /usr/lib/libtoplevel.dylib +# RUN: %lld-mac -dylib -lSystem %t/libsublevel.o -o %t/usr/lib/system/libsublevel.dylib -install_name /usr/lib/system/libsublevel.dylib +# RUN: %lld-mac -dylib -lSystem %t/libunused.o -o %t/usr/lib/libunused.dylib -install_name /usr/lib/libunused.dylib ## Bar.framework is nested within Foo.framework. -# RUN: %lld -dylib -lSystem %t/framework-bar.o -o %t/System/Library/Frameworks/Foo.framework/Frameworks/Bar.framework/Versions/A/Bar \ +# RUN: %lld-mac -dylib -lSystem %t/framework-bar.o -o %t/System/Library/Frameworks/Foo.framework/Frameworks/Bar.framework/Versions/A/Bar \ # RUN: -install_name /System/Library/Frameworks/Foo.framework/Frameworks/Bar.framework/Versions/A/Bar # RUN: ln -sf Versions/A/Bar \ # RUN: %t/System/Library/Frameworks/Foo.framework/Frameworks/Bar.framework/Bar ## Have Foo re-export Bar. -# RUN: %lld -dylib -F %t/System/Library/Frameworks/Foo.framework/Frameworks \ +# RUN: %lld-mac -dylib -F %t/System/Library/Frameworks/Foo.framework/Frameworks \ # RUN: -framework Bar -sub_umbrella Bar -lSystem %t/framework-foo.o -o %t/System/Library/Frameworks/Foo.framework/Versions/A/Foo \ # RUN: -install_name /System/Library/Frameworks/Foo.framework/Versions/A/Foo # RUN: ln -sf Versions/A/Foo %t/System/Library/Frameworks/Foo.framework/Foo -# RUN: %lld -dylib -lSystem %t/framework-baz.o -o %t/Baz.framework/Versions/A/Baz \ +# RUN: %lld-mac -dylib -lSystem %t/framework-baz.o -o %t/Baz.framework/Versions/A/Baz \ # RUN: -install_name %t/Baz.framework/Versions/A/Baz # RUN: ln -sf Versions/A/Baz %t/Baz.framework/Baz -# RUN: %lld -dylib -syslibroot %t -framework Foo -F %t -framework Baz \ +# RUN: %lld-mac -dylib -syslibroot %t -framework Foo -F %t -framework Baz \ # RUN: -lc++ -ltoplevel -lunused %t/usr/lib/system/libsublevel.dylib %t/libfoo.dylib \ # RUN: -sub_library libc++ -sub_library libfoo -sub_library libtoplevel \ # RUN: -sub_library libsublevel -sub_library libunused \ @@ -47,7 +47,7 @@ # RUN: %t/reexporter.o -o %t/libreexporter.dylib # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %t/test.s -o %t/test.o -# RUN: %lld -syslibroot %t -o %t/test -lSystem -L%t -lreexporter %t/test.o +# RUN: %lld-mac -syslibroot %t -o %t/test -lSystem -L%t -lreexporter %t/test.o # RUN: llvm-objdump --bind --no-show-raw-insn -d %t/test | FileCheck %s # CHECK: Bind table: # CHECK-DAG: __DATA __data {{.*}} pointer 0 libreexporter _foo @@ -61,7 +61,7 @@ # RUN: llvm-otool -l %t/test | FileCheck %s \ # RUN: --check-prefix=LOAD -DDIR=%t --implicit-check-not LC_LOAD_DYLIB ## Check that we don't create duplicate LC_LOAD_DYLIBs. -# RUN: %lld -syslibroot %t -o %t/test -lSystem -L%t -lreexporter -ltoplevel %t/test.o +# RUN: %lld-mac -syslibroot %t -o %t/test -lSystem -L%t -lreexporter -ltoplevel %t/test.o # RUN: llvm-otool -l %t/test | FileCheck %s \ # RUN: --check-prefix=LOAD -DDIR=%t --implicit-check-not LC_LOAD_DYLIB @@ -81,7 +81,7 @@ # LOAD-NEXT: cmdsize # LOAD-NEXT: name /usr/lib/libtoplevel.dylib -# RUN: %lld -no_implicit_dylibs -syslibroot %t -o %t/no-implicit -lSystem -L%t -lreexporter %t/test.o +# RUN: %lld-mac -no_implicit_dylibs -syslibroot %t -o %t/no-implicit -lSystem -L%t -lreexporter %t/test.o # RUN: llvm-objdump --bind --no-show-raw-insn -d %t/no-implicit | FileCheck %s --check-prefix=NO-IMPLICIT # NO-IMPLICIT: Bind table: # NO-IMPLICIT-DAG: __DATA __data {{.*}} pointer 0 libreexporter _foo Index: lld/test/MachO/indirect-symtab.s =================================================================== --- lld/test/MachO/indirect-symtab.s +++ lld/test/MachO/indirect-symtab.s @@ -3,8 +3,8 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/libfoo.s -o %t/libfoo.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/bar.s -o %t/bar.o -# RUN: %lld -dylib %t/libfoo.o -o %t/libfoo.dylib -lSystem -# RUN: %lld %t/test.o %t/bar.o %t/libfoo.dylib -o %t/test -lSystem +# RUN: %lld-mac -dylib %t/libfoo.o -o %t/libfoo.dylib -lSystem +# RUN: %lld-mac %t/test.o %t/bar.o %t/libfoo.dylib -o %t/test -lSystem # RUN: llvm-objdump --macho -d --no-show-raw-insn --indirect-symbols %t/test | FileCheck %s # RUN: llvm-otool -l %t/test | FileCheck --check-prefix=DYSYMTAB %s Index: lld/test/MachO/install-name.s =================================================================== --- lld/test/MachO/install-name.s +++ lld/test/MachO/install-name.s @@ -2,26 +2,26 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t.o %s -# RUN: %no-fatal-warnings-lld --warn-dylib-install-name -o %t.exec %t.o \ +# RUN: %no-fatal-warnings-lld-mac --warn-dylib-install-name -o %t.exec %t.o \ # RUN: -install_name foo 2>&1 | FileCheck --check-prefix=WARN %s # RUN: llvm-objdump --macho --all-headers %t.exec \ # RUN: | FileCheck --check-prefix=NO-ID %s -# RUN: %no-fatal-warnings-lld --warn-dylib-install-name -bundle -o %t.bundle %t.o \ +# RUN: %no-fatal-warnings-lld-mac --warn-dylib-install-name -bundle -o %t.bundle %t.o \ # RUN: -install_name foo 2>&1 | FileCheck --check-prefix=WARN %s # RUN: llvm-objdump --macho --all-headers %t.bundle \ # RUN: | FileCheck --check-prefix=NO-ID %s -# RUN: %lld -bundle -o %t.bundle %t.o -install_name foo 2>&1 +# RUN: %lld-mac -bundle -o %t.bundle %t.o -install_name foo 2>&1 # RUN: llvm-objdump --macho --all-headers %t.bundle \ # RUN: | FileCheck --check-prefix=NO-ID %s -# RUN: %lld -bundle --warn-dylib-install-name --no-warn-dylib-install-name \ +# RUN: %lld-mac -bundle --warn-dylib-install-name --no-warn-dylib-install-name \ # RUN: -o %t.bundle %t.o -install_name foo 2>&1 # RUN: llvm-objdump --macho --all-headers %t.bundle \ # RUN: | FileCheck --check-prefix=NO-ID %s -# RUN: %lld -dylib -o %t.dylib %t.o -install_name foo 2>&1 +# RUN: %lld-mac -dylib -o %t.dylib %t.o -install_name foo 2>&1 # RUN: llvm-objdump --macho --all-headers %t.dylib \ # RUN: | FileCheck --check-prefix=ID %s Index: lld/test/MachO/invalid/abs-duplicate.s =================================================================== --- lld/test/MachO/invalid/abs-duplicate.s +++ lld/test/MachO/invalid/abs-duplicate.s @@ -2,7 +2,7 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weakfoo.s -o %t/weakfoo.o -# RUN: not %lld -lSystem %t/test.o %t/weakfoo.o -o %t/test 2>&1 | FileCheck %s +# RUN: not %lld-mac -lSystem %t/test.o %t/weakfoo.o -o %t/test 2>&1 | FileCheck %s # CHECK: error: duplicate symbol: _weakfoo # CHECK-NEXT: >>> defined in {{.*}}/test.o Index: lld/test/MachO/invalid/alignment-too-large.yaml =================================================================== --- lld/test/MachO/invalid/alignment-too-large.yaml +++ lld/test/MachO/invalid/alignment-too-large.yaml @@ -1,5 +1,5 @@ # RUN: yaml2obj %s -o %t.o -# RUN: not %lld -o %t %t.o 2>&1 | FileCheck %s +# RUN: not %lld-mac -o %t %t.o 2>&1 | FileCheck %s # # CHECK: error: alignment 32 of section __text is too large --- !mach-o Index: lld/test/MachO/invalid/archive-no-index.s =================================================================== --- lld/test/MachO/invalid/archive-no-index.s +++ lld/test/MachO/invalid/archive-no-index.s @@ -7,7 +7,7 @@ # RUN: llvm-ar rcS %t/test.a %t/2.o %t/3.o %t/4.o -# RUN: not %lld %t/test.o %t/test.a -o /dev/null 2>&1 | FileCheck %s +# RUN: not %lld-mac %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 #--- 2.s Index: lld/test/MachO/invalid/arm64-thunk-undefined.s =================================================================== --- lld/test/MachO/invalid/arm64-thunk-undefined.s +++ lld/test/MachO/invalid/arm64-thunk-undefined.s @@ -2,7 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t.o ## This shouldn't assert. -# RUN: not %lld -arch arm64 -lSystem -o %t/thunk %t.o 2>&1 | FileCheck %s +# RUN: not %lld-mac -arch arm64 -lSystem -o %t/thunk %t.o 2>&1 | FileCheck %s # CHECK: error: undefined symbol: _g Index: lld/test/MachO/invalid/bad-archive-member.s =================================================================== --- lld/test/MachO/invalid/bad-archive-member.s +++ lld/test/MachO/invalid/bad-archive-member.s @@ -2,13 +2,13 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o -# RUN: %lld -dylib -lSystem %t/foo.o -o %t/foo.dylib +# RUN: %lld-mac -dylib -lSystem %t/foo.o -o %t/foo.dylib # RUN: llvm-ar rcs %t/foo.a %t/foo.dylib -# RUN: not %lld %t/test.o %t/foo.a -o /dev/null 2>&1 | FileCheck %s \ +# RUN: not %lld-mac %t/test.o %t/foo.a -o /dev/null 2>&1 | FileCheck %s \ # RUN: --check-prefix=SYM -DFILE=%t/foo.a -# RUN: not %lld %t/test.o -ObjC %t/foo.a -o /dev/null 2>&1 | FileCheck %s \ +# RUN: not %lld-mac %t/test.o -ObjC %t/foo.a -o /dev/null 2>&1 | FileCheck %s \ # RUN: --check-prefix=SYM -DFILE=%t/foo.a -# RUN: not %lld %t/test.o -force_load %t/foo.a -o /dev/null 2>&1 | FileCheck %s \ +# RUN: not %lld-mac %t/test.o -force_load %t/foo.a -o /dev/null 2>&1 | FileCheck %s \ # RUN: --check-prefix=FORCE-LOAD -DFILE=%t/foo.a # SYM: error: [[FILE]]: could not get the member defining symbol _foo: foo.dylib has unhandled file type # FORCE-LOAD: error: [[FILE]]: -force_load failed to load archive member: foo.dylib has unhandled file type Index: lld/test/MachO/invalid/bad-archive.s =================================================================== --- lld/test/MachO/invalid/bad-archive.s +++ lld/test/MachO/invalid/bad-archive.s @@ -7,9 +7,9 @@ # RUN: echo "foo" >> %t.a # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: not %lld %t.o %t.a -o /dev/null 2>&1 | FileCheck -DFILE=%t.a %s -# RUN: not %lld %t.o -force_load %t.a -o /dev/null 2>&1 | FileCheck -DFILE=%t.a %s -# RUN: not %lld %t.o -ObjC %t.a -o /dev/null 2>&1 | FileCheck -DFILE=%t.a %s +# RUN: not %lld-mac %t.o %t.a -o /dev/null 2>&1 | FileCheck -DFILE=%t.a %s +# RUN: not %lld-mac %t.o -force_load %t.a -o /dev/null 2>&1 | FileCheck -DFILE=%t.a %s +# RUN: not %lld-mac %t.o -ObjC %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 Index: lld/test/MachO/invalid/bad-got-to-dylib-tlv-reference.s =================================================================== --- lld/test/MachO/invalid/bad-got-to-dylib-tlv-reference.s +++ lld/test/MachO/invalid/bad-got-to-dylib-tlv-reference.s @@ -2,11 +2,11 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/libtlv.s -o %t/libtlv.o -# RUN: %lld -dylib -install_name @executable_path/libtlv.dylib \ +# RUN: %lld-mac -dylib -install_name @executable_path/libtlv.dylib \ # RUN: -lSystem -o %t/libtlv.dylib %t/libtlv.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o -# RUN: not %lld -lSystem -L%t -ltlv -o /dev/null %t/test.o 2>&1 | FileCheck %s -DFILE=%t/test.o +# RUN: not %lld-mac -lSystem -L%t -ltlv -o /dev/null %t/test.o 2>&1 | FileCheck %s -DFILE=%t/test.o # CHECK: error: [[FILE]]:(symbol _main+0x3): GOT_LOAD relocation requires that symbol _foo not be thread-local Index: lld/test/MachO/invalid/bad-got-to-tlv-reference.s =================================================================== --- lld/test/MachO/invalid/bad-got-to-tlv-reference.s +++ lld/test/MachO/invalid/bad-got-to-tlv-reference.s @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: not %lld -o /dev/null %t.o 2>&1 | FileCheck %s -DFILE=%t.o +# RUN: not %lld-mac -o /dev/null %t.o 2>&1 | FileCheck %s -DFILE=%t.o # CHECK: error: [[FILE]]:(symbol _main+0x3): GOT_LOAD relocation requires that symbol _foo not be thread-local Index: lld/test/MachO/invalid/bad-tlv-def.s =================================================================== --- lld/test/MachO/invalid/bad-tlv-def.s +++ lld/test/MachO/invalid/bad-tlv-def.s @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: not %lld -o /dev/null %t.o 2>&1 | FileCheck %s +# RUN: not %lld-mac -o /dev/null %t.o 2>&1 | FileCheck %s # CHECK: error: GOT_LOAD relocation not allowed in thread-local section, must be UNSIGNED Index: lld/test/MachO/invalid/bad-tlv-opcode.s =================================================================== --- lld/test/MachO/invalid/bad-tlv-opcode.s +++ lld/test/MachO/invalid/bad-tlv-opcode.s @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: not %lld -o /dev/null %t.o 2>&1 | FileCheck %s +# RUN: not %lld-mac -o /dev/null %t.o 2>&1 | FileCheck %s # CHECK: error: TLV reloc requires MOVQ instruction Index: lld/test/MachO/invalid/bad-tlv-relocation.s =================================================================== --- lld/test/MachO/invalid/bad-tlv-relocation.s +++ lld/test/MachO/invalid/bad-tlv-relocation.s @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: not %lld -o /dev/null %t.o 2>&1 | FileCheck %s -DFILE=%t.o +# RUN: not %lld-mac -o /dev/null %t.o 2>&1 | FileCheck %s -DFILE=%t.o # CHECK: [[FILE]]:(symbol _main+0x3): TLV relocation requires that symbol _foo be thread-local Index: lld/test/MachO/invalid/cfstring.s =================================================================== --- lld/test/MachO/invalid/cfstring.s +++ lld/test/MachO/invalid/cfstring.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: rm -rf %t; mkdir %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/test.o -# RUN: not %lld -dylib -framework CoreFoundation --icf=all %t/test.o 2>&1 | FileCheck %s +# RUN: not %lld-mac -dylib -framework CoreFoundation --icf=all %t/test.o 2>&1 | FileCheck %s # CHECK: error: {{.*}}test.o:(__cfstring): symbol _uh_oh at misaligned offset .cstring Index: lld/test/MachO/invalid/compact-unwind-bad-reloc.s =================================================================== --- lld/test/MachO/invalid/compact-unwind-bad-reloc.s +++ lld/test/MachO/invalid/compact-unwind-bad-reloc.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/bad-function.s -o %t/bad-function.o -# RUN: not %lld -lSystem -dylib -lc++ %t/bad-function.o -o /dev/null 2>&1 | FileCheck %s +# RUN: not %lld-mac -lSystem -dylib -lc++ %t/bad-function.o -o /dev/null 2>&1 | FileCheck %s # CHECK: error: {{.*}}bad-function.o:(__compact_unwind+0x0) references section __data which is not in segment __TEXT # CHECK: error: {{.*}}bad-function.o:(__compact_unwind+0x20) references section __data which is not in segment __TEXT Index: lld/test/MachO/invalid/compact-unwind-personalities.s =================================================================== --- lld/test/MachO/invalid/compact-unwind-personalities.s +++ lld/test/MachO/invalid/compact-unwind-personalities.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %s -o %t.o -# RUN: not %lld -lSystem -lc++ %t.o -o %t 2>&1 | FileCheck %s --check-prefix=TOO-MANY -# RUN: not %lld -lSystem %t.o -o %t 2>&1 | FileCheck %s --check-prefix=UNDEF +# RUN: not %lld-mac -lSystem -lc++ %t.o -o %t 2>&1 | FileCheck %s --check-prefix=TOO-MANY +# RUN: not %lld-mac -lSystem %t.o -o %t 2>&1 | FileCheck %s --check-prefix=UNDEF # TOO-MANY: error: too many personalities (4) for compact unwind to encode # UNDEF: error: undefined symbol: ___gxx_personality_v0 Index: lld/test/MachO/invalid/cstring-dedup.s =================================================================== --- lld/test/MachO/invalid/cstring-dedup.s +++ lld/test/MachO/invalid/cstring-dedup.s @@ -7,8 +7,8 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/not-terminated.s -o %t/not-terminated.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/relocs.s -o %t/relocs.o -# RUN: not %lld -dylib --deduplicate-literals %t/not-terminated.o 2>&1 | FileCheck %s --check-prefix=TERM -# RUN: not %lld -dylib --deduplicate-literals %t/relocs.o 2>&1 | FileCheck %s --check-prefix=RELOCS +# RUN: not %lld-mac -dylib --deduplicate-literals %t/not-terminated.o 2>&1 | FileCheck %s --check-prefix=TERM +# RUN: not %lld-mac -dylib --deduplicate-literals %t/relocs.o 2>&1 | FileCheck %s --check-prefix=RELOCS # TERM: not-terminated.o:(__cstring+0x4): string is not null terminated # RELOCS: relocs.o contains relocations in __TEXT,__cstring, so LLD cannot deduplicate literals. Try re-running without --deduplicate-literals. Index: lld/test/MachO/invalid/dso-handle-duplicate.s =================================================================== --- lld/test/MachO/invalid/dso-handle-duplicate.s +++ lld/test/MachO/invalid/dso-handle-duplicate.s @@ -7,7 +7,7 @@ ## far-out edge case that should be safe to ignore. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: not %lld -dylib %t.o -o /dev/null 2>&1 | FileCheck %s -DFILE=%t.o +# RUN: not %lld-mac -dylib %t.o -o /dev/null 2>&1 | FileCheck %s -DFILE=%t.o # CHECK: error: duplicate symbol: ___dso_handle # CHECK-NEXT: >>> defined in [[FILE]] # CHECK-NEXT: >>> defined in Index: lld/test/MachO/invalid/duplicate-symbol.ll =================================================================== --- lld/test/MachO/invalid/duplicate-symbol.ll +++ lld/test/MachO/invalid/duplicate-symbol.ll @@ -2,7 +2,7 @@ ; RUN: rm -rf %t; mkdir -p %t ; RUN: opt -module-summary %s -o %t/first.o ; RUN: opt -module-summary %s -o %t/second.o -; RUN: not %lld -dylib -lSystem %t/first.o %t/second.o -o /dev/null 2>&1 | FileCheck %s +; RUN: not %lld-mac -dylib -lSystem %t/first.o %t/second.o -o /dev/null 2>&1 | FileCheck %s ; CHECK: error: duplicate symbol: _foo ; CHECK-NEXT: >>> defined in {{.*}}/first.o ; CHECK-NEXT: >>> defined in {{.*}}/second.o Index: lld/test/MachO/invalid/duplicate-symbol.s =================================================================== --- lld/test/MachO/invalid/duplicate-symbol.s +++ lld/test/MachO/invalid/duplicate-symbol.s @@ -1,8 +1,8 @@ # 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 -o /dev/null %t-dup.o %t.o 2>&1 | FileCheck %s -DFILE_1=%t-dup.o -DFILE_2=%t.o -# RUN: not %lld -o /dev/null %t.o %t.o 2>&1 | FileCheck %s -DFILE_1=%t.o -DFILE_2=%t.o +# RUN: not %lld-mac -o /dev/null %t-dup.o %t.o 2>&1 | FileCheck %s -DFILE_1=%t-dup.o -DFILE_2=%t.o +# RUN: not %lld-mac -o /dev/null %t.o %t.o 2>&1 | FileCheck %s -DFILE_1=%t.o -DFILE_2=%t.o # CHECK: error: duplicate symbol: _main # CHECK-NEXT: >>> defined in [[FILE_1]] Index: lld/test/MachO/invalid/incompatible-arch.s =================================================================== --- lld/test/MachO/invalid/incompatible-arch.s +++ lld/test/MachO/invalid/incompatible-arch.s @@ -4,9 +4,9 @@ # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t/test.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/native.o -# RUN: not %no-fatal-warnings-lld -arch x86_64 -lSystem %t/test.o -o /dev/null -arch_errors_fatal 2>&1 | FileCheck %s -DFILE=%t/test.o --check-prefix=CHECK-ERROR -# RUN: %no-fatal-warnings-lld -arch x86_64 -lSystem %t/test.o %t/native.o -o /dev/null 2>&1 | FileCheck %s -DFILE=%t/test.o --check-prefix=CHECK-WARNING -# RUN: %lld -arch arm64 -lSystem %t/test.o -arch_errors_fatal -o /dev/null +# RUN: not %no-fatal-warnings-lld-mac -arch x86_64 -lSystem %t/test.o -o /dev/null -arch_errors_fatal 2>&1 | FileCheck %s -DFILE=%t/test.o --check-prefix=CHECK-ERROR +# RUN: %no-fatal-warnings-lld-mac -arch x86_64 -lSystem %t/test.o %t/native.o -o /dev/null 2>&1 | FileCheck %s -DFILE=%t/test.o --check-prefix=CHECK-WARNING +# RUN: %lld-mac -arch arm64 -lSystem %t/test.o -arch_errors_fatal -o /dev/null # CHECK-ERROR: error: {{.*}}[[FILE]] has architecture arm64 which is incompatible with target architecture x86_64 # CHECK-WARNING: warning: {{.*}}[[FILE]] has architecture arm64 which is incompatible with target architecture x86_64 @@ -18,7 +18,7 @@ # RUN: %lld -lSystem -dylib -arch arm64 -platform_version macOS 10.14.0 10.15.0 %t/out.dylib -o /dev/null -# RUN: %no-fatal-warnings-lld -lSystem -dylib -arch arm64 -platform_version macOS 10.13.0 10.15.0 %t/out.dylib \ +# RUN: %no-fatal-warnings-lld-mac -lSystem -dylib -arch arm64 -platform_version macOS 10.13.0 10.15.0 %t/out.dylib \ # RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=DYLIB-VERSION # DYLIB-VERSION: warning: {{.*}}out.dylib has version 10.14.0, which is newer than target minimum of 10.13.0 @@ -30,7 +30,7 @@ # RUN: %lld %t/test_x86.o -lSystem -arch x86_64 -platform_version macOS 10.15.0 10.15.0 -o /dev/null -# RUN: %no-fatal-warnings-lld %t/test_x86.o -lSystem -arch x86_64 -platform_version macOS 10.14.0 10.15.0 \ +# RUN: %no-fatal-warnings-lld-mac %t/test_x86.o -lSystem -arch x86_64 -platform_version macOS 10.14.0 10.15.0 \ # RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=OBJ-VERSION # OBJ-VERSION: warning: {{.*}}test_x86.o has version 10.15.0, which is newer than target minimum of 10.14.0 Index: lld/test/MachO/invalid/incompatible-target-tapi.test =================================================================== --- lld/test/MachO/invalid/incompatible-target-tapi.test +++ lld/test/MachO/invalid/incompatible-target-tapi.test @@ -2,7 +2,7 @@ RUN: rm -rf %t; mkdir -p %t RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-macosx -o %t/x86_64-test.o RUN: echo "" | llvm-mc -filetype=obj -triple=arm64-apple-iossimulator -o %t/arm64-test.o -RUN: not %lld -dylib -arch x86_64 %S/Inputs/libincompatible.tbd %t/x86_64-test.o \ +RUN: not %lld-mac -dylib -arch x86_64 %S/Inputs/libincompatible.tbd %t/x86_64-test.o \ RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=ARCH RUN: not %lld -dylib -arch arm64 -platform_version ios-simulator 14.0 15.0 %t/arm64-test.o \ RUN: %S/Inputs/libincompatible.tbd -o /dev/null 2>&1 | FileCheck %s --check-prefix=PLATFORM Index: lld/test/MachO/invalid/invalid-executable.s =================================================================== --- lld/test/MachO/invalid/invalid-executable.s +++ 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 -o %t %t.o -# RUN: not %lld -o /dev/null %t 2>&1 | FileCheck %s -DFILE=%t +# RUN: %lld-mac -o %t %t.o +# RUN: not %lld-mac -o /dev/null %t 2>&1 | FileCheck %s -DFILE=%t # CHECK: error: [[FILE]]: unhandled file type .text Index: lld/test/MachO/invalid/invalid-fat-narch.s =================================================================== --- lld/test/MachO/invalid/invalid-fat-narch.s +++ lld/test/MachO/invalid/invalid-fat-narch.s @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: yaml2obj %s -o %t.o -# RUN: not %lld -o /dev/null %t.o 2>&1 | \ +# RUN: not %lld-mac -o /dev/null %t.o 2>&1 | \ # RUN: FileCheck %s -DFILE=%t.o # CHECK: error: [[FILE]]: fat_arch struct extends beyond end of file Index: lld/test/MachO/invalid/invalid-fat-offset.s =================================================================== --- lld/test/MachO/invalid/invalid-fat-offset.s +++ lld/test/MachO/invalid/invalid-fat-offset.s @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: yaml2obj %s -o %t.o -# RUN: not %lld -o /dev/null %t.o 2>&1 | \ +# RUN: not %lld-mac -o /dev/null %t.o 2>&1 | \ # RUN: FileCheck %s -DFILE=%t.o # CHECK: error: [[FILE]]: slice extends beyond end of file Index: lld/test/MachO/invalid/invalid-relocation-length.yaml =================================================================== --- lld/test/MachO/invalid/invalid-relocation-length.yaml +++ lld/test/MachO/invalid/invalid-relocation-length.yaml @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: yaml2obj %s -o %t.o -# RUN: not %lld -o %t %t.o 2>&1 | FileCheck %s -DFILE=%t.o +# RUN: not %lld-mac -o %t %t.o 2>&1 | FileCheck %s -DFILE=%t.o # # CHECK: error: UNSIGNED relocation has width 2 bytes, but must be 4 or 8 bytes at offset 1 of __TEXT,__text in [[FILE]] Index: lld/test/MachO/invalid/invalid-relocation-pcrel.yaml =================================================================== --- lld/test/MachO/invalid/invalid-relocation-pcrel.yaml +++ lld/test/MachO/invalid/invalid-relocation-pcrel.yaml @@ -2,7 +2,7 @@ # RUN: rm -rf %t; mkdir %t # RUN: yaml2obj %s -o %t/test.o # RUN: llvm-ar rcs %t/test.a %t/test.o -# RUN: not %lld -o /dev/null %t/test.a 2>&1 | FileCheck %s +# RUN: not %lld-mac -o /dev/null %t/test.a 2>&1 | FileCheck %s # # CHECK: error: UNSIGNED relocation must not be PC-relative at offset 1 of __TEXT,__text in {{.*}}test.a(test.o) Index: lld/test/MachO/invalid/invalid-stub.s =================================================================== --- lld/test/MachO/invalid/invalid-stub.s +++ lld/test/MachO/invalid/invalid-stub.s @@ -3,7 +3,7 @@ # RUN: echo "--- !tapi-tbd-v3" > %t/libinvalidYAML.tbd # RUN: echo "invalid YAML" >> %t/libinvalidYAML.tbd # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %s -o %t/test.o -# RUN: not %lld -L%t -linvalidYAML %t/test.o -o %t/test 2>&1 | FileCheck %s -DDIR=%t +# RUN: not %lld-mac -L%t -linvalidYAML %t/test.o -o %t/test 2>&1 | FileCheck %s -DDIR=%t # CHECK: could not load TAPI file at [[DIR]]{{[\\/]}}libinvalidYAML.tbd: malformed file Index: lld/test/MachO/invalid/lto-bitcode-nodatalayout.ll =================================================================== --- lld/test/MachO/invalid/lto-bitcode-nodatalayout.ll +++ lld/test/MachO/invalid/lto-bitcode-nodatalayout.ll @@ -4,7 +4,7 @@ ; REQUIRES: x86 ; RUN: llvm-as %s -o %t.o -; RUN: not %lld %t.o -o /dev/null 2>&1 | FileCheck %s +; RUN: not %lld-mac %t.o -o /dev/null 2>&1 | FileCheck %s ; CHECK: error: input module has no datalayout Index: lld/test/MachO/invalid/missing-dylib.s =================================================================== --- lld/test/MachO/invalid/missing-dylib.s +++ 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 -o %t -lmissing %t.o 2>&1 | FileCheck %s +# RUN: not %lld-mac -o %t -lmissing %t.o 2>&1 | FileCheck %s # CHECK: error: library not found for -lmissing Index: lld/test/MachO/invalid/no-filelist.s =================================================================== --- lld/test/MachO/invalid/no-filelist.s +++ lld/test/MachO/invalid/no-filelist.s @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: not %lld -filelist nonexistent %t.o -o %t 2>&1 | FileCheck -DMSG=%errc_ENOENT %s +# RUN: not %lld-mac -filelist nonexistent %t.o -o %t 2>&1 | FileCheck -DMSG=%errc_ENOENT %s # CHECK: cannot open nonexistent: [[MSG]] .globl _main Index: lld/test/MachO/invalid/no-id-dylink.yaml =================================================================== --- lld/test/MachO/invalid/no-id-dylink.yaml +++ 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 -o %t/no-id-dylink -L%t -lnoid %t/no-id-dylink.o 2>&1 | FileCheck %s +# RUN: not %lld-mac -o %t/no-id-dylink -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 Index: lld/test/MachO/invalid/no-libxar.ll =================================================================== --- lld/test/MachO/invalid/no-libxar.ll +++ lld/test/MachO/invalid/no-libxar.ll @@ -1,7 +1,7 @@ ; REQUIRES: x86 ; UNSUPPORTED: xar ; RUN: opt -module-summary %s -o %t.o -; RUN: not %lld -lSystem -bitcode_bundle %t.o -o /dev/null 2>&1 | FileCheck %s +; RUN: not %lld-mac -lSystem -bitcode_bundle %t.o -o /dev/null 2>&1 | FileCheck %s ; CHECK: error: -bitcode_bundle unsupported because LLD wasn't built with libxar target triple = "x86_64-apple-darwin" Index: lld/test/MachO/invalid/no-such-file.s =================================================================== --- lld/test/MachO/invalid/no-such-file.s +++ lld/test/MachO/invalid/no-such-file.s @@ -1,4 +1,4 @@ # REQUIRES: x86 -# RUN: not %lld -o /dev/null %t-no-such-file.o 2>&1 | FileCheck %s +# RUN: not %lld-mac -o /dev/null %t-no-such-file.o 2>&1 | FileCheck %s # CHECK: error: cannot open {{.*}}no-such-file.o Index: lld/test/MachO/invalid/protected.ll =================================================================== --- lld/test/MachO/invalid/protected.ll +++ lld/test/MachO/invalid/protected.ll @@ -1,6 +1,6 @@ ; REQUIRES: x86 ; RUN: opt -module-summary %s -o %t.o -; RUN: not %lld -dylib -lSystem %t.o -o /dev/null 2>&1 | FileCheck %s +; RUN: not %lld-mac -dylib -lSystem %t.o -o /dev/null 2>&1 | FileCheck %s ; CHECK: error: _foo has protected visibility, which is not supported by Mach-O target triple = "x86_64-apple-macosx10.15.0" Index: lld/test/MachO/invalid/range-check.s =================================================================== --- lld/test/MachO/invalid/range-check.s +++ lld/test/MachO/invalid/range-check.s @@ -3,8 +3,8 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/bar.s -o %t/bar.o -# RUN: %lld -dylib %t/bar.o -o %t/libbar.dylib -# RUN: not %lld -lSystem -o /dev/null %t/libbar.dylib %t/test.o 2>&1 | FileCheck %s +# RUN: %lld-mac -dylib %t/bar.o -o %t/libbar.dylib +# RUN: not %lld-mac -lSystem -o /dev/null %t/libbar.dylib %t/test.o 2>&1 | FileCheck %s # CHECK: error: {{.*}}test.o:(symbol _main+0xd): relocation UNSIGNED is out of range: [[#]] is not in [0, 4294967295]; references _foo # CHECK: error: {{.*}}test.o:(symbol _main+0x3): relocation GOT_LOAD is out of range: [[#]] is not in [-2147483648, 2147483647]; references _foo Index: lld/test/MachO/invalid/reserved-section-name.s =================================================================== --- lld/test/MachO/invalid/reserved-section-name.s +++ lld/test/MachO/invalid/reserved-section-name.s @@ -4,7 +4,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: not %lld -o %t %t.o 2>&1 | FileCheck %s -DFILE=%t.o +# RUN: not %lld-mac -o %t %t.o 2>&1 | FileCheck %s -DFILE=%t.o # CHECK: error: section from [[FILE]] conflicts with synthetic section __DATA_CONST,__got .globl _main Index: lld/test/MachO/invalid/undefined-symbol.s =================================================================== --- lld/test/MachO/invalid/undefined-symbol.s +++ lld/test/MachO/invalid/undefined-symbol.s @@ -3,11 +3,11 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/main.s -o %t/main.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o # RUN: llvm-ar crs %t/foo.a %t/foo.o -# RUN: not %lld --icf=all -o /dev/null %t/main.o 2>&1 | \ +# RUN: not %lld-mac --icf=all -o /dev/null %t/main.o 2>&1 | \ # RUN: FileCheck %s -DSYM=_foo -DFILENAME=%t/main.o -# RUN: not %lld -o /dev/null %t/main.o %t/foo.a 2>&1 | \ +# RUN: not %lld-mac -o /dev/null %t/main.o %t/foo.a 2>&1 | \ # RUN: FileCheck %s -DSYM=_bar -DFILENAME='%t/foo.a(foo.o)' -# RUN: not %lld -o /dev/null %t/main.o -force_load %t/foo.a 2>&1 | \ +# RUN: not %lld-mac -o /dev/null %t/main.o -force_load %t/foo.a 2>&1 | \ # RUN: FileCheck %s -DSYM=_bar -DFILENAME='%t/foo.a(foo.o)' # CHECK: error: undefined symbol: [[SYM]] # CHECK-NEXT: >>> referenced by [[FILENAME]] Index: lld/test/MachO/lc-linker-option.ll =================================================================== --- lld/test/MachO/lc-linker-option.ll +++ lld/test/MachO/lc-linker-option.ll @@ -2,7 +2,7 @@ ; RUN: rm -rf %t; split-file %s %t ; RUN: llvm-as %t/framework.ll -o %t/framework.o -; RUN: %lld -lSystem %t/framework.o -o %t/frame +; RUN: %lld-mac -lSystem %t/framework.o -o %t/frame ; RUN: llvm-otool -l %t/frame | FileCheck --check-prefix=FRAME %s \ ; RUN: --implicit-check-not LC_LOAD_DYLIB ; FRAME: cmd LC_LOAD_DYLIB @@ -17,7 +17,7 @@ ;; which needs -lSystem from LC_LINKER_OPTION to get resolved. ;; The reference to __cxa_allocate_exception will require -lc++ from ;; LC_LINKER_OPTION to get resolved. -; RUN: %lld %t/l.o -o %t/l -framework CoreFoundation +; RUN: %lld-mac %t/l.o -o %t/l -framework CoreFoundation ; RUN: llvm-otool -l %t/l | FileCheck --check-prefix=LIB %s \ ; RUN: --implicit-check-not LC_LOAD_DYLIB ; LIB: cmd LC_LOAD_DYLIB @@ -31,7 +31,7 @@ ; LIB-NEXT: name /usr/lib/libc++abi.dylib ;; Check that we don't create duplicate LC_LOAD_DYLIBs. -; RUN: %lld -lSystem %t/l.o -o %t/l -framework CoreFoundation +; RUN: %lld-mac -lSystem %t/l.o -o %t/l -framework CoreFoundation ; RUN: llvm-otool -l %t/l | FileCheck --check-prefix=LIB2 %s \ ; RUN: --implicit-check-not LC_LOAD_DYLIB ; LIB2: cmd LC_LOAD_DYLIB @@ -45,7 +45,7 @@ ; LIB2-NEXT: name /usr/lib/libc++abi.dylib ; RUN: llvm-as %t/invalid.ll -o %t/invalid.o -; RUN: not %lld %t/invalid.o -o /dev/null 2>&1 | FileCheck --check-prefix=INVALID %s +; RUN: not %lld-mac %t/invalid.o -o /dev/null 2>&1 | FileCheck --check-prefix=INVALID %s ; INVALID: error: -why_load is not allowed in LC_LINKER_OPTION ;; This is a regression test for a dangling string reference issue that occurred @@ -60,14 +60,14 @@ ; RUN: llvm-ar rcs %t/Foo.framework/Foo %t/foo.o ; RUN: llc %t/load-framework-foo.ll -o %t/load-framework-foo.o -filetype=obj ; RUN: llc %t/main.ll -o %t/main.o -filetype=obj -; RUN: %lld %t/load-framework-foo.o %t/main.o -o %t/main -F%t +; RUN: %lld-mac %t/load-framework-foo.o %t/main.o -o %t/main -F%t ; RUN: llvm-objdump --macho --syms %t/main | FileCheck %s --check-prefix=SYMS ;; Make sure -all_load and -ObjC have no effect on libraries loaded via ;; LC_LINKER_OPTION flags. ; RUN: llc %t/load-library-foo.ll -o %t/load-library-foo.o -filetype=obj ; RUN: llvm-ar rcs %t/libfoo.a %t/foo.o -; RUN: %lld -all_load -ObjC %t/load-framework-foo.o %t/load-library-foo.o \ +; RUN: %lld-mac -all_load -ObjC %t/load-framework-foo.o %t/load-library-foo.o \ ; RUN: %t/main.o -o %t/main -F%t -L%t ; RUN: llvm-objdump --macho --syms %t/main | FileCheck %s --check-prefix=SYMS @@ -83,14 +83,14 @@ ; RUN: llc --filetype=obj %t/foo.ll -o %t/Foo.framework/Foo ; RUN: llc --filetype=obj %t/load-framework-twice.ll -o %t/main ;; Order of the object with the LC_LINKER_OPTION vs -framework arg is important. -; RUN: %lld %t/main -F %t -framework Foo -framework Foo -o /dev/null -; RUN: %lld -F %t -framework Foo -framework Foo %t/main -o /dev/null +; RUN: %lld-mac %t/main -F %t -framework Foo -framework Foo -o /dev/null +; RUN: %lld-mac -F %t -framework Foo -framework Foo %t/main -o /dev/null ; RUN: llvm-as %t/foo.ll -o %t/Foo.framework/Foo ; RUN: llvm-as %t/load-framework-twice.ll -o %t/main ;; Order of the object with the LC_LINKER_OPTION vs -framework arg is important. -; RUN: %lld %t/main -F %t -framework Foo -framework Foo -o /dev/null -; RUN: %lld -F %t -framework Foo -framework Foo %t/main -o /dev/null +; RUN: %lld-mac %t/main -F %t -framework Foo -framework Foo -o /dev/null +; RUN: %lld-mac -F %t -framework Foo -framework Foo %t/main -o /dev/null ;--- framework.ll target triple = "x86_64-apple-macosx10.15.0" Index: lld/test/MachO/link-search-at-executable-path.s =================================================================== --- lld/test/MachO/link-search-at-executable-path.s +++ lld/test/MachO/link-search-at-executable-path.s @@ -7,19 +7,19 @@ # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %t/bar.s -o %t/bar.o # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %t/main.s -o %t/main.o -# RUN: %lld -dylib -install_name @executable_path/libfoo.dylib %t/foo.o -o %t/subdir/libfoo.dylib +# RUN: %lld-mac -dylib -install_name @executable_path/libfoo.dylib %t/foo.o -o %t/subdir/libfoo.dylib -# RUN: %lld -dylib -reexport_library %t/subdir/libfoo.dylib %t/bar.o -o %t/libbar.dylib +# RUN: %lld-mac -dylib -reexport_library %t/subdir/libfoo.dylib %t/bar.o -o %t/libbar.dylib ## When linking executables, @executable_path/ in install_name should be replaced ## by the path of the executable. -# RUN: %lld -lSystem %t/main.o %t/libbar.dylib -o %t/subdir/test +# RUN: %lld-mac -lSystem %t/main.o %t/libbar.dylib -o %t/subdir/test ## This doesn't work for non-executables. -# RUN: not %lld -dylib -lSystem %t/main.o %t/libbar.dylib -o %t/subdir/libtest.dylib 2>&1 | FileCheck --check-prefix=ERR %s +# RUN: not %lld-mac -dylib -lSystem %t/main.o %t/libbar.dylib -o %t/subdir/libtest.dylib 2>&1 | FileCheck --check-prefix=ERR %s ## It also doesn't help if the needed reexport isn't next to the library. -# RUN: not %lld -lSystem %t/main.o %t/libbar.dylib -o %t/test 2>&1 | FileCheck --check-prefix=ERR %s +# RUN: not %lld-mac -lSystem %t/main.o %t/libbar.dylib -o %t/test 2>&1 | FileCheck --check-prefix=ERR %s # ERR: error: unable to locate re-export with install name @executable_path/libfoo.dylib #--- foo.s Index: lld/test/MachO/link-search-at-loader-path-symlink.s =================================================================== --- lld/test/MachO/link-search-at-loader-path-symlink.s +++ lld/test/MachO/link-search-at-loader-path-symlink.s @@ -10,16 +10,16 @@ ## The @loader_path-relative path is looked after resolving the symlink. # RUN: mkdir -p %t/Foo1.framework/Versions/A -# RUN: %lld -dylib -install_name @rpath/libbar1.dylib %t/bar.o -o %t/Foo1.framework/Versions/A/libbar1.dylib +# RUN: %lld-mac -dylib -install_name @rpath/libbar1.dylib %t/bar.o -o %t/Foo1.framework/Versions/A/libbar1.dylib -# RUN: %lld -dylib -install_name %t/Foo1.framework/Versions/A/Foo1 %t/foo.o \ +# RUN: %lld-mac -dylib -install_name %t/Foo1.framework/Versions/A/Foo1 %t/foo.o \ # RUN: -reexport_library %t/Foo1.framework/Versions/A/libbar1.dylib \ # RUN: -rpath @loader_path/. \ # RUN: -o %t/Foo1.framework/Versions/A/Foo1 # RUN: ln -sf A %t/Foo1.framework/Versions/Current # RUN: ln -sf Versions/Current/Foo1 %t/Foo1.framework/Foo1 -# RUN: %lld -lSystem -F%t -framework Foo1 %t/test.o -o %t/test1 +# RUN: %lld-mac -lSystem -F%t -framework Foo1 %t/test.o -o %t/test1 ## 2. Test symlink with reexport to @loader_path-relative path directly. ## The @loader_path-relative path is looked after resolving the symlink. @@ -27,15 +27,15 @@ ## (ld64-609, Options.cpp, Options::findFile(), "@loader_path/" handling.) # RUN: mkdir -p %t/Foo2.framework/Versions/A -# RUN: %lld -dylib -install_name @loader_path/libbar2.dylib %t/bar.o -o %t/Foo2.framework/Versions/A/libbar2.dylib +# RUN: %lld-mac -dylib -install_name @loader_path/libbar2.dylib %t/bar.o -o %t/Foo2.framework/Versions/A/libbar2.dylib -# RUN: %lld -dylib -install_name %t/Foo2.framework/Versions/A/Foo2 %t/foo.o \ +# RUN: %lld-mac -dylib -install_name %t/Foo2.framework/Versions/A/Foo2 %t/foo.o \ # RUN: -reexport_library %t/Foo2.framework/Versions/A/libbar2.dylib \ # RUN: -o %t/Foo2.framework/Versions/A/Foo2 # RUN: ln -sf A %t/Foo2.framework/Versions/Current # RUN: ln -sf Versions/Current/Foo2 %t/Foo2.framework/Foo2 -# RUN: %lld -lSystem -F%t -framework Foo2 %t/test.o -o %t/test2 +# RUN: %lld-mac -lSystem -F%t -framework Foo2 %t/test.o -o %t/test2 #--- foo.s .globl _foo Index: lld/test/MachO/link-search-at-loader-path.s =================================================================== --- lld/test/MachO/link-search-at-loader-path.s +++ lld/test/MachO/link-search-at-loader-path.s @@ -7,13 +7,13 @@ # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %t/bar.s -o %t/bar.o # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %t/main.s -o %t/main.o -# RUN: %lld -dylib -install_name @loader_path/libfoo.dylib %t/foo.o -o %t/subdir/libfoo.dylib +# RUN: %lld-mac -dylib -install_name @loader_path/libfoo.dylib %t/foo.o -o %t/subdir/libfoo.dylib ## Test that @loader_path is replaced by the actual path, not by install_name. -# RUN: %lld -dylib -reexport_library %t/subdir/libfoo.dylib -install_name /tmp/libbar.dylib %t/bar.o -o %t/subdir/libbar.dylib +# RUN: %lld-mac -dylib -reexport_library %t/subdir/libfoo.dylib -install_name /tmp/libbar.dylib %t/bar.o -o %t/subdir/libbar.dylib -# RUN: %lld -lSystem %t/main.o %t/subdir/libbar.dylib -o %t/test -# RUN: %lld -dylib -lSystem %t/main.o %t/subdir/libbar.dylib -o %t/libtest.dylib +# RUN: %lld-mac -lSystem %t/main.o %t/subdir/libbar.dylib -o %t/test +# RUN: %lld-mac -dylib -lSystem %t/main.o %t/subdir/libbar.dylib -o %t/libtest.dylib #--- foo.s .globl _foo Index: lld/test/MachO/link-search-at-rpath.s =================================================================== --- lld/test/MachO/link-search-at-rpath.s +++ lld/test/MachO/link-search-at-rpath.s @@ -8,16 +8,16 @@ # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %t/bar.s -o %t/bar.o # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %t/main.s -o %t/main.o -# RUN: %lld -dylib -install_name @rpath/libfoo.dylib %t/foo.o -o %t/subdir/libfoo.dylib +# RUN: %lld-mac -dylib -install_name @rpath/libfoo.dylib %t/foo.o -o %t/subdir/libfoo.dylib -# RUN: %lld -dylib -reexport_library %t/subdir/libfoo.dylib \ +# RUN: %lld-mac -dylib -reexport_library %t/subdir/libfoo.dylib \ # RUN: -rpath @loader_path/../foo \ # RUN: -rpath @loader_path/../subdir \ # RUN: -rpath @loader_path/../foo \ # RUN: %t/bar.o -o %t/subdir2/libbar.dylib -# RUN: %lld -lSystem %t/main.o %t/subdir2/libbar.dylib -o %t/test -# RUN: %lld -dylib -lSystem %t/main.o %t/subdir2/libbar.dylib -o %t/libtest.dylib +# RUN: %lld-mac -lSystem %t/main.o %t/subdir2/libbar.dylib -o %t/test +# RUN: %lld-mac -dylib -lSystem %t/main.o %t/subdir2/libbar.dylib -o %t/libtest.dylib #--- foo.s .globl _foo Index: lld/test/MachO/link-search-order.s =================================================================== --- lld/test/MachO/link-search-order.s +++ lld/test/MachO/link-search-order.s @@ -5,51 +5,51 @@ # RUN: mkdir -p %t %tA %tD # # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %p/Inputs/libhello.s -o %t/hello.o -# RUN: %lld -dylib -install_name @executable_path/libhello.dylib %t/hello.o -o %t/libhello.dylib +# RUN: %lld-mac -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 -dylib -install_name @executable_path/libgoodbye.dylib %t/goodbye.o -o %tD/libgoodbye.dylib +# RUN: %lld-mac -dylib -install_name @executable_path/libgoodbye.dylib %t/goodbye.o -o %tD/libgoodbye.dylib # RUN: llvm-ar --format=darwin crs %tA/libgoodbye.a %t/goodbye.o # # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %s -o %t/test.o ################ default, which is the same as -search_paths_first -# RUN: %lld -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ +# RUN: %lld-mac -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ # RUN: -L%tA -L%tD -L%t -lhello -lgoodbye -lSystem %t/test.o \ # RUN: --print-dylib-search | FileCheck --check-prefix=ARCHIVESEARCH -DPATH=%t %s # RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=ARCHIVE %s ################ Test all permutations of -L%t{A,D} with -search_paths_first -# RUN: %lld -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ +# RUN: %lld-mac -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ # RUN: -L%tA -L%tD -L%t -lhello -lgoodbye -lSystem %t/test.o -search_paths_first # RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=ARCHIVE %s -# RUN: %lld -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ +# RUN: %lld-mac -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ # RUN: -L%tD -L%tA -L%t -lhello -lgoodbye -lSystem %t/test.o -search_paths_first # RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=DYLIB %s -# RUN: %lld -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ +# RUN: %lld-mac -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ # RUN: -L%tA -L%t -lhello -lgoodbye -lSystem %t/test.o -search_paths_first # RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=ARCHIVE %s -# RUN: %lld -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ +# RUN: %lld-mac -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ # RUN: -L%tD -L%t -lhello -lgoodbye -lSystem %t/test.o -search_paths_first # RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=DYLIB %s ################ Test all permutations of -L%t{A,D} with -search_dylibs_first -# RUN: env RC_TRACE_DYLIB_SEARCHING=1 %lld -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ +# RUN: env RC_TRACE_DYLIB_SEARCHING=1 %lld-mac -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ # RUN: -L%tA -L%tD -L%t -lhello -lgoodbye -lSystem %t/test.o -search_dylibs_first \ # RUN: | FileCheck --check-prefix=DYLIBSEARCH -DPATH=%t %s # RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=DYLIB %s -# RUN: %lld -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ +# RUN: %lld-mac -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ # RUN: -L%tD -L%tA -L%t -lhello -lgoodbye -lSystem %t/test.o -search_dylibs_first # RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=DYLIB %s -# RUN: %lld -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ +# RUN: %lld-mac -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ # RUN: -L%tA -L%t -lhello -lgoodbye -lSystem %t/test.o -search_dylibs_first # RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=ARCHIVE %s -# RUN: %lld -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ +# RUN: %lld-mac -L%S/Inputs/MacOSX.sdk/usr/lib -o %t/test -Z \ # RUN: -L%tD -L%t -lhello -lgoodbye -lSystem %t/test.o -search_dylibs_first # RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck --check-prefix=DYLIB %s ################ Test that we try the tbd file before the binary for frameworks too. -# RUN: not %lld -dylib -F %t -framework Foo -o %t --print-dylib-search \ +# RUN: not %lld-mac -dylib -F %t -framework Foo -o %t --print-dylib-search \ # RUN: | FileCheck --check-prefix=FRAMEWORKSEARCH -DPATH=%t %s # DYLIB: @executable_path/libhello.dylib Index: lld/test/MachO/linkedit-contiguity.s =================================================================== --- lld/test/MachO/linkedit-contiguity.s +++ lld/test/MachO/linkedit-contiguity.s @@ -7,10 +7,10 @@ ## the segment. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o -# RUN: %lld %t/foo.o -dylib -o %t/libfoo.dylib +# RUN: %lld-mac %t/foo.o -dylib -o %t/libfoo.dylib # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o -# RUN: %lld -lSystem -adhoc_codesign -o %t/test %t/libfoo.dylib %t/test.o +# RUN: %lld-mac -lSystem -adhoc_codesign -o %t/test %t/libfoo.dylib %t/test.o # RUN: llvm-objdump --macho --all-headers %t/test | FileCheck %s Index: lld/test/MachO/lit.local.cfg =================================================================== --- lld/test/MachO/lit.local.cfg +++ lld/test/MachO/lit.local.cfg @@ -5,11 +5,14 @@ # We specify the most commonly-used archs and platform versions in our tests # here. Tests which need different settings can just append to this, as only # the last value will be used. -# + # Note however that this does not apply to `-syslibroot`: each instance of that # flag will append to the set of library roots. As such, we define a separate # alias for each platform. +# It's also not true for -platform_version, so tests that need a custom +# -platform_version have to use %lld-mac instead of %lld-mac. + lld_watchos = ('ld64.lld -arch arm64_32 -platform_version watchos 7.0 8.0 -syslibroot ' + os.path.join(config.test_source_root, "MachO", "Inputs", "WatchOS.sdk")) config.substitutions.append(('%lld-watchos', lld_watchos + ' -fatal_warnings')) @@ -17,9 +20,14 @@ config.substitutions.append(('%no-arg-lld', 'ld64.lld')) -# Since most of our tests are written around x86_64, we give this platform the -# shortest substitution of "%lld". -lld = ('ld64.lld -arch x86_64 -platform_version macos 10.15 11.0 -syslibroot ' + +# Since most of our tests are written around macOS x86_64, we give this +# platform a short substitution of "%lld_mac". +lld_mac = ('ld64.lld -arch x86_64 -platform_version macos 10.15 11.0 -syslibroot ' + + os.path.join(config.test_source_root, "MachO", "Inputs", "MacOSX.sdk")) +config.substitutions.append(('%lld-mac', lld_mac + ' -fatal_warnings')) +config.substitutions.append(('%no-fatal-warnings-lld-mac', lld_mac)) + +lld = ('ld64.lld -arch x86_64 -syslibroot ' + os.path.join(config.test_source_root, "MachO", "Inputs", "MacOSX.sdk")) config.substitutions.append(('%lld', lld + ' -fatal_warnings')) config.substitutions.append(('%no-fatal-warnings-lld', lld)) Index: lld/test/MachO/literal-dedup.s =================================================================== --- lld/test/MachO/literal-dedup.s +++ lld/test/MachO/literal-dedup.s @@ -2,15 +2,15 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/qux.s -o %t/qux.o -# RUN: %lld -dylib --deduplicate-literals %t/test.o %t/qux.o -o %t/test +# RUN: %lld-mac -dylib --deduplicate-literals %t/test.o %t/qux.o -o %t/test # RUN: llvm-objdump --macho --section="__TEXT,__literals" --section="__DATA,ptrs" --syms %t/test | FileCheck %s # RUN: llvm-readobj --section-headers %t/test | FileCheck %s --check-prefix=HEADER ## Make sure literal deduplication can be overridden or that the later flag wins. -# RUN: %lld -dylib --deduplicate-literals -no_deduplicate %t/test.o %t/qux.o -o %t/no-dedup-test +# RUN: %lld-mac -dylib --deduplicate-literals -no_deduplicate %t/test.o %t/qux.o -o %t/no-dedup-test # RUN: llvm-objdump --macho --section="__TEXT,__literals" --section="__DATA,ptrs" %t/no-dedup-test | FileCheck %s --check-prefix=NO-DEDUP -# RUN: %lld -dylib -no_deduplicate --deduplicate-literals %t/test.o %t/qux.o -o %t/test +# RUN: %lld-mac -dylib -no_deduplicate --deduplicate-literals %t/test.o %t/qux.o -o %t/test # RUN: llvm-objdump --macho --section="__TEXT,__literals" --section="__DATA,ptrs" --syms %t/test | FileCheck %s # RUN: llvm-readobj --section-headers %t/test | FileCheck %s --check-prefix=HEADER Index: lld/test/MachO/load-command-sequence.s =================================================================== --- lld/test/MachO/load-command-sequence.s +++ lld/test/MachO/load-command-sequence.s @@ -2,9 +2,9 @@ # RUN: rm -rf %t && mkdir -p %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/test.o -# RUN: %lld -execute -o %t/exec %t/test.o -lSystem -# RUN: %lld -dylib -o %t/dylib %t/test.o -lSystem -# RUN: %lld -bundle -o %t/bundle %t/test.o -lSystem +# RUN: %lld-mac -execute -o %t/exec %t/test.o -lSystem +# RUN: %lld-mac -dylib -o %t/dylib %t/test.o -lSystem +# RUN: %lld-mac -bundle -o %t/bundle %t/test.o -lSystem # RUN: llvm-objdump --macho --all-headers %t/exec | \ # RUN: FileCheck %s --check-prefixes=EXEC,COMMON Index: lld/test/MachO/load-commands.s =================================================================== --- lld/test/MachO/load-commands.s +++ lld/test/MachO/load-commands.s @@ -1,10 +1,10 @@ # REQUIRES: x86 # RUN: rm -rf %t && mkdir -p %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/test.o -# RUN: %lld -o %t/executable %t/test.o -# RUN: %lld -execute -o %t/explicit-executable %t/test.o -# RUN: %lld -bundle -o %t/bundle %t/test.o -# RUN: %lld -dylib -o %t/dylib %t/test.o +# RUN: %lld-mac -o %t/executable %t/test.o +# RUN: %lld-mac -execute -o %t/explicit-executable %t/test.o +# RUN: %lld-mac -bundle -o %t/bundle %t/test.o +# RUN: %lld-mac -dylib -o %t/dylib %t/test.o ## These load commands should be in every final output binary. # COMMON-DAG: cmd LC_DYLD_INFO_ONLY Index: lld/test/MachO/local-got.s =================================================================== --- lld/test/MachO/local-got.s +++ lld/test/MachO/local-got.s @@ -2,13 +2,13 @@ # RUN: mkdir -p %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %p/Inputs/libhello.s \ # RUN: -o %t/libhello.o -# RUN: %lld -lSystem -dylib -install_name \ +# RUN: %lld-mac -lSystem -dylib -install_name \ # RUN: @executable_path/libhello.dylib %t/libhello.o -o %t/libhello.dylib # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/test.o -# RUN: %lld -lSystem -o %t/test %t/test.o -L%t -lhello +# RUN: %lld-mac -lSystem -o %t/test %t/test.o -L%t -lhello # RUN: llvm-objdump --macho --full-contents --rebase --bind %t/test | FileCheck %s --check-prefixes=CHECK,PIE --match-full-lines -# RUN: %lld -no_pie -data_const -lSystem -o %t/test %t/test.o -L%t -lhello +# RUN: %lld-mac -no_pie -data_const -lSystem -o %t/test %t/test.o -L%t -lhello # RUN: llvm-objdump --macho --full-contents --rebase --bind %t/test | FileCheck %s --check-prefixes=CHECK,NO-PIE --match-full-lines ## Check that the GOT references the cstrings. --full-contents displays the Index: lld/test/MachO/local-private-extern.yaml =================================================================== --- lld/test/MachO/local-private-extern.yaml +++ lld/test/MachO/local-private-extern.yaml @@ -6,7 +6,7 @@ # RUN: rm -rf %t; mkdir %t # RUN: yaml2obj %s > %t/foo.o ## No duplicate symbol conflict since _foo is not extern -# RUN: %lld -dylib %t/foo.o %t/foo.o -o %t/foo +# RUN: %lld-mac -dylib %t/foo.o %t/foo.o -o %t/foo # RUN: llvm-nm -m %t/foo | FileCheck %s ## Note that the symbols in the output are no longer marked as "was a private Index: lld/test/MachO/lto-archive.ll =================================================================== --- lld/test/MachO/lto-archive.ll +++ lld/test/MachO/lto-archive.ll @@ -9,20 +9,20 @@ ; RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/main.s -o %t/main.o ; RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/references-foo.s -o %t/references-foo.o -; RUN: %lld -lSystem %t/references-foo.o %t/foo.a -o /dev/null -why_load | FileCheck %s --check-prefix=FOO +; RUN: %lld-mac -lSystem %t/references-foo.o %t/foo.a -o /dev/null -why_load | FileCheck %s --check-prefix=FOO ; FOO: _foo forced load of {{.+}}foo.a(foo.o) -; RUN: %lld -lSystem -force_load %t/foo.a %t/main.o -o /dev/null -why_load | FileCheck %s --check-prefix=FORCE-LOAD +; RUN: %lld-mac -lSystem -force_load %t/foo.a %t/main.o -o /dev/null -why_load | FileCheck %s --check-prefix=FORCE-LOAD ; FORCE-LOAD: -force_load forced load of {{.+}}foo.a(foo.o) -; RUN: %lld -lSystem -ObjC -framework CoreFoundation %t/objc.a %t/main.o \ +; RUN: %lld-mac -lSystem -ObjC -framework CoreFoundation %t/objc.a %t/main.o \ ; RUN: -o /dev/null -why_load | FileCheck %s --check-prefix=OBJC ; OBJC: _OBJC_CLASS_$_Foo forced load of {{.+}}objc.a(has-objc-symbol.o) ; OBJC: -ObjC forced load of {{.+}}objc.a(has-objc-category.o) -; RUN: %lld -lSystem %t/foo.a %t/main.o -o %t/no-force-load -why_load | count 0 +; RUN: %lld-mac -lSystem %t/foo.a %t/main.o -o %t/no-force-load -why_load | count 0 -; RUN: %lld -lSystem -framework CoreFoundation %t/objc.a %t/main.o -o %t/no-objc -why_load | count 0 +; RUN: %lld-mac -lSystem -framework CoreFoundation %t/objc.a %t/main.o -o %t/no-objc -why_load | count 0 ;--- foo.ll Index: lld/test/MachO/lto-archivecollision.ll =================================================================== --- lld/test/MachO/lto-archivecollision.ll +++ lld/test/MachO/lto-archivecollision.ll @@ -5,12 +5,12 @@ ; RUN: opt -thinlto-bc -o %t/a/bar.o %t/foo.ll ; RUN: opt -thinlto-bc -o %t/b/bar.o %t/bar.ll ; RUN: llvm-ar crs %t/libbar.a %t/a/bar.o %t/b/bar.o -; RUN: %lld -save-temps %t/main.o %t/libbar.a -o %t/test +; RUN: %lld-mac -save-temps %t/main.o %t/libbar.a -o %t/test ; RUN: FileCheck %s --check-prefix=SAME-ARCHIVE < %t/test.resolution.txt ; RUN: llvm-ar crs %t/liba.a %t/a/bar.o ; RUN: llvm-ar crs %t/libb.a %t/b/bar.o -; RUN: %lld -save-temps %t/main.o %t/liba.a %t/libb.a -o %t/test +; RUN: %lld-mac -save-temps %t/main.o %t/liba.a %t/libb.a -o %t/test ; RUN: FileCheck %s --check-prefix=DIFFERENT-ARCHIVES < %t/test.resolution.txt ; SAME-ARCHIVE: libbar.abar.o[[#OFFSET:]] Index: lld/test/MachO/lto-cache-dsymutil.ll =================================================================== --- lld/test/MachO/lto-cache-dsymutil.ll +++ lld/test/MachO/lto-cache-dsymutil.ll @@ -2,7 +2,7 @@ ; RUN: rm -rf %t; mkdir %t ; RUN: opt -module-hash -module-summary %s -o %t/foo.o -; RUN: %lld -cache_path_lto %t/cache -o %t/test %t/foo.o +; RUN: %lld-mac -cache_path_lto %t/cache -o %t/test %t/foo.o ;; Check that dsymutil is able to read the .o file out of the thinlto cache. ; RUN: dsymutil -f -o - %t/test | llvm-dwarfdump - | FileCheck %s Index: lld/test/MachO/lto-cache.ll =================================================================== --- lld/test/MachO/lto-cache.ll +++ lld/test/MachO/lto-cache.ll @@ -10,7 +10,7 @@ ;; Create two files that would be removed by cache pruning due to age. ;; We should only remove files matching the pattern "llvmcache-*". ; RUN: touch -t 197001011200 %t/cache/llvmcache-baz %t/cache/baz -; RUN: %lld -cache_path_lto %t/cache \ +; RUN: %lld-mac -cache_path_lto %t/cache \ ; RUN: --thinlto-cache-policy=prune_after=1h:prune_interval=0s \ ; RUN: -o %t/test %t/foo.o %t/bar.o @@ -19,7 +19,7 @@ ;; Same thing, but with `-prune_after_lto` ; RUN: touch -t 197001011200 %t/cache/llvmcache-baz -; RUN: %lld -cache_path_lto %t/cache -prune_after_lto 3600 -prune_interval_lto 0 \ +; RUN: %lld-mac -cache_path_lto %t/cache -prune_after_lto 3600 -prune_interval_lto 0 \ ; RUN: -o %t/test %t/foo.o %t/bar.o ; RUN: ls %t/cache | count 4 @@ -27,7 +27,7 @@ ; RUN: %python -c "print(' ' * 65536)" > %t/cache/llvmcache-baz ;; This should leave the file in place. -; RUN: %lld -cache_path_lto %t/cache \ +; RUN: %lld-mac -cache_path_lto %t/cache \ ; RUN: --thinlto-cache-policy=cache_size_bytes=128k:prune_interval=0s \ ; RUN: -o %t/test %t/foo.o %t/bar.o ; RUN: ls %t/cache | count 5 @@ -38,13 +38,13 @@ ; RUN: %t/cache/llvmcache-baz ;; This should remove it. -; RUN: %lld -cache_path_lto %t/cache \ +; RUN: %lld-mac -cache_path_lto %t/cache \ ; RUN: --thinlto-cache-policy=cache_size_bytes=32k:prune_interval=0s \ ; RUN: -o %t/test %t/foo.o %t/bar.o ; RUN: ls %t/cache | count 4 ;; Delete everything except for the timestamp, "baz" and one cache file. -; RUN: %lld -cache_path_lto %t/cache \ +; RUN: %lld-mac -cache_path_lto %t/cache \ ; RUN: --thinlto-cache-policy=prune_after=0s:cache_size=0%:cache_size_files=1:prune_interval=0s \ ; RUN: -o %t/test %t/foo.o %t/bar.o ; RUN: ls %t/cache | count 3 @@ -56,13 +56,13 @@ ; RUN: touch -t 198002011200 %t/cache/llvmcache-old ; RUN: echo xyz > %t/cache/llvmcache-newer ; RUN: touch -t 198002021200 %t/cache/llvmcache-newer -; RUN: %lld -cache_path_lto %t/cache \ +; RUN: %lld-mac -cache_path_lto %t/cache \ ; RUN: --thinlto-cache-policy=prune_after=0s:cache_size=0%:cache_size_files=3:prune_interval=0s \ ; RUN: -o %t/test %t/foo.o %t/bar.o ; RUN: ls %t/cache | FileCheck %s ;; Check that `-max_relative_cache_size_lto` is a legal argument. -; RUN: %lld -cache_path_lto %t/cache -max_relative_cache_size_lto 10 \ +; RUN: %lld-mac -cache_path_lto %t/cache -max_relative_cache_size_lto 10 \ ; RUN: -o %t/test %t/foo.o %t/bar.o ; CHECK-NOT: llvmcache-old Index: lld/test/MachO/lto-codemodel.ll =================================================================== --- lld/test/MachO/lto-codemodel.ll +++ lld/test/MachO/lto-codemodel.ll @@ -1,7 +1,7 @@ ; REQUIRES: x86 ; RUN: llvm-as %s -o %t.o -; RUN: %lld -lSystem %t.o -o %ts -mllvm -code-model=small -; RUN: %lld -lSystem %t.o -o %tl -mllvm -code-model=large +; RUN: %lld-mac -lSystem %t.o -o %ts -mllvm -code-model=small +; RUN: %lld-mac -lSystem %t.o -o %tl -mllvm -code-model=large ; RUN: llvm-objdump -d %ts | FileCheck %s --check-prefix=CHECK-SMALL ; RUN: llvm-objdump -d %tl | FileCheck %s --check-prefix=CHECK-LARGE Index: lld/test/MachO/lto-common-symbol-coalescing.ll =================================================================== --- lld/test/MachO/lto-common-symbol-coalescing.ll +++ lld/test/MachO/lto-common-symbol-coalescing.ll @@ -14,9 +14,9 @@ ;; ld64: Common bitcode symbols all have equal precedence, regardless of size or ;; alignment. ;; lld: We pick the symbol with the larger size, regardless of alignment. -; RUN: %lld -dylib %t/test.o %t/smaller-size.o -order_file %t/order -o %t/test +; RUN: %lld-mac -dylib %t/test.o %t/smaller-size.o -order_file %t/order -o %t/test ; RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#SIZE=2 -D#ALIGN=8 -; RUN: %lld -dylib %t/smaller-size.o %t/test.o -order_file %t/order -o %t/test +; RUN: %lld-mac -dylib %t/smaller-size.o %t/test.o -order_file %t/order -o %t/test ; RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#SIZE=2 -D#ALIGN=8 ; COM (ld64): llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#SIZE=1 -D#ALIGN=16 @@ -24,24 +24,24 @@ ;; alignment. ;; lld: When the sizes are equal, we pick the symbol whose file occurs later in ;; the command-line argument list. -; RUN: %lld -dylib %t/test.o %t/same-size.o -order_file %t/order -o %t/test +; RUN: %lld-mac -dylib %t/test.o %t/same-size.o -order_file %t/order -o %t/test ; RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#SIZE=2 -D#ALIGN=16 ; COM (ld64): llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#SIZE=2 -D#ALIGN=8 -; RUN: %lld -dylib %t/same-size.o %t/test.o -order_file %t/order -o %t/test +; RUN: %lld-mac -dylib %t/same-size.o %t/test.o -order_file %t/order -o %t/test ; RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#SIZE=2 -D#ALIGN=8 ;; ld64: Non-bitcode common symbols take precedence. ;; lld: We pick the symbol with the larger size, regardless of alignment. -; RUN: %lld -dylib %t/test.o %t/smaller-size-asm.o -order_file %t/order -o %t/test +; RUN: %lld-mac -dylib %t/test.o %t/smaller-size-asm.o -order_file %t/order -o %t/test ; RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#SIZE=2 -D#ALIGN=8 ; COM (ld64): llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#SIZE=1 -D#ALIGN=16 -; RUN: %lld -dylib %t/smaller-size-asm.o %t/test.o -order_file %t/order -o %t/test +; RUN: %lld-mac -dylib %t/smaller-size-asm.o %t/test.o -order_file %t/order -o %t/test ; RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#SIZE=2 -D#ALIGN=8 ; COM (ld64): llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#SIZE=1 -D#ALIGN=16 -; RUN: %lld -dylib %t/test.o %t/same-size-asm.o -order_file %t/order -o %t/test +; RUN: %lld-mac -dylib %t/test.o %t/same-size-asm.o -order_file %t/order -o %t/test ; RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#SIZE=2 -D#ALIGN=16 -; RUN: %lld -dylib %t/same-size-asm.o %t/test.o -order_file %t/order -o %t/test +; RUN: %lld-mac -dylib %t/same-size-asm.o %t/test.o -order_file %t/order -o %t/test ; RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#SIZE=2 -D#ALIGN=8 ; COM (ld64): llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#SIZE=2 -D#ALIGN=16 Index: lld/test/MachO/lto-common-symbol-resolution.ll =================================================================== --- lld/test/MachO/lto-common-symbol-resolution.ll +++ lld/test/MachO/lto-common-symbol-resolution.ll @@ -12,7 +12,7 @@ ; RUN: opt -module-summary %t/refs-foo.ll -o %t/refs-foo.o ; RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weak-defined.s -o %t/weak-defined-asm.o -; RUN: %lld -dylib -dylib %t/libfoo.o -o %t/libfoo.dylib +; RUN: %lld-mac -dylib -dylib %t/libfoo.o -o %t/libfoo.dylib ; RUN: llvm-ar rcs %t/defined.a %t/defined.o ; RUN: llvm-ar rcs %t/defined-and-common.a %t/defined.o %t/common.o @@ -21,46 +21,46 @@ ; RUN: llvm-ar rcs %t/common-and-weak-defined.a %t/common.o %t/weak-defined.o ;; Defined symbols take precedence over common bitcode symbols. -; RUN: %lld -dylib %t/defined.o %t/common.o -o %t/test +; RUN: %lld-mac -dylib %t/defined.o %t/common.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=DEFINED -; RUN: %lld -dylib %t/common.o %t/defined.o -o %t/test +; RUN: %lld-mac -dylib %t/common.o %t/defined.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=DEFINED ;; Defined symbols have the same precedence as common bitcode symbols within ;; an archive. -; RUN: %lld -dylib %t/defined-and-common.a %t/refs-foo.o -o %t/refs-foo +; RUN: %lld-mac -dylib %t/defined-and-common.a %t/refs-foo.o -o %t/refs-foo ; RUN: llvm-objdump --syms %t/refs-foo | FileCheck %s --check-prefix=DEFINED -; RUN: %lld -dylib %t/common-and-defined.a %t/refs-foo.o -o %t/refs-foo +; RUN: %lld-mac -dylib %t/common-and-defined.a %t/refs-foo.o -o %t/refs-foo ; RUN: llvm-objdump --syms %t/refs-foo | FileCheck %s --check-prefix=COMMON ;; ld64: Weak bitcode symbols have the same precedence as common bitcode symbols. ;; lld: Weak bitcode symbols take precedence over common bitcode symbols. -; RUN: %lld -dylib %t/weak-defined.o %t/common.o -o %t/test +; RUN: %lld-mac -dylib %t/weak-defined.o %t/common.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=WEAK-DEFINED -; RUN: %lld -dylib %t/common.o %t/weak-defined.o -o %t/test +; RUN: %lld-mac -dylib %t/common.o %t/weak-defined.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=WEAK-DEFINED ;; Weak non-bitcode symbols take precedence over common bitcode symbols. -; RUN: %lld -dylib %t/weak-defined-asm.o %t/common.o -o %t/test +; RUN: %lld-mac -dylib %t/weak-defined-asm.o %t/common.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=WEAK-DEFINED -; RUN: %lld -dylib %t/common.o %t/weak-defined-asm.o -o %t/test +; RUN: %lld-mac -dylib %t/common.o %t/weak-defined-asm.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=WEAK-DEFINED ;; ld64: Archive symbols take precedence over common bitcode symbols. ;; lld: Common bitcode symbols take precedence over archive symbols. -; RUN: %lld -dylib %t/defined.a %t/common.o -o %t/test +; RUN: %lld-mac -dylib %t/defined.a %t/common.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=COMMON ; COM (ld64): llvm-objdump --syms %t/test | FileCheck %s --check-prefix=DEFINED -; RUN: %lld -dylib %t/common.o %t/defined.a -o %t/test +; RUN: %lld-mac -dylib %t/common.o %t/defined.a -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=COMMON ; COM (ld64): llvm-objdump --syms %t/test | FileCheck %s --check-prefix=DEFINED ;; ld64: Dylib symbols take precedence over common bitcode symbols. ;; lld: Common bitcode symbols take precedence over dylib symbols. -; RUN: %lld -dylib %t/libfoo.dylib %t/common.o %t/refs-foo.o -o %t/test +; RUN: %lld-mac -dylib %t/libfoo.dylib %t/common.o %t/refs-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=COMMON ; COM (ld64): llvm-objdump --syms %t/test | FileCheck %s --check-prefix=DYLIB -; RUN: %lld -dylib %t/common.o %t/libfoo.dylib %t/refs-foo.o -o %t/test +; RUN: %lld-mac -dylib %t/common.o %t/libfoo.dylib %t/refs-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=COMMON ; COM (ld64): llvm-objdump --syms %t/test | FileCheck %s --check-prefix=DYLIB Index: lld/test/MachO/lto-cpu-string.ll =================================================================== --- lld/test/MachO/lto-cpu-string.ll +++ lld/test/MachO/lto-cpu-string.ll @@ -1,11 +1,11 @@ ; REQUIRES: x86 ; RUN: llvm-as %s -o %t.o -; RUN: %lld %t.o -o %t.dylib -dylib +; RUN: %lld-mac %t.o -o %t.dylib -dylib ; RUN: llvm-objdump -d --section="__text" --no-leading-addr --no-show-raw-insn %t.dylib | FileCheck %s ; CHECK: nop{{$}} -; RUN: %lld -mcpu znver1 %t.o -o %t.znver1.dylib -dylib +; RUN: %lld-mac -mcpu znver1 %t.o -o %t.znver1.dylib -dylib ; RUN: llvm-objdump -d --section="__text" --no-leading-addr --no-show-raw-insn %t.znver1.dylib | FileCheck %s --check-prefix=ZNVER1 ; ZNVER1: nopw Index: lld/test/MachO/lto-final-definition.ll =================================================================== --- lld/test/MachO/lto-final-definition.ll +++ lld/test/MachO/lto-final-definition.ll @@ -1,9 +1,9 @@ ; REQUIRES: x86 ; RUN: rm -rf %t; mkdir %t ; RUN: llvm-as %s -o %t/test.o -; RUN: %lld -lSystem -dylib %t/test.o -o %t/test -save-temps +; RUN: %lld-mac -lSystem -dylib %t/test.o -o %t/test -save-temps ; RUN: llvm-dis %t/test.0.2.internalize.bc -o - | FileCheck %s -; RUN: %lld -lSystem -dylib %t/test.o -o %t/flat-namespace.dylib -save-temps \ +; RUN: %lld-mac -lSystem -dylib %t/test.o -o %t/flat-namespace.dylib -save-temps \ ; RUN: -flat_namespace ; RUN: llvm-dis %t/flat-namespace.dylib.0.2.internalize.bc -o - | FileCheck %s \ ; RUN: --check-prefix=NO-DSO-LOCAL Index: lld/test/MachO/lto-internalize-unnamed-addr.ll =================================================================== --- lld/test/MachO/lto-internalize-unnamed-addr.ll +++ lld/test/MachO/lto-internalize-unnamed-addr.ll @@ -7,21 +7,21 @@ ; RUN: opt -module-summary %t/test.ll -o %t/test.thinlto.o ; RUN: opt -module-summary %t/test2.ll -o %t/test2.thinlto.o -; RUN: %lld -lSystem %t/test.o %t/test2.o -o %t/test -save-temps +; RUN: %lld-mac -lSystem %t/test.o %t/test2.o -o %t/test -save-temps ; RUN: llvm-dis < %t/test.0.2.internalize.bc | FileCheck %s --check-prefix=LTO-BC ; RUN: llvm-nm -m %t/test | FileCheck %s --check-prefix=LTO -; RUN: %lld -lSystem -dylib %t/test.o %t/test2.o -o %t/test.dylib -save-temps +; RUN: %lld-mac -lSystem -dylib %t/test.o %t/test2.o -o %t/test.dylib -save-temps ; RUN: llvm-dis < %t/test.dylib.0.2.internalize.bc | FileCheck %s --check-prefix=LTO-BC-DYLIB ; RUN: llvm-nm -m %t/test.dylib | FileCheck %s --check-prefix=LTO-DYLIB -; RUN: %lld -lSystem %t/test.thinlto.o %t/test2.thinlto.o -o %t/test.thinlto \ +; RUN: %lld-mac -lSystem %t/test.thinlto.o %t/test2.thinlto.o -o %t/test.thinlto \ ; RUN: -save-temps ; RUN: llvm-dis < %t/test.thinlto.o.2.internalize.bc | FileCheck %s --check-prefix=THINLTO-BC ; RUN: llvm-dis < %t/test2.thinlto.o.2.internalize.bc | FileCheck %s --check-prefix=THINLTO-BC-2 ; RUN: llvm-nm -m %t/test.thinlto | FileCheck %s --check-prefix=THINLTO -; RUN: %lld -lSystem -dylib %t/test.thinlto.o %t/test2.thinlto.o -o \ +; RUN: %lld-mac -lSystem -dylib %t/test.thinlto.o %t/test2.thinlto.o -o \ ; RUN: %t/test.thinlto.dylib -save-temps ; RUN: llvm-dis < %t/test.thinlto.o.2.internalize.bc | FileCheck %s --check-prefix=THINLTO-BC ; RUN: llvm-dis < %t/test2.thinlto.o.2.internalize.bc | FileCheck %s --check-prefix=THINLTO-BC-2 Index: lld/test/MachO/lto-internalize.ll =================================================================== --- lld/test/MachO/lto-internalize.ll +++ lld/test/MachO/lto-internalize.ll @@ -8,7 +8,7 @@ ; RUN: llvm-as %t/test.s -o %t/test.o ; RUN: llvm-as %t/baz.s -o %t/baz.o ; RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/regular.s -o %t/regular.o -; RUN: %lld -lSystem %t/test.o %t/baz.o %t/regular.o -o %t/test -save-temps +; RUN: %lld-mac -lSystem %t/test.o %t/baz.o %t/regular.o -o %t/test -save-temps ; RUN: llvm-dis < %t/test.0.2.internalize.bc | FileCheck %s ; RUN: llvm-objdump --macho --syms %t/test | FileCheck %s --check-prefix=SYMTAB @@ -39,12 +39,12 @@ ; SYMTAB-DAG: *UND* dyld_stub_binder ; SYMTAB-EMPTY: -; RUN: %lld -lSystem -dylib %t/test.o %t/baz.o %t/regular.o -o %t/test.dylib -save-temps +; RUN: %lld-mac -lSystem -dylib %t/test.o %t/baz.o %t/regular.o -o %t/test.dylib -save-temps ; RUN: llvm-dis < %t/test.dylib.0.2.internalize.bc | FileCheck %s --check-prefix=DYN ; RUN: llvm-nm -m %t/test.dylib | FileCheck %s --check-prefix=DYN-SYMS \ ; RUN: --implicit-check-not _foo -; RUN: %lld -lSystem -export_dynamic %t/test.o %t/baz.o %t/regular.o -o %t/test.extdyn -save-temps +; RUN: %lld-mac -lSystem -export_dynamic %t/test.o %t/baz.o %t/regular.o -o %t/test.extdyn -save-temps ; RUN: llvm-dis < %t/test.extdyn.0.2.internalize.bc ; RUN: llvm-nm -m %t/test.extdyn | FileCheck %s --check-prefix=DYN-SYMS \ ; RUN: --implicit-check-not _foo Index: lld/test/MachO/lto-irmover-warning.ll =================================================================== --- lld/test/MachO/lto-irmover-warning.ll +++ lld/test/MachO/lto-irmover-warning.ll @@ -2,7 +2,7 @@ ; RUN: rm -rf %t; split-file %s %t ; RUN: llvm-as -o %t/first.bc %t/first.ll ; RUN: llvm-as -o %t/second.bc %t/second.ll -; RUN: %no-fatal-warnings-lld -dylib %t/first.bc %t/second.bc -o /dev/null 2>&1 | FileCheck %s +; RUN: %no-fatal-warnings-lld-mac -dylib %t/first.bc %t/second.bc -o /dev/null 2>&1 | FileCheck %s ;; FIXME: can we replace ld-temp.o with a proper name? ; CHECK: warning: linking module flags 'foo': IDs have conflicting values ('i32 2' from {{.*}}second.bc with 'i32 1' from ld-temp.o) Index: lld/test/MachO/lto-linkonce.ll =================================================================== --- lld/test/MachO/lto-linkonce.ll +++ lld/test/MachO/lto-linkonce.ll @@ -2,9 +2,9 @@ ; RUN: rm -rf %t; split-file %s %t ; RUN: opt -module-summary %t/first.ll -o %t/first.o ; RUN: opt -module-summary %t/second.ll -o %t/second.o -; RUN: %lld -dylib -lSystem %t/first.o %t/second.o -o %t/12 +; RUN: %lld-mac -dylib -lSystem %t/first.o %t/second.o -o %t/12 ; RUN: llvm-objdump --syms %t/12 | FileCheck %s --check-prefix=FIRST -; RUN: %lld -dylib -lSystem %t/second.o %t/first.o -o %t/21 +; RUN: %lld-mac -dylib -lSystem %t/second.o %t/first.o -o %t/21 ; RUN: llvm-objdump --syms %t/21 | FileCheck %s --check-prefix=SECOND ; FIRST: w O __TEXT,first _foo Index: lld/test/MachO/lto-mattrs.ll =================================================================== --- lld/test/MachO/lto-mattrs.ll +++ lld/test/MachO/lto-mattrs.ll @@ -3,10 +3,10 @@ ;; Verify that LTO behavior can be tweaked using -mattr. -; RUN: %lld -mcpu haswell -mllvm -mattr=+fma %t.o -o %t.dylib -dylib +; RUN: %lld-mac -mcpu haswell -mllvm -mattr=+fma %t.o -o %t.dylib -dylib ; RUN: llvm-objdump -d --section="__text" --no-leading-addr --no-show-raw-insn %t.dylib | FileCheck %s --check-prefix=FMA -; RUN: %lld -mcpu haswell -mllvm -mattr=-fma %t.o -o %t.dylib -dylib +; RUN: %lld-mac -mcpu haswell -mllvm -mattr=-fma %t.o -o %t.dylib -dylib ; RUN: llvm-objdump -d --section="__text" --no-leading-addr --no-show-raw-insn %t.dylib | FileCheck %s --check-prefix=NO-FMA ; FMA: <_foo>: Index: lld/test/MachO/lto-module-asm-err.ll =================================================================== --- lld/test/MachO/lto-module-asm-err.ll +++ lld/test/MachO/lto-module-asm-err.ll @@ -1,13 +1,13 @@ ; REQUIRES: x86 ; RUN: llvm-as %s -o %t.bc -; RUN: not %lld %t.bc -o /dev/null 2>&1 | FileCheck %s --check-prefix=REGULAR +; RUN: not %lld-mac %t.bc -o /dev/null 2>&1 | FileCheck %s --check-prefix=REGULAR ;; For regular LTO, the original module name is lost. ;; TODO Fix the line number ; REGULAR: error: ld-temp.o :3:1: invalid instruction mnemonic 'invalid' ; RUN: opt -module-summary %s -o %t.bc -; RUN: not %lld %t.bc -o /dev/null 2>&1 | FileCheck %s --check-prefix=THIN +; RUN: not %lld-mac %t.bc -o /dev/null 2>&1 | FileCheck %s --check-prefix=THIN ; THIN: error: {{.*}}.bc :2:1: invalid instruction mnemonic 'invalid' Index: lld/test/MachO/lto-module-asm.ll =================================================================== --- lld/test/MachO/lto-module-asm.ll +++ lld/test/MachO/lto-module-asm.ll @@ -1,6 +1,6 @@ ; REQUIRES: x86 ; RUN: llvm-as %s -o %t.o -; RUN: %lld %t.o -o %t +; RUN: %lld-mac %t.o -o %t ; RUN: llvm-objdump -d %t | FileCheck %s ; CHECK: <_foo>: Index: lld/test/MachO/lto-objc-arc-contract.ll =================================================================== --- lld/test/MachO/lto-objc-arc-contract.ll +++ lld/test/MachO/lto-objc-arc-contract.ll @@ -5,11 +5,11 @@ ;; which doesn't know how to handle it. ; RUN: llvm-as %s -o %t.o -; RUN: %lld -dylib -lSystem %t.o -o %t --no-lto-legacy-pass-manager +; RUN: %lld-mac -dylib -lSystem %t.o -o %t --no-lto-legacy-pass-manager ; RUN: llvm-objdump -d %t | FileCheck %s ; RUN: opt -module-summary %s -o %t.o -; RUN: %lld -dylib -lSystem %t.o -o %t --no-lto-legacy-pass-manager +; RUN: %lld-mac -dylib -lSystem %t.o -o %t --no-lto-legacy-pass-manager ; RUN: llvm-objdump -d %t | FileCheck %s ; CHECK: <_foo>: Index: lld/test/MachO/lto-object-path.ll =================================================================== --- lld/test/MachO/lto-object-path.ll +++ lld/test/MachO/lto-object-path.ll @@ -4,10 +4,10 @@ ; RUN: rm -rf %t; mkdir %t ; RUN: llvm-as %s -o %t/test.o -; RUN: %lld %t/test.o -o %t/test +; RUN: %lld-mac %t/test.o -o %t/test ; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes CHECK,NOOBJPATH -; RUN: %lld %t/test.o -o %t/test -object_path_lto %t/lto-temps +; RUN: %lld-mac %t/test.o -o %t/test -object_path_lto %t/lto-temps ; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes CHECK,OBJPATH -DDIR=%t/lto-temps ; CHECK: 0000000000000000 - 00 0000 SO /tmp/test.cpp Index: lld/test/MachO/lto-opt-level.ll =================================================================== --- lld/test/MachO/lto-opt-level.ll +++ lld/test/MachO/lto-opt-level.ll @@ -3,13 +3,13 @@ ; RUN: rm -rf %t; mkdir %t ; RUN: llvm-as %s -o %t/test.o -; RUN: %lld %t/test.o --lto-O0 -o %t/test +; RUN: %lld-mac %t/test.o --lto-O0 -o %t/test ; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes=CHECK-O0 -; RUN: %lld %t/test.o --lto-O2 -o %t/test +; RUN: %lld-mac %t/test.o --lto-O2 -o %t/test ; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes=CHECK-O2 -; RUN: %lld %t/test.o -o %t/test +; RUN: %lld-mac %t/test.o -o %t/test ; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes=CHECK-O2 ; CHECK-O0: foo Index: lld/test/MachO/lto-save-temps.ll =================================================================== --- lld/test/MachO/lto-save-temps.ll +++ lld/test/MachO/lto-save-temps.ll @@ -6,14 +6,14 @@ ; RUN: rm -rf %t; split-file %s %t ; RUN: llvm-as %t/foo.ll -o %t/foo.o ; RUN: llvm-as %t/bar.ll -o %t/bar.o -; RUN: %lld -dylib -save-temps %t/foo.o %t/bar.o -o %t/test +; RUN: %lld-mac -dylib -save-temps %t/foo.o %t/bar.o -o %t/test ; RUN: llvm-objdump -d --no-show-raw-insn %t/test.lto.o | FileCheck %s --check-prefix=ALL ; RUN: llvm-objdump -d --no-show-raw-insn %t/test | FileCheck %s --check-prefix=ALL ; RUN: rm -rf %t; split-file %s %t ; RUN: opt -module-summary %t/foo.ll -o %t/foo.o ; RUN: opt -module-summary %t/bar.ll -o %t/bar.o -; RUN: %lld -dylib -save-temps %t/foo.o %t/bar.o -o %t/test +; RUN: %lld-mac -dylib -save-temps %t/foo.o %t/bar.o -o %t/test ; RUN: llvm-objdump -d --no-show-raw-insn %t/test1.lto.o | FileCheck %s --check-prefix=FOO ; RUN: llvm-objdump -d --no-show-raw-insn %t/test2.lto.o | FileCheck %s --check-prefix=MAIN ; RUN: llvm-objdump -d --no-show-raw-insn %t/test | FileCheck %s --check-prefix=ALL Index: lld/test/MachO/lto-symbol-resolution.ll =================================================================== --- lld/test/MachO/lto-symbol-resolution.ll +++ lld/test/MachO/lto-symbol-resolution.ll @@ -8,54 +8,54 @@ ; RUN: opt -module-summary %t/calls-foo.ll -o %t/calls-foo.o ; RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weak-defined.s -o %t/weak-defined-asm.o -; RUN: %lld -lSystem -dylib %t/defined.o -o %t/libfoo.dylib -; RUN: %lld -lSystem -dylib %t/weak-defined.o -o %t/libweakfoo.dylib +; RUN: %lld-mac -lSystem -dylib %t/defined.o -o %t/libfoo.dylib +; RUN: %lld-mac -lSystem -dylib %t/weak-defined.o -o %t/libweakfoo.dylib ; RUN: llvm-ar rcs %t/archive.a %t/archive.o ;; Regular defined symbols take precedence over weak ones. -; RUN: %lld -lSystem %t/defined.o %t/weak-defined.o %t/calls-foo.o -o %t/test +; RUN: %lld-mac -lSystem %t/defined.o %t/weak-defined.o %t/calls-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=DEFINED -; RUN: %lld -lSystem %t/weak-defined.o %t/defined.o %t/calls-foo.o -o %t/test +; RUN: %lld-mac -lSystem %t/weak-defined.o %t/defined.o %t/calls-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=DEFINED ;; Regular defined symbols take precedence over weak non-bitcode ones. -; RUN: %lld -lSystem %t/defined.o %t/weak-defined-asm.o %t/calls-foo.o -o %t/test +; RUN: %lld-mac -lSystem %t/defined.o %t/weak-defined-asm.o %t/calls-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=DEFINED -; RUN: %lld -lSystem %t/weak-defined-asm.o %t/defined.o %t/calls-foo.o -o %t/test +; RUN: %lld-mac -lSystem %t/weak-defined-asm.o %t/defined.o %t/calls-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=DEFINED ;; NOTE: we are deviating from ld64's behavior here. ;; ld64: Weak non-bitcode symbols take precedence over weak bitcode ones. ;; lld: Weak non-bitcode symbols have the same precedence as weak bitcode ones. -; RUN: %lld -lSystem %t/weak-defined.o %t/weak-defined-asm.o %t/calls-foo.o -o %t/test +; RUN: %lld-mac -lSystem %t/weak-defined.o %t/weak-defined-asm.o %t/calls-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=WEAK-DEFINED ; COM (ld64): llvm-objdump --syms %t/test | FileCheck %s --check-prefix=WEAK-DEFINED-ASM -; RUN: %lld -lSystem %t/weak-defined-asm.o %t/weak-defined.o %t/calls-foo.o -o %t/test +; RUN: %lld-mac -lSystem %t/weak-defined-asm.o %t/weak-defined.o %t/calls-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=WEAK-DEFINED-ASM ;; Weak defined symbols take precedence over dylib symbols. -; RUN: %lld -lSystem %t/weak-defined.o %t/libfoo.dylib %t/calls-foo.o -o %t/test +; RUN: %lld-mac -lSystem %t/weak-defined.o %t/libfoo.dylib %t/calls-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=WEAK-DEFINED -; RUN: %lld -lSystem %t/libfoo.dylib %t/weak-defined.o %t/calls-foo.o -o %t/test +; RUN: %lld-mac -lSystem %t/libfoo.dylib %t/weak-defined.o %t/calls-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=WEAK-DEFINED ;; Weak defined symbols take precedence over archive symbols. -; RUN: %lld -lSystem %t/archive.a %t/weak-defined.o %t/calls-foo.o -o %t/test +; RUN: %lld-mac -lSystem %t/archive.a %t/weak-defined.o %t/calls-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=WEAK-DEFINED -; RUN: %lld -lSystem %t/weak-defined.o %t/archive.a %t/calls-foo.o -o %t/test +; RUN: %lld-mac -lSystem %t/weak-defined.o %t/archive.a %t/calls-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=WEAK-DEFINED ;; Archive symbols have the same precedence as dylib symbols. -; RUN: %lld -lSystem %t/archive.a %t/libfoo.dylib %t/calls-foo.o -o %t/test +; RUN: %lld-mac -lSystem %t/archive.a %t/libfoo.dylib %t/calls-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=ARCHIVE -; RUN: %lld -lSystem %t/libfoo.dylib %t/archive.a %t/calls-foo.o -o %t/test +; RUN: %lld-mac -lSystem %t/libfoo.dylib %t/archive.a %t/calls-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=DYLIB ;; Archive symbols take precedence over weak dylib symbols. -; RUN: %lld -lSystem %t/archive.a %t/libweakfoo.dylib %t/calls-foo.o -o %t/test +; RUN: %lld-mac -lSystem %t/archive.a %t/libweakfoo.dylib %t/calls-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=ARCHIVE -; RUN: %lld -lSystem %t/libweakfoo.dylib %t/archive.a %t/calls-foo.o -o %t/test +; RUN: %lld-mac -lSystem %t/libweakfoo.dylib %t/archive.a %t/calls-foo.o -o %t/test ; RUN: llvm-objdump --syms %t/test | FileCheck %s --check-prefix=ARCHIVE ; DEFINED: g O __TEXT,defined _foo Index: lld/test/MachO/lto-weak-ref.ll =================================================================== --- lld/test/MachO/lto-weak-ref.ll +++ lld/test/MachO/lto-weak-ref.ll @@ -3,17 +3,17 @@ ; RUN: rm -rf %t; split-file %s %t ; RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/dylib.s -o %t/dylib.o -; RUN: %lld -dylib -lSystem %t/dylib.o -o %t/dylib.dylib +; RUN: %lld-mac -dylib -lSystem %t/dylib.o -o %t/dylib.dylib ;; As baseline, compile the .ll file to a real .o file and check behavior. ; RUN: llc -filetype=obj %t/weak-ref.ll -o %t/obj.o -; RUN: %lld -dylib -lSystem %t/obj.o %t/dylib.dylib -o %t/test.obj +; RUN: %lld-mac -dylib -lSystem %t/obj.o %t/dylib.dylib -o %t/test.obj ; RUN: llvm-objdump --macho --syms %t/test.obj | FileCheck %s --check-prefixes=WEAK-REF ;; Check that we get the same behavior compiling the .ll file to a bitcode .o ;; file and linking that. ; RUN: opt -module-summary %t/weak-ref.ll -o %t/bitcode.o -; RUN: %lld -dylib -lSystem %t/bitcode.o %t/dylib.dylib -o %t/test.lto +; RUN: %lld-mac -dylib -lSystem %t/bitcode.o %t/dylib.dylib -o %t/test.lto ; RUN: llvm-objdump --macho --syms %t/test.lto | FileCheck %s --check-prefixes=WEAK-REF ; WEAK-REF: SYMBOL TABLE: Index: lld/test/MachO/map-file.s =================================================================== --- lld/test/MachO/map-file.s +++ lld/test/MachO/map-file.s @@ -4,7 +4,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/c-string-literal.s -o %t/c-string-literal.o -# RUN: %lld -map %t/map %t/test.o %t/foo.o --time-trace -o %t/test-map +# RUN: %lld-mac -map %t/map %t/test.o %t/foo.o --time-trace -o %t/test-map # RUN: llvm-objdump --syms --section-headers %t/test-map > %t/objdump # RUN: cat %t/objdump %t/map > %t/out # RUN: FileCheck %s < %t/out @@ -41,7 +41,7 @@ # CHECK-NEXT: 0x[[#%X,FOO]] [ 2] _foo # CHECK-NEXT: 0x[[#%X,NUMBER]] [ 1] _number -# RUN: %lld -map %t/c-string-literal-map %t/c-string-literal.o -o %t/c-string-literal-out +# RUN: %lld-mac -map %t/c-string-literal-map %t/c-string-literal.o -o %t/c-string-literal-out # RUN: FileCheck --check-prefix=CSTRING %s < %t/c-string-literal-map ## C-string literals should be printed as "literal string: " @@ -50,7 +50,7 @@ # CSTRING-DAG: literal string: Hello world!\n # CSTRING-DAG: literal string: Hello, it's me -# RUN: %lld -dead_strip -map %t/dead-c-string-literal-map %t/c-string-literal.o -o %t/dead-c-string-literal-out +# RUN: %lld-mac -dead_strip -map %t/dead-c-string-literal-map %t/c-string-literal.o -o %t/dead-c-string-literal-out # RUN: FileCheck --check-prefix=DEADCSTRING %s < %t/dead-c-string-literal-map ## C-string literals should be printed as "literal string: " Index: lld/test/MachO/mark-dead-strippable-dylib.s =================================================================== --- lld/test/MachO/mark-dead-strippable-dylib.s +++ lld/test/MachO/mark-dead-strippable-dylib.s @@ -2,18 +2,18 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t.o %s -# RUN: %no-fatal-warnings-lld -o %t.exec %t.o -mark_dead_strippable_dylib 2>&1 \ -# RUN: | FileCheck --check-prefix=WARN %s +# RUN: %no-fatal-warnings-lld-mac -o %t.exec %t.o -mark_dead_strippable_dylib \ +# RUN: 2>&1 | FileCheck --check-prefix=WARN %s # RUN: llvm-objdump --macho --private-header %t.exec \ # RUN: | FileCheck --check-prefix=NO-DS %s -# RUN: %no-fatal-warnings-lld -bundle -o %t.bundle %t.o \ +# RUN: %no-fatal-warnings-lld-mac -bundle -o %t.bundle %t.o \ # RUN: -mark_dead_strippable_dylib 2>&1 \ # RUN: | FileCheck --check-prefix=WARN %s # RUN: llvm-objdump --macho --private-header %t.bundle \ # RUN: | FileCheck --check-prefix=NO-DS %s -# RUN: %lld -dylib -o %t.dylib %t.o -mark_dead_strippable_dylib 2>&1 +# RUN: %lld-mac -dylib -o %t.dylib %t.o -mark_dead_strippable_dylib 2>&1 # RUN: llvm-objdump --macho --private-header %t.dylib \ # RUN: | FileCheck --check-prefix=DS %s Index: lld/test/MachO/mh-execute-header.s =================================================================== --- lld/test/MachO/mh-execute-header.s +++ lld/test/MachO/mh-execute-header.s @@ -1,10 +1,10 @@ # REQUIRES: x86 # RUN: rm -rf %t; mkdir %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/test.o -# RUN: %lld -o %t/test.pie %t/test.o +# RUN: %lld-mac -o %t/test.pie %t/test.o # RUN: llvm-objdump --macho --syms %t/test.pie | FileCheck %s --check-prefix=PIE -# RUN: %lld -o %t/test.no_pie %t/test.o -no_pie +# RUN: %lld-mac -o %t/test.no_pie %t/test.o -no_pie # RUN: llvm-objdump --macho --syms %t/test.no_pie | FileCheck %s --check-prefix=NO-PIE # PIE: 0000000100000000 g F __TEXT,__text __mh_execute_header Index: lld/test/MachO/mh-header-link.s =================================================================== --- lld/test/MachO/mh-header-link.s +++ lld/test/MachO/mh-header-link.s @@ -9,10 +9,10 @@ ## (but not in other types of files) # RUN: llvm-mc %t/dylib.s -triple=x86_64-apple-macos10.15 -filetype=obj -o %t/dylib.o -# RUN: %lld -dylib -dead_strip %t/dylib.o -o %t/dylib.out +# RUN: %lld-mac -dylib -dead_strip %t/dylib.o -o %t/dylib.out # RUN: llvm-objdump -m --syms %t/dylib.out | FileCheck %s --check-prefix DYLIB -# RUN: not %lld -o /dev/null %t/dylib.o 2>&1 | FileCheck %s --check-prefix ERR-DYLIB +# RUN: not %lld-mac -o /dev/null %t/dylib.o 2>&1 | FileCheck %s --check-prefix ERR-DYLIB # DYLIB: SYMBOL TABLE: # DYLIB-NEXT: {{[0-9a-f]+}} g F __TEXT,__text _main @@ -21,10 +21,10 @@ ## Test that in an executable, we can link against __mh_execute_header # RUN: llvm-mc %t/main.s -triple=x86_64-apple-macos10.15 -filetype=obj -o %t/exec.o -# RUN: %lld -dead_strip -lSystem %t/exec.o -o %t/exec.out +# RUN: %lld-mac -dead_strip -lSystem %t/exec.o -o %t/exec.out ## But it would be an error trying to reference __mh_execute_header in a dylib -# RUN: not %lld -o /dev/null -dylib %t/exec.o 2>&1 | FileCheck %s --check-prefix ERR-EXEC +# RUN: not %lld-mac -o /dev/null -dylib %t/exec.o 2>&1 | FileCheck %s --check-prefix ERR-EXEC # ERR-EXEC: error: undefined symbol: __mh_execute_header Index: lld/test/MachO/no-exports-dylib.s =================================================================== --- lld/test/MachO/no-exports-dylib.s +++ 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 -dylib %t.o -o %t.dylib +# RUN: %lld-mac -dylib %t.o -o %t.dylib # RUN: obj2yaml %t.dylib | FileCheck %s # CHECK: export_size: 0 Index: lld/test/MachO/no-unneeded-dyld-info.s =================================================================== --- lld/test/MachO/no-unneeded-dyld-info.s +++ lld/test/MachO/no-unneeded-dyld-info.s @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld -dylib -o %t %t.o +# RUN: %lld-mac -dylib -o %t %t.o # RUN: llvm-objdump --macho --all-headers %t | FileCheck %s # CHECK: cmd LC_DYLD_INFO_ONLY Index: lld/test/MachO/nonweak-definition-override.s =================================================================== --- lld/test/MachO/nonweak-definition-override.s +++ lld/test/MachO/nonweak-definition-override.s @@ -4,14 +4,14 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/nonweakdef.s -o %t/nonweakdef.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weakdef.s -o %t/weakdef.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/common.s -o %t/common.o -# RUN: %lld -dylib %t/libfoo.o -o %t/libfoo.dylib +# RUN: %lld-mac -dylib %t/libfoo.o -o %t/libfoo.dylib ## Check that non-weak defined symbols override weak dylib symbols. -# RUN: %lld %t/nonweakdef.o -L%t -lfoo -o %t/nonweakdef -lSystem +# RUN: %lld-mac %t/nonweakdef.o -L%t -lfoo -o %t/nonweakdef -lSystem # RUN: llvm-objdump --macho --weak-bind %t/nonweakdef | FileCheck %s ## Test loading the dylib before the obj file. -# RUN: %lld -L%t -lfoo %t/nonweakdef.o -o %t/nonweakdef -lSystem +# RUN: %lld-mac -L%t -lfoo %t/nonweakdef.o -o %t/nonweakdef -lSystem # RUN: llvm-objdump --macho --weak-bind %t/nonweakdef | FileCheck %s # CHECK: Weak bind table: @@ -20,11 +20,11 @@ # CHECK-EMPTY: ## Check that weak defined symbols do not override weak dylib symbols. -# RUN: %lld %t/weakdef.o -L%t -lfoo -o %t/weakdef -lSystem +# RUN: %lld-mac %t/weakdef.o -L%t -lfoo -o %t/weakdef -lSystem # RUN: llvm-objdump --macho --weak-bind %t/weakdef | FileCheck %s --check-prefix=NO-WEAK-OVERRIDE ## Test loading the dylib before the obj file. -# RUN: %lld -L%t -lfoo %t/weakdef.o -o %t/weakdef -lSystem +# RUN: %lld-mac -L%t -lfoo %t/weakdef.o -o %t/weakdef -lSystem # RUN: llvm-objdump --macho --weak-bind %t/weakdef | FileCheck %s --check-prefix=NO-WEAK-OVERRIDE # NO-WEAK-OVERRIDE: Weak bind table: @@ -33,7 +33,7 @@ ## Check that common symbols take precedence over weak dylib symbols, but do not ## generate an overridding weak binding. -# RUN: %lld -L%t -lfoo %t/common.o -o %t/common -lSystem +# RUN: %lld-mac -L%t -lfoo %t/common.o -o %t/common -lSystem # RUN: llvm-objdump --macho --weak-bind %t/common | FileCheck %s --check-prefix=NO-WEAK-OVERRIDE # RUN: llvm-objdump --syms %t/common | FileCheck %s --check-prefix=COMMON # COMMON-DAG: g O __DATA,__common _nonweak_in_dylib Index: lld/test/MachO/objc-classrefs-dedup.s =================================================================== --- lld/test/MachO/objc-classrefs-dedup.s +++ lld/test/MachO/objc-classrefs-dedup.s @@ -3,8 +3,8 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/defs.s -o %t/defs.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/refs1.s -o %t/refs1.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/refs2.s -o %t/refs2.o -# RUN: %lld -lSystem -dylib %t/defs.o -o %t/libdefs.dylib -# RUN: %lld -lSystem -dylib --icf=all %t/refs1.o %t/refs2.o %t/libdefs.dylib -o %t/out +# RUN: %lld-mac -lSystem -dylib %t/defs.o -o %t/libdefs.dylib +# RUN: %lld-mac -lSystem -dylib --icf=all %t/refs1.o %t/refs2.o %t/libdefs.dylib -o %t/out # RUN: llvm-objdump --macho --section-headers --bind %t/out | FileCheck %s \ # RUN: --implicit-check-not __objc_classrefs Index: lld/test/MachO/objc.s =================================================================== --- lld/test/MachO/objc.s +++ lld/test/MachO/objc.s @@ -13,13 +13,13 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o -# RUN: %lld -lSystem %t/test.o -o %t/test -L%t -lHasSomeObjC -ObjC +# RUN: %lld-mac -lSystem %t/test.o -o %t/test -L%t -lHasSomeObjC -ObjC # RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s --check-prefix=OBJC -# RUN: %lld -lSystem %t/test.o -o %t/test -L%t -lHasSomeObjC2 -ObjC +# RUN: %lld-mac -lSystem %t/test.o -o %t/test -L%t -lHasSomeObjC2 -ObjC # RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s --check-prefix=OBJC -# RUN: %lld -lSystem %t/test.o -o %t/test --start-lib %t/no-objc.o %t/has-objc-symbol.o %t/has-objc-category.o %t/has-swift.o %t/wrong-arch.o --end-lib -ObjC +# RUN: %lld-mac -lSystem %t/test.o -o %t/test --start-lib %t/no-objc.o %t/has-objc-symbol.o %t/has-objc-category.o %t/has-swift.o %t/wrong-arch.o --end-lib -ObjC # RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s --check-prefix=OBJC # OBJC: Sections: @@ -33,7 +33,7 @@ # OBJC-DAG: g F __TEXT,__text _main # OBJC-DAG: g F __TEXT,__text _OBJC_CLASS_$_MyObject -# RUN: %lld -lSystem %t/test.o -o %t/test -L%t -lHasSomeObjC +# RUN: %lld-mac -lSystem %t/test.o -o %t/test -L%t -lHasSomeObjC # RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s --check-prefix=NO-OBJC # NO-OBJC: Sections: @@ -51,18 +51,18 @@ ## Check that -ObjC causes has-objc-symbol.o to be loaded first, prior to symbol ## resolution. This matches ld64's behavior. -# RUN: %lld -dylib %t/refs-dup.o %t/refs-objc.o -o %t/refs-dup -L%t -lHasSomeObjC -ObjC +# RUN: %lld-mac -dylib %t/refs-dup.o %t/refs-objc.o -o %t/refs-dup -L%t -lHasSomeObjC -ObjC # RUN: llvm-objdump --macho --syms %t/refs-dup | FileCheck %s --check-prefix=DUP-FROM-OBJC # DUP-FROM-OBJC: g O __DATA,has_objc_symbol _has_dup ## Without -ObjC, no-objc.o gets loaded first during symbol resolution, causing ## a duplicate symbol error. -# RUN: not %lld -dylib %t/refs-dup.o %t/refs-objc.o -o %t/refs-dup -L%t \ +# RUN: not %lld-mac -dylib %t/refs-dup.o %t/refs-objc.o -o %t/refs-dup -L%t \ # RUN: -lHasSomeObjC 2>&1 | FileCheck %s --check-prefix=DUP-ERROR # DUP-ERROR: error: duplicate symbol: _has_dup ## TODO: Load has-objc-symbol.o prior to symbol resolution to match the archive behavior. -# RUN: not %lld -dylib %t/refs-dup.o %t/refs-objc.o -o %t/refs-dup --start-lib %t/no-objc.o \ +# RUN: not %lld-mac -dylib %t/refs-dup.o %t/refs-objc.o -o %t/refs-dup --start-lib %t/no-objc.o \ # RUN: %t/has-objc-symbol.o %t/has-objc-category.o %t/has-swift.o %t/wrong-arch.o --end-lib \ # RUN: -ObjC --check-prefix=DUP-FROM-OBJC Index: lld/test/MachO/order-file.s =================================================================== --- lld/test/MachO/order-file.s +++ lld/test/MachO/order-file.s @@ -11,99 +11,99 @@ # FOO-SECOND: <_main>: # FOO-SECOND: <_bar>: -# RUN: %lld -lSystem -o %t/test-1 %t/test.o %t/foo.o -order_file %t/ord-1 +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-1 %t/foo.o %t/test.o -order_file %t/ord-1 +# RUN: %lld-mac -lSystem -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: %lld -lSystem -o %t/test-2 %t/test.o %t/foo.o -order_file %t/ord-2 +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-2 %t/foo.o %t/test.o -order_file %t/ord-2 +# RUN: %lld-mac -lSystem -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: %lld -lSystem -o %t/test-file-match %t/test.o %t/foo.o -order_file %t/ord-file-match +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-file-match %t/foo.o %t/test.o -order_file %t/ord-file-match +# RUN: %lld-mac -lSystem -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: %lld -lSystem -o %t/test-file-nomatch %t/test.o %t/foo.o -order_file %t/ord-file-nomatch +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-file-nomatch %t/foo.o %t/test.o -order_file %t/ord-file-nomatch +# RUN: %lld-mac -lSystem -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: %lld -lSystem -o %t/test-arch-match %t/test.o %t/foo.o -order_file %t/ord-arch-match +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-arch-match %t/foo.o %t/test.o -order_file %t/ord-arch-match +# RUN: %lld-mac -lSystem -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: %lld -lSystem -o %t/test-arch-nomatch %t/test.o %t/foo.o -order_file %t/ord-arch-nomatch +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-arch-nomatch %t/foo.o %t/test.o -order_file %t/ord-arch-nomatch +# RUN: %lld-mac -lSystem -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: %lld -lSystem -o %t/test-arch-match %t/test.o %t/foo.o -order_file %t/ord-arch-match +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-arch-match %t/foo.o %t/test.o -order_file %t/ord-arch-match +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-archive-1 %t/test.o %t/foo.a -order_file %t/ord-1 +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-archive-1 %t/foo.a %t/test.o -order_file %t/ord-1 +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-archive-file-no-match %t/test.o %t/foo.a -order_file %t/ord-file-match +# RUN: %lld-mac -lSystem -o %t/test-archive-file-no-match %t/test.o %t/foo.a -order_file %t/ord-file-match # RUN: llvm-objdump -d %t/test-archive-file-no-match | FileCheck %s --check-prefix=FOO-SECOND -# RUN: %lld -lSystem -o %t/test-archive %t/foo.a %t/test.o -order_file %t/ord-file-match +# RUN: %lld-mac -lSystem -o %t/test-archive %t/foo.a %t/test.o -order_file %t/ord-file-match # RUN: llvm-objdump -d %t/test-archive-file-no-match | FileCheck %s --check-prefix=FOO-SECOND -# RUN: %lld -lSystem -o %t/test-archive-1 %t/test.o %t/foo.a -order_file %t/ord-archive-match +# RUN: %lld-mac -lSystem -o %t/test-archive-1 %t/test.o %t/foo.a -order_file %t/ord-archive-match # RUN: llvm-objdump -d %t/test-archive-1 | FileCheck %s --check-prefix=FOO-FIRST -# RUN: %lld -lSystem -o %t/test-archive-1 %t/foo.a %t/test.o -order_file %t/ord-archive-match +# RUN: %lld-mac -lSystem -o %t/test-archive-1 %t/foo.a %t/test.o -order_file %t/ord-archive-match # RUN: llvm-objdump -d %t/test-archive-1 | FileCheck %s --check-prefix=FOO-FIRST -# RUN: %lld -lSystem -o %t/test-archive-file-no-match %t/test.o %t/foo.a -order_file %t/ord-file-nomatch +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-archive %t/foo.a %t/test.o -order_file %t/ord-file-nomatch +# RUN: %lld-mac -lSystem -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 ## file entries, it should always use the lowest-ordered match. -# RUN: %lld -lSystem -o %t/test-1 %t/test.o %t/foo.o -order_file %t/ord-multiple-1 +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-1 %t/foo.o %t/test.o -order_file %t/ord-multiple-1 +# RUN: %lld-mac -lSystem -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: %lld -lSystem -o %t/test-2 %t/test.o %t/foo.o -order_file %t/ord-multiple-2 +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-2 %t/foo.o %t/test.o -order_file %t/ord-multiple-2 +# RUN: %lld-mac -lSystem -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: %lld -lSystem -o %t/test-3 %t/test.o %t/foo.o -order_file %t/ord-multiple-3 +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-3 %t/foo.o %t/test.o -order_file %t/ord-multiple-3 +# RUN: %lld-mac -lSystem -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: %lld -lSystem -o %t/test-4 %t/test.o %t/foo.o -order_file %t/ord-multiple-4 +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-4 %t/foo.o %t/test.o -order_file %t/ord-multiple-4 +# RUN: %lld-mac -lSystem -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 doFoo:andBar:] and _bar both point to the same location. When both ## symbols appear in an order file, the location in question should be ordered ## according to the lowest-ordered symbol that references it. -# RUN: %lld -lSystem -o %t/test-alias %t/test.o %t/foo.o -order_file %t/ord-alias +# RUN: %lld-mac -lSystem -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 -lSystem -o %t/test-alias %t/foo.o %t/test.o -order_file %t/ord-alias +# RUN: %lld-mac -lSystem -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 ## Absolute in symbols in order files make no sense. Just ignore them. -# RUN: %lld -lSystem -dylib -o %t/test-abs %t/abs.o -order_file %t/ord-abs +# RUN: %lld-mac -lSystem -dylib -o %t/test-abs %t/abs.o -order_file %t/ord-abs #--- ord-1 -[Foo doFoo:andBar:] # just a comment Index: lld/test/MachO/pagezero.s =================================================================== --- lld/test/MachO/pagezero.s +++ lld/test/MachO/pagezero.s @@ -3,16 +3,16 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/x86_64.o # RUN: llvm-mc -filetype=obj -triple=arm64_32-apple-darwin %s -o %t/arm64_32.o -# RUN: %lld -lSystem -arch x86_64 -o %t/x86_64 %t/x86_64.o -pagezero_size 100000 +# RUN: %lld-mac -lSystem -arch x86_64 -o %t/x86_64 %t/x86_64.o -pagezero_size 100000 # RUN: llvm-readobj --macho-segment %t/x86_64 | FileCheck %s -D#VMSIZE=0x100000 -D#SIZE=72 # RUN: %lld-watchos -lSystem -arch arm64_32 -o %t/arm64_32 %t/arm64_32.o -pagezero_size 100000 # RUN: llvm-readobj --macho-segment %t/arm64_32 | FileCheck %s -D#VMSIZE=0x100000 -D#SIZE=56 -# RUN: %lld -lSystem -arch x86_64 -o %t/zero %t/x86_64.o -pagezero_size 0 +# RUN: %lld-mac -lSystem -arch x86_64 -o %t/zero %t/x86_64.o -pagezero_size 0 # RUN: llvm-readobj --macho-segment %t/zero | FileCheck %s --check-prefix=CHECK-ZERO -D#VMSIZE=0x1000 -D#SIZE=152 -# RUN: %no-fatal-warnings-lld -lSystem -arch x86_64 -o %t/x86_64-misalign %t/x86_64.o -pagezero_size 1001 2>&1 | FileCheck %s --check-prefix=LINK -D#SIZE=0x1000 +# RUN: %no-fatal-warnings-lld-mac -lSystem -arch x86_64 -o %t/x86_64-misalign %t/x86_64.o -pagezero_size 1001 2>&1 | FileCheck %s --check-prefix=LINK -D#SIZE=0x1000 # RUN: llvm-readobj --macho-segment %t/x86_64-misalign | FileCheck %s -D#VMSIZE=0x1000 -D#SIZE=72 # RUN: %no-fatal-warnings-lld-watchos -lSystem -arch arm64_32 -o %t/arm64_32-misalign-4K %t/arm64_32.o -pagezero_size 1001 2>&1 | FileCheck %s --check-prefix=LINK -D#SIZE=0x0 Index: lld/test/MachO/private-extern.s =================================================================== --- lld/test/MachO/private-extern.s +++ lld/test/MachO/private-extern.s @@ -6,7 +6,7 @@ ## Check that .private_extern symbols are marked as local in the symbol table ## and aren't in the export trie. -# RUN: %lld -dylib %t/basics.o -o %t/basics +# RUN: %lld-mac -dylib %t/basics.o -o %t/basics # RUN: llvm-objdump --syms --exports-trie %t/basics | \ # RUN: FileCheck --check-prefix=EXPORTS %s # RUN: llvm-nm -m %t/basics | FileCheck --check-prefix=EXPORTS-NM %s @@ -47,28 +47,28 @@ ## weak + strong symbol takes privateness from strong symbol ## - weak private extern + strong extern = strong extern (for both .o orderings) -# RUN: %lld -dylib %t/weak-private.o %t/strong-globl.o -o %t/wpsg +# RUN: %lld-mac -dylib %t/weak-private.o %t/strong-globl.o -o %t/wpsg # RUN: llvm-nm -m %t/wpsg | FileCheck --check-prefix=EXTERNAL %s -# RUN: %lld -dylib %t/strong-globl.o %t/weak-private.o -o %t/sgwp +# RUN: %lld-mac -dylib %t/strong-globl.o %t/weak-private.o -o %t/sgwp # RUN: llvm-nm -m %t/sgwp | FileCheck --check-prefix=EXTERNAL %s # EXTERNAL: (__TEXT,__text) external _foo ## - weak extern + strong private extern = strong private extern ## (for both .o orderings) -# RUN: %lld -dylib %t/weak-globl.o %t/strong-private.o -o %t/wgsp +# RUN: %lld-mac -dylib %t/weak-globl.o %t/strong-private.o -o %t/wgsp # RUN: llvm-nm -m %t/wgsp | FileCheck --check-prefix=NONEXTERNAL %s -# RUN: %lld -dylib %t/strong-private.o %t/weak-globl.o -o %t/spwg +# RUN: %lld-mac -dylib %t/strong-private.o %t/weak-globl.o -o %t/spwg # RUN: llvm-nm -m %t/spwg | FileCheck --check-prefix=NONEXTERNAL %s # NONEXTERNAL: (__TEXT,__text) non-external (was a private external) _foo ## weak + weak symbol take weaker privateness ## - weak extern + weak private extern = weak extern (both orders) -# RUN: %lld -dylib %t/weak-private.o %t/weak-globl.o -o %t/wpwg +# RUN: %lld-mac -dylib %t/weak-private.o %t/weak-globl.o -o %t/wpwg # RUN: llvm-nm -m %t/wpwg | FileCheck --check-prefix=WEAK-EXTERNAL %s -# RUN: %lld -dylib %t/weak-globl.o %t/weak-private.o -o %t/wgwp +# RUN: %lld-mac -dylib %t/weak-globl.o %t/weak-private.o -o %t/wgwp # RUN: llvm-nm -m %t/wgwp | FileCheck --check-prefix=WEAK-EXTERNAL %s # WEAK-EXTERNAL: (__TEXT,__text) weak external _foo ## - weak private extern + weak private extern = weak private extern -# RUN: %lld -dylib %t/weak-private.o %t/weak-private.o -o %t/wpwp +# RUN: %lld-mac -dylib %t/weak-private.o %t/weak-private.o -o %t/wpwp # RUN: llvm-nm -m %t/wpwp | FileCheck --check-prefix=NONEXTERNAL %s #--- strong-globl.s @@ -107,28 +107,28 @@ ## For common symbols the larger one wins. ## - smaller private extern + larger extern = larger extern -# RUN: %lld -dylib %t/comm-small-private.o %t/comm-large.o -o %t/cspcl +# RUN: %lld-mac -dylib %t/comm-small-private.o %t/comm-large.o -o %t/cspcl # RUN: llvm-nm -m %t/cspcl | FileCheck --check-prefix=COMMON-EXTERNAL %s -# RUN: %lld -dylib %t/comm-large.o %t/comm-small-private.o -o %t/clcsp +# RUN: %lld-mac -dylib %t/comm-large.o %t/comm-small-private.o -o %t/clcsp # RUN: llvm-nm -m %t/clcsp | FileCheck --check-prefix=COMMON-EXTERNAL %s # COMMON-EXTERNAL: (__DATA,__common) external _foo ## - smaller extern + larger private extern = larger private extern -# RUN: %lld -dylib %t/comm-large-private.o %t/comm-small.o -o %t/clpcs +# RUN: %lld-mac -dylib %t/comm-large-private.o %t/comm-small.o -o %t/clpcs # RUN: llvm-nm -m %t/clpcs | FileCheck --check-prefix=COMMON-NONEXTERNAL %s -# RUN: %lld -dylib %t/comm-small.o %t/comm-large-private.o -o %t/csclp +# RUN: %lld-mac -dylib %t/comm-small.o %t/comm-large-private.o -o %t/csclp # RUN: llvm-nm -m %t/csclp | FileCheck --check-prefix=COMMON-NONEXTERNAL %s # COMMON-NONEXTERNAL: (__DATA,__common) non-external (was a private external) _foo # For common symbols with the same size, the privateness of the symbol seen # later wins (!). ## - equal private extern + equal extern = equal extern (both orders) -# RUN: %lld -dylib %t/comm-small-private.o %t/comm-small.o -o %t/cspcs +# RUN: %lld-mac -dylib %t/comm-small-private.o %t/comm-small.o -o %t/cspcs # RUN: llvm-nm -m %t/cspcs | FileCheck --check-prefix=COMMON-EXTERNAL %s ## - equal extern + equal private extern = equal private extern (both orders) -# RUN: %lld -dylib %t/comm-small.o %t/comm-small-private.o -o %t/cscsp +# RUN: %lld-mac -dylib %t/comm-small.o %t/comm-small-private.o -o %t/cscsp # RUN: llvm-nm -m %t/cscsp | FileCheck --check-prefix=COMMON-NONEXTERNAL %s ## - equal private extern + equal private extern = equal private extern -# RUN: %lld -dylib %t/comm-small-private.o %t/comm-small-private.o -o %t/cspcsp +# RUN: %lld-mac -dylib %t/comm-small-private.o %t/comm-small-private.o -o %t/cspcsp # RUN: llvm-nm -m %t/cspcsp | FileCheck --check-prefix=COMMON-NONEXTERNAL %s #--- comm-small.s Index: lld/test/MachO/reexport-stub.s =================================================================== --- lld/test/MachO/reexport-stub.s +++ lld/test/MachO/reexport-stub.s @@ -4,7 +4,7 @@ ## This test verifies that a non-TBD dylib can re-export a TBD library. # RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t/reexporter.o -# RUN: %lld -dylib -lc++ -sub_library libc++ \ +# RUN: %lld-mac -dylib -lc++ -sub_library libc++ \ # RUN: %t/reexporter.o -o %t/libreexporter.dylib # RUN: llvm-objdump --macho --all-headers %t/libreexporter.dylib | FileCheck %s --check-prefix=DYLIB-HEADERS # DYLIB-HEADERS: cmd LC_REEXPORT_DYLIB @@ -12,7 +12,7 @@ # DYLIB-HEADERS: name /usr/lib/libc++.dylib # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %s -o %t/test.o -# RUN: %lld -o %t/test -lSystem -L%t -lreexporter %t/test.o +# RUN: %lld-mac -o %t/test -lSystem -L%t -lreexporter %t/test.o # RUN: llvm-objdump --bind --no-show-raw-insn -d %t/test | FileCheck %s # CHECK: Bind table: Index: lld/test/MachO/referenced-dynamically.s =================================================================== --- lld/test/MachO/referenced-dynamically.s +++ lld/test/MachO/referenced-dynamically.s @@ -1,13 +1,13 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld %t.o -lSystem -o %t.out +# RUN: %lld-mac %t.o -lSystem -o %t.out # RUN: llvm-readobj --syms %t.out | FileCheck %s ## ld64 has a "TEMP work around until goes in" ## that promotes PrivateExtern ReferencedDynamically symbols in dylibs to ## normal Externs. lld does not do this. -# RUN: %lld -dylib %t.o -o %t.dylib +# RUN: %lld-mac -dylib %t.o -o %t.dylib # RUN: llvm-readobj --syms %t.dylib | FileCheck %s # CHECK: Name: ___crashreporter_info__ Index: lld/test/MachO/reloc-subtractor.s =================================================================== --- lld/test/MachO/reloc-subtractor.s +++ lld/test/MachO/reloc-subtractor.s @@ -2,9 +2,9 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/x86_64.o # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/test.s -o %t/arm64.o -# RUN: %lld -lSystem %t/x86_64.o -o %t/x86_64 -order_file %t/order-file +# RUN: %lld-mac -lSystem %t/x86_64.o -o %t/x86_64 -order_file %t/order-file # RUN: llvm-objdump --syms --full-contents --rebase %t/x86_64 | FileCheck %s -# RUN: %lld -arch arm64 -lSystem %t/arm64.o -o %t/arm64 -order_file %t/order-file +# RUN: %lld-mac -arch arm64 -lSystem %t/arm64.o -o %t/arm64 -order_file %t/order-file # RUN: llvm-objdump --syms --full-contents --rebase %t/arm64 | FileCheck %s # CHECK-LABEL: SYMBOL TABLE: Index: lld/test/MachO/rename.s =================================================================== --- lld/test/MachO/rename.s +++ lld/test/MachO/rename.s @@ -3,10 +3,10 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/main.s -o %t.o -# RUN: %lld -o %t.out %t.o +# RUN: %lld-mac -o %t.out %t.o ## Check option format. -# RUN: not %lld \ +# RUN: not %lld-mac \ # RUN: -rename_section B@GUS_SEG b@gus_sect S/ASHY_SEG st*rry_sect \ # RUN: -rename_section __FROM_SECT __from_sect __TO_SECT \ # RUN: -o /dev/null %t.o 2>&1 | FileCheck %s --check-prefix=BAD1 @@ -18,7 +18,7 @@ # BAD1-DAG: error: invalid name for segment or section: -o # BAD1-DAG: error: {{.*}}: unhandled file type -# RUN: not %lld \ +# RUN: not %lld-mac \ # RUN: -rename_segment H#SHY_SEG PL+SSY_SEG \ # RUN: -rename_segment __FROM_SEG \ # RUN: -o /dev/null %t.o 2>&1 | FileCheck %s --check-prefix=BAD2 @@ -29,7 +29,7 @@ # BAD2-DAG: error: {{.*}}: unhandled file type ## Check that section and segment renames happen. -# RUN: %lld -lSystem \ +# RUN: %lld-mac -lSystem \ # RUN: -rename_section __FROM_SECT __from_sect __TO_SECT __to_sect \ # RUN: -rename_segment __FROM_SEG __TO_SEG \ # RUN: -rename_section __TEXT __cstring __RODATA __cstring \ @@ -56,12 +56,12 @@ ## name, but it too writes the actual data to __SEG,__to_sect.) # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/small.s \ # RUN: -o %t/small.o -# RUN: %lld -dylib \ +# RUN: %lld-mac -dylib \ # RUN: -rename_section __FROM_SECT __from_sect __TO_SECT __to_sect \ # RUN: -rename_segment __TO_SECT __SEG \ # RUN: -o %t.dylib %t/small.o # RUN: llvm-otool -l %t.dylib | FileCheck --check-prefix=SECTSEGYES %s -# RUN: %lld -dylib \ +# RUN: %lld-mac -dylib \ # RUN: -rename_segment __TO_SECT __SEG \ # RUN: -rename_section __FROM_SECT __from_sect __TO_SECT __to_sect \ # RUN: -o %t.dylib %t/small.o @@ -74,7 +74,7 @@ # SECTSEGYES-NEXT: segname __SEG ## ...but rename_segment has no effect if it doesn't match the name after ## rename_section is applied. -# RUN: %lld -dylib \ +# RUN: %lld-mac -dylib \ # RUN: -rename_section __FROM_SECT __from_sect __TO_SECT __to_sect \ # RUN: -rename_segment __FROM_SECT __SEG \ # RUN: -o %t.dylib %t/small.o @@ -87,12 +87,12 @@ # SECTSEGSOME-NEXT: segname __TO_SECT ## If rename_section would only match after rename_segment, rename_section has ## no effect. -# RUN: %lld -dylib \ +# RUN: %lld-mac -dylib \ # RUN: -rename_section __SEG __from_sect __TO_SECT __to_sect \ # RUN: -rename_segment __FROM_SECT __SEG \ # RUN: -o %t.dylib %t/small.o # RUN: llvm-otool -l %t.dylib | FileCheck --check-prefix=SECTSEGNO %s -# RUN: %lld -dylib \ +# RUN: %lld-mac -dylib \ # RUN: -rename_segment __FROM_SECT __SEG \ # RUN: -rename_section __SEG __from_sect __TO_SECT __to_sect \ # RUN: -o %t.dylib %t/small.o Index: lld/test/MachO/reproduce-thin-archives.s =================================================================== --- lld/test/MachO/reproduce-thin-archives.s +++ lld/test/MachO/reproduce-thin-archives.s @@ -6,10 +6,10 @@ # RUN: cd %t.dir # RUN: llvm-ar rcsT foo.a foo.o -# RUN: %lld foo.a -o /dev/null --reproduce repro.tar +# RUN: %lld-mac foo.a -o /dev/null --reproduce repro.tar # RUN: tar tf repro.tar | FileCheck -DPATH='repro/%:t.dir' %s -# RUN: %lld -all_load foo.a -o /dev/null --reproduce repro2.tar +# RUN: %lld-mac -all_load foo.a -o /dev/null --reproduce repro2.tar # RUN: tar tf repro2.tar | FileCheck -DPATH='repro2/%:t.dir' %s # CHECK-DAG: [[PATH]]/foo.a Index: lld/test/MachO/reproduce.s =================================================================== --- lld/test/MachO/reproduce.s +++ lld/test/MachO/reproduce.s @@ -44,7 +44,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %s -o %t.dir/build2/foo.o # RUN: cd %t.dir/build2/a/b/c # RUN: echo ./../../../foo.o > %t.dir/build2/filelist -# RUN: env LLD_REPRODUCE=repro2.tar %lld -filelist %t.dir/build2/filelist -o /dev/null +# RUN: env LLD_REPRODUCE=repro2.tar %lld-mac -filelist %t.dir/build2/filelist -o /dev/null # RUN: tar xf repro2.tar # RUN: cmp %t.dir/build2/foo.o repro2/%:t.dir/build2/foo.o # RUN: FileCheck %s --check-prefix=RSP2 < repro2/response.txt Index: lld/test/MachO/reroot-path.s =================================================================== --- lld/test/MachO/reroot-path.s +++ lld/test/MachO/reroot-path.s @@ -18,30 +18,30 @@ ## and therefore verifies that we still fall back to the original path if no ## file exists at the rerooted path. # RUN: llvm-ar rcs %t/foo.a %t/foo.o -# RUN: %lld -dylib %t/foo.o -o %t/libfoo.dylib +# RUN: %lld-mac -dylib %t/foo.o -o %t/libfoo.dylib # RUN: llvm-ar rcs %t/%:t/bar.a %t/bar.o -# RUN: %lld -dylib %t/bar.o -o %t/%:t/libbar.dylib +# RUN: %lld-mac -dylib %t/bar.o -o %t/%:t/libbar.dylib ## Test our various file-loading flags to make sure all bases are covered. -# RUN: %lld --reproduce %t/repro1.tar -lSystem -syslibroot %t %t/foo.a %t/bar.a %t/test.o -o /dev/null -t | FileCheck %s -DDIR="%t/%:t" +# RUN: %lld-mac --reproduce %t/repro1.tar -lSystem -syslibroot %t %t/foo.a %t/bar.a %t/test.o -o /dev/null -t | FileCheck %s -DDIR="%t/%:t" # RUN: tar xf %t/repro1.tar -C %t # RUN: cd %t/repro1; %no-arg-lld @response.txt | FileCheck %s -DDIR="%:t/%:t" -# RUN: %lld --reproduce %t/repro2.tar -lSystem -syslibroot %t -force_load %t/foo.a -force_load %t/bar.a %t/test.o -o /dev/null -t | FileCheck %s -DDIR="%t/%:t" +# RUN: %lld-mac --reproduce %t/repro2.tar -lSystem -syslibroot %t -force_load %t/foo.a -force_load %t/bar.a %t/test.o -o /dev/null -t | FileCheck %s -DDIR="%t/%:t" # RUN: tar xf %t/repro2.tar -C %t # RUN: cd %t/repro2; %no-arg-lld @response.txt | FileCheck %s -DDIR="%:t/%:t" -# RUN: %lld --reproduce %t/repro3.tar -lSystem -syslibroot %t %t/libfoo.dylib %t/libbar.dylib %t/test.o -o /dev/null -t | FileCheck %s -DDIR="%t/%:t" +# RUN: %lld-mac --reproduce %t/repro3.tar -lSystem -syslibroot %t %t/libfoo.dylib %t/libbar.dylib %t/test.o -o /dev/null -t | FileCheck %s -DDIR="%t/%:t" # RUN: tar xf %t/repro3.tar -C %t # RUN: cd %t/repro3; %no-arg-lld @response.txt | FileCheck %s -DDIR="%:t/%:t" -# RUN: %lld --reproduce %t/repro4.tar -lSystem -syslibroot %t -weak_library %t/libfoo.dylib -weak_library %t/libbar.dylib %t/test.o -o /dev/null -t | FileCheck %s -DDIR="%t/%:t" +# RUN: %lld-mac --reproduce %t/repro4.tar -lSystem -syslibroot %t -weak_library %t/libfoo.dylib -weak_library %t/libbar.dylib %t/test.o -o /dev/null -t | FileCheck %s -DDIR="%t/%:t" # RUN: tar xf %t/repro4.tar -C %t # RUN: cd %t/repro4; %no-arg-lld @response.txt | FileCheck %s -DDIR="%:t/%:t" # RUN: echo "%t/libfoo.dylib" > %t/filelist # RUN: echo "%t/libbar.dylib" >> %t/filelist -# RUN: %lld --reproduce %t/repro5.tar -lSystem -syslibroot %t -filelist %t/filelist %t/test.o -o /dev/null -t | FileCheck %s -DDIR="%t/%:t" +# RUN: %lld-mac --reproduce %t/repro5.tar -lSystem -syslibroot %t -filelist %t/filelist %t/test.o -o /dev/null -t | FileCheck %s -DDIR="%t/%:t" # RUN: tar xf %t/repro5.tar -C %t # RUN: cd %t/repro5; %no-arg-lld @response.txt | FileCheck %s -DDIR="%:t/%:t" @@ -50,7 +50,7 @@ ## Paths to object files don't get rerooted. # RUN: mv %t/bar.o %t/%:t/bar.o -# RUN: not %lld -lSystem -syslibroot %t %t/foo.o %t/bar.o %t/test.o -o \ +# RUN: not %lld-mac -lSystem -syslibroot %t %t/foo.o %t/bar.o %t/test.o -o \ # RUN: /dev/null 2>&1 | FileCheck %s --check-prefix=OBJ # OBJ: error: cannot open {{.*[\\/]}}bar.o: {{[Nn]}}o such file or directory @@ -58,7 +58,7 @@ ## rerooted path takes precedence over the original path. We will get an ## undefined symbol error since we aren't loading %t/libfoo.dylib. # RUN: cp %t/%:t/libbar.dylib %t/%:t/libfoo.dylib -# RUN: not %lld --reproduce %t/repro6.tar -lSystem -syslibroot %t %t/libfoo.dylib %t/libbar.dylib %t/test.o \ +# RUN: not %lld-mac --reproduce %t/repro6.tar -lSystem -syslibroot %t %t/libfoo.dylib %t/libbar.dylib %t/test.o \ # RUN: -o /dev/null -t 2> %t/error | FileCheck %s -DDIR="%t/%:t" --check-prefix=FOO # RUN: FileCheck %s --check-prefix=UNDEF < %t/error Index: lld/test/MachO/responsefile.test =================================================================== --- lld/test/MachO/responsefile.test +++ lld/test/MachO/responsefile.test @@ -1,4 +1,4 @@ # RUN: echo --help > %t.rsp -# RUN: %lld @%t.rsp | FileCheck %s +# RUN: %lld-mac @%t.rsp | FileCheck %s CHECK: OVERVIEW: LLVM Linker Index: lld/test/MachO/rpath.s =================================================================== --- lld/test/MachO/rpath.s +++ lld/test/MachO/rpath.s @@ -1,9 +1,9 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld -o %t %t.o +# RUN: %lld-mac -o %t %t.o ## Check that -rpath generates LC_RPATH. -# RUN: %lld -o %t %t.o -rpath /some/rpath -rpath /another/rpath +# RUN: %lld-mac -o %t %t.o -rpath /some/rpath -rpath /another/rpath # RUN: llvm-objdump --macho --all-headers %t | FileCheck %s # CHECK: LC_RPATH # CHECK-NEXT: cmdsize 24 Index: lld/test/MachO/search-paths.test =================================================================== --- lld/test/MachO/search-paths.test +++ lld/test/MachO/search-paths.test @@ -1,6 +1,6 @@ RUN: rm -rf %t1 %t2; mkdir -p %t1 %t2 -RUN: %lld -v -dylib -o /dev/null -L%t1 -F%t2 2>&1 \ +RUN: %lld-mac -v -dylib -o /dev/null -L%t1 -F%t2 2>&1 \ RUN: | FileCheck -DLDIR=%t1 -DFDIR=%t2 %s CHECK: Library search paths: CHECK-NEXT: [[LDIR]] @@ -9,7 +9,7 @@ CHECK-NEXT: [[FDIR]] CHECK-NEXT: /System/Library/Frameworks -RUN: %lld -v -dylib -o /dev/null -L%t1 -F%t2 -Z 2>&1 \ +RUN: %lld-mac -v -dylib -o /dev/null -L%t1 -F%t2 -Z 2>&1 \ RUN: | FileCheck -DLDIR=%t1 -DFDIR=%t2 --check-prefix=CHECK_Z %s CHECK_Z: Library search paths: CHECK_Z-NEXT: [[LDIR]] Index: lld/test/MachO/sectalign.s =================================================================== --- lld/test/MachO/sectalign.s +++ lld/test/MachO/sectalign.s @@ -1,29 +1,29 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: not %lld -dylib -o %t %t.o -sectalign __TEXT __text asdf 2>&1 \ +# RUN: not %lld-mac -dylib -o %t %t.o -sectalign __TEXT __text asdf 2>&1 \ # RUN: | FileCheck --check-prefix=NONUM -DNUM=asdf %s -# RUN: not %lld -dylib -o %t %t.o -sectalign __TEXT __text 0x0X4 2>&1 \ +# RUN: not %lld-mac -dylib -o %t %t.o -sectalign __TEXT __text 0x0X4 2>&1 \ # RUN: | FileCheck --check-prefix=NONUM -DNUM=0x0X4 %s # NONUM: error: -sectalign: failed to parse '[[NUM]]' as number -# RUN: not %lld -dylib -o %t %t.o -sectalign __TEXT __text 16 2>&1 \ +# RUN: not %lld-mac -dylib -o %t %t.o -sectalign __TEXT __text 16 2>&1 \ # RUN: | FileCheck --check-prefix=NOPOW -DNUM=16 %s -# RUN: not %lld -dylib -o %t %t.o -sectalign __TEXT __text 0x16 2>&1 \ +# RUN: not %lld-mac -dylib -o %t %t.o -sectalign __TEXT __text 0x16 2>&1 \ # RUN: | FileCheck --check-prefix=NOPOW -DNUM=0x16 %s -# RUN: not %lld -dylib -o %t %t.o -sectalign __TEXT __text 0 2>&1 \ +# RUN: not %lld-mac -dylib -o %t %t.o -sectalign __TEXT __text 0 2>&1 \ # RUN: | FileCheck --check-prefix=NOPOW -DNUM=0 %s # NOPOW: error: -sectalign: '[[NUM]]' (in base 16) not a power of two ## __DATA_CONST tests that the flag applies to names after section renaming. -# RUN: %lld -dylib -o %t %t.o -sectalign __TEXT __text 20 \ +# RUN: %lld-mac -dylib -o %t %t.o -sectalign __TEXT __text 20 \ # RUN: -sectalign __DATA_CONST __const 0x40 # RUN: llvm-readobj --section-headers %t \ # RUN: | FileCheck -DSECT=__text -DSEG=__TEXT -DALIGN=5 %s # RUN: llvm-readobj --section-headers %t \ # RUN: | FileCheck -DSECT=__const -DSEG=__DATA_CONST -DALIGN=6 %s -# RUN: %lld -dylib -o %t %t.o -rename_section __TEXT __text __TxT __foo \ +# RUN: %lld-mac -dylib -o %t %t.o -rename_section __TEXT __text __TxT __foo \ # RUN: -sectalign __TxT __foo 0x40 # RUN: llvm-readobj --section-headers %t \ # RUN: | FileCheck -DSECT=__foo -DSEG=__TxT -DALIGN=6 %s Index: lld/test/MachO/sectcreate.s =================================================================== --- lld/test/MachO/sectcreate.s +++ lld/test/MachO/sectcreate.s @@ -3,7 +3,7 @@ # RUN: echo "-sectcreate 1.1" >%t1 # RUN: echo "-sectcreate 1.2" >%t2 # RUN: echo "-sectcreate 2" >%t3 -# RUN: %lld \ +# RUN: %lld-mac \ # RUN: -sectcreate SEG SEC1 %t1 \ # RUN: -segcreate SEG SEC2 %t3 \ # RUN: -sectcreate SEG SEC1 %t2 \ @@ -13,7 +13,7 @@ ## -dead_strip does not strip -sectcreate sections, ## but also doesn't set S_ATTR_NO_DEAD_STRIP on them. -# RUN: %lld -dead_strip \ +# RUN: %lld-mac -dead_strip \ # RUN: -sectcreate SEG SEC1 %t1 \ # RUN: -segcreate SEG SEC2 %t3 \ # RUN: -sectcreate SEG SEC1 %t2 \ @@ -22,10 +22,10 @@ # RUN: llvm-objdump -s %t | FileCheck --check-prefix=STRIPPED %s # RUN: llvm-readobj --sections %t | FileCheck --check-prefix=STRIPPEDSEC %s -# RUN: %lld -add_empty_section foo bar -o %t %t.o +# RUN: %lld-mac -add_empty_section foo bar -o %t %t.o # RUN: llvm-readobj --sections %t | FileCheck --check-prefix=EMPTYSECTION %s -# RUN: %lld -sectcreate SEG SEC1 %t1 -add_empty_section SEG SEC1 -o %t %t.o +# RUN: %lld-mac -sectcreate SEG SEC1 %t1 -add_empty_section SEG SEC1 -o %t %t.o # RUN: llvm-readobj --sections %t | FileCheck --check-prefix=CREATEDANDEMPTY %s # CHECK: Contents of section __TEXT,__text: Index: lld/test/MachO/section-headers.s =================================================================== --- lld/test/MachO/section-headers.s +++ 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 -o %t %t.o +# RUN: %lld-mac -o %t %t.o # RUN: llvm-readobj --section-headers --macho-segment %t | FileCheck %s # CHECK: Name: __text Index: lld/test/MachO/section-merge.s =================================================================== --- lld/test/MachO/section-merge.s +++ lld/test/MachO/section-merge.s @@ -6,7 +6,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t/baz.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin -o %t/qux.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/main.o -# RUN: %lld -o %t/output %t/foo.o %t/bar.o %t/baz.o %t/qux.o %t/main.o +# RUN: %lld-mac -o %t/output %t/foo.o %t/bar.o %t/baz.o %t/qux.o %t/main.o # RUN: llvm-objdump --syms --section=__data --full-contents %t/output | FileCheck %s # CHECK: SYMBOL TABLE: Index: lld/test/MachO/section-order.s =================================================================== --- lld/test/MachO/section-order.s +++ lld/test/MachO/section-order.s @@ -3,8 +3,8 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/1.s -o %t/1.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/2.s -o %t/2.o -# RUN: %lld -dylib %t/1.o %t/2.o -o %t/12 -# RUN: %lld -dylib %t/2.o %t/1.o -o %t/21 +# RUN: %lld-mac -dylib %t/1.o %t/2.o -o %t/12 +# RUN: %lld-mac -dylib %t/2.o %t/1.o -o %t/21 # RUN: llvm-objdump --macho --section-headers %t/12 | FileCheck %s --check-prefix=CHECK-12 # RUN: llvm-objdump --macho --section-headers %t/21 | FileCheck %s --check-prefix=CHECK-21 Index: lld/test/MachO/segments.s =================================================================== --- lld/test/MachO/segments.s +++ lld/test/MachO/segments.s @@ -2,7 +2,7 @@ # RUN: rm -rf %t; mkdir -p %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/x86_64.o # RUN: llvm-mc -filetype=obj -triple=arm64_32-apple-watchos %s -o %t/arm64-32.o -# RUN: %lld -o %t/x86_64 %t/x86_64.o +# RUN: %lld-mac -o %t/x86_64 %t/x86_64.o # RUN: %lld-watchos -o %t/arm64_32 %t/arm64-32.o # RUN: llvm-readobj --macho-segment %t/x86_64 > %t/x86_64.out Index: lld/test/MachO/segprot.s =================================================================== --- lld/test/MachO/segprot.s +++ lld/test/MachO/segprot.s @@ -2,7 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o ## Make sure the option parser doesn't think --x and -w are flags. -# RUN: %lld -dylib -o %t %t.o -segprot FOO rwx xwr -segprot BAR --x --x -segprot BAZ -w -w +# RUN: %lld-mac -dylib -o %t %t.o -segprot FOO rwx xwr -segprot BAR --x --x -segprot BAZ -w -w # RUN: llvm-readobj --macho-segment %t | FileCheck %s # CHECK: Name: FOO @@ -32,10 +32,10 @@ # CHECK-NEXT: maxprot: -w- # CHECK-NEXT: initprot: -w- -# RUN: not %lld -dylib -o /dev/null %t.o -segprot FOO rwx rw 2>&1 | FileCheck %s --check-prefix=MISMATCH -# RUN: not %lld -dylib -o /dev/null %t.o -segprot __LINKEDIT rwx rwx 2>&1 | FileCheck %s --check-prefix=NO-LINKEDIT -# RUN: not %lld -dylib -o /dev/null %t.o -segprot FOO uhh wat 2>&1 | FileCheck %s --check-prefix=MISPARSE -# RUN: not %lld -dylib -o /dev/null %t.o -segprot FOO rwx 2>&1 | FileCheck %s --check-prefix=MISSING +# RUN: not %lld-mac -dylib -o /dev/null %t.o -segprot FOO rwx rw 2>&1 | FileCheck %s --check-prefix=MISMATCH +# RUN: not %lld-mac -dylib -o /dev/null %t.o -segprot __LINKEDIT rwx rwx 2>&1 | FileCheck %s --check-prefix=NO-LINKEDIT +# RUN: not %lld-mac -dylib -o /dev/null %t.o -segprot FOO uhh wat 2>&1 | FileCheck %s --check-prefix=MISPARSE +# RUN: not %lld-mac -dylib -o /dev/null %t.o -segprot FOO rwx 2>&1 | FileCheck %s --check-prefix=MISSING # MISMATCH: error: invalid argument '-segprot FOO rwx rw': max and init must be the same for non-i386 archs # NO-LINKEDIT: error: -segprot cannot be used to change __LINKEDIT's protections Index: lld/test/MachO/silent-ignore.s =================================================================== --- lld/test/MachO/silent-ignore.s +++ lld/test/MachO/silent-ignore.s @@ -4,7 +4,7 @@ ## unimplemented. ## We may still emit warnings or errors for some of the ## unimplemented ones (but those ## errors are squelched because of the ## `--version` flag.) -# RUN: %lld --version \ +# RUN: %lld-mac --version \ # RUN: -dynamic \ # RUN: -lto_library /lib/foo \ # RUN: -macosx_version_min 0 \ @@ -15,12 +15,12 @@ # RUN: -objc_abi_version 2 \ # RUN: -ios_simulator_version_min 9.0.0 \ # RUN: -sdk_version 13.2 -# RUN: not %lld -v --not-an-ignored-argument 2>&1 | FileCheck %s +# RUN: not %lld-mac -v --not-an-ignored-argument 2>&1 | FileCheck %s # CHECK: error: unknown argument '--not-an-ignored-argument' ## Check that we don't emit any warnings nor errors for these unimplemented flags. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld %t.o -o /dev/null -objc_abi_version 2 +# RUN: %lld-mac %t.o -o /dev/null -objc_abi_version 2 .globl _main _main: Index: lld/test/MachO/special-symbol-ld-install-name.s =================================================================== --- lld/test/MachO/special-symbol-ld-install-name.s +++ lld/test/MachO/special-symbol-ld-install-name.s @@ -20,7 +20,7 @@ ## Check that we emit a warning for an invalid os version. -# RUN: %no-fatal-warnings-lld -o %t/libfoo3.dylib %t/libLDInstallNameInvalid.tbd %t/foo.o -dylib \ +# RUN: %no-fatal-warnings-lld-mac -o %t/libfoo3.dylib %t/libLDInstallNameInvalid.tbd %t/foo.o -dylib \ # RUN: -platform_version macos 11.0.0 11.0.0 2>&1 | FileCheck --check-prefix=INVALID-VERSION %s # INVALID-VERSION: failed to parse os version, symbol '$ld$install_name$os11.a$/New' ignored Index: lld/test/MachO/stabs-icf.s =================================================================== --- lld/test/MachO/stabs-icf.s +++ lld/test/MachO/stabs-icf.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld -lSystem --icf=all %t.o -o %t +# RUN: %lld-mac -lSystem --icf=all %t.o -o %t # RUN: dsymutil -s %t | FileCheck %s -DDIR=%t -DSRC_PATH=%t.o # This should include no N_FUN entry for _bar2 (which is ICF'd into _bar), Index: lld/test/MachO/stabs.s =================================================================== --- lld/test/MachO/stabs.s +++ lld/test/MachO/stabs.s @@ -9,35 +9,35 @@ # RUN: env TZ=UTC touch -t "197001010000.32" %t/foo.o # RUN: llvm-ar rcsU %t/foo.a %t/foo.o -# RUN: %lld -lSystem %t/test.o %t/foo.o %t/no-debug.o -o %t/test +# RUN: %lld-mac -lSystem %t/test.o %t/foo.o %t/no-debug.o -o %t/test # RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ # RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \ # RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 ## Check that we emit the right modtime even when the object file is in an ## archive. -# RUN: %lld -lSystem %t/test.o %t/foo.a %t/no-debug.o -o %t/test +# RUN: %lld-mac -lSystem %t/test.o %t/foo.a %t/no-debug.o -o %t/test # RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ # RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ # RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 ## Check that we don't emit modtimes if ZERO_AR_DATE is set. -# RUN: env ZERO_AR_DATE=1 %lld -lSystem %t/test.o %t/foo.o %t/no-debug.o \ +# RUN: env ZERO_AR_DATE=1 %lld-mac -lSystem %t/test.o %t/foo.o %t/no-debug.o \ # RUN: -o %t/test # RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ # RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \ # RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 -# RUN: env ZERO_AR_DATE=1 %lld -lSystem %t/test.o %t/foo.a %t/no-debug.o \ +# RUN: env ZERO_AR_DATE=1 %lld-mac -lSystem %t/test.o %t/foo.a %t/no-debug.o \ # RUN: -o %t/test # RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ # RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ # RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 -# RUN: env ZERO_AR_DATE=1 %lld -lSystem %t/test.o %t/no-debug.o \ +# RUN: env ZERO_AR_DATE=1 %lld-mac -lSystem %t/test.o %t/no-debug.o \ # RUN: -all_load %t/foo.a -o %t/test # RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ # RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ # RUN: -D#TEST_TIME=0 -D#FOO_TIME=0 -# RUN: env ZERO_AR_DATE=1 %lld -lSystem %t/test.o %t/no-debug.o \ +# RUN: env ZERO_AR_DATE=1 %lld-mac -lSystem %t/test.o %t/no-debug.o \ # RUN: -force_load %t/foo.a -o %t/test # RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ # RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ @@ -45,30 +45,30 @@ ## Check that we emit absolute paths to the object files in our OSO entries ## even if our inputs are relative paths. -# RUN: cd %t && %lld -lSystem test.o foo.o no-debug.o -o test +# RUN: cd %t && %lld-mac -lSystem test.o foo.o no-debug.o -o test # RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ # RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.o \ # RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 ## Check that we emit relative path to object files in OSO entries ## when -oso_prefix is used. -# RUN: cd %t && %lld -lSystem test.o foo.o no-debug.o -oso_prefix "%t" -o %t/test-rel +# RUN: cd %t && %lld-mac -lSystem test.o foo.o no-debug.o -oso_prefix "%t" -o %t/test-rel # RUN: dsymutil -s %t/test-rel | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-PATH -# RUN: cd %t && %lld -lSystem test.o foo.o no-debug.o -oso_prefix "%t/" -o %t/test-rel +# RUN: cd %t && %lld-mac -lSystem test.o foo.o no-debug.o -oso_prefix "%t/" -o %t/test-rel # RUN: dsymutil -s %t/test-rel | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-PATH-NO-SLASH -# RUN: cd %t && %lld -lSystem test.o foo.o no-debug.o -oso_prefix "." -o %t/test-rel-dot +# RUN: cd %t && %lld-mac -lSystem test.o foo.o no-debug.o -oso_prefix "." -o %t/test-rel-dot # RUN: dsymutil -s %t/test-rel-dot | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-DOT ## Set HOME to %t (for ~ to expand to) -# RUN: cd %t && env HOME=%t %lld -lSystem test.o foo.o no-debug.o -oso_prefix "~" -o %t/test-rel-tilde +# RUN: cd %t && env HOME=%t %lld-mac -lSystem test.o foo.o no-debug.o -oso_prefix "~" -o %t/test-rel-tilde # RUN: dsymutil -s %t/test-rel-tilde | grep 'N_OSO' | FileCheck %s -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 --check-prefix=REL-PATH ## Check that we don't emit DWARF or stabs when -S is used -# RUN: %lld -lSystem test.o foo.o no-debug.o -S -o %t/test-no-debug +# RUN: %lld-mac -lSystem test.o foo.o no-debug.o -S -o %t/test-no-debug ## grep returns an exit code of 1 if it cannot match the intended pattern. We ## expect to not find any entries which requires the exit code to be negated. # RUN: llvm-nm -ap %t/test-no-debug | not grep -e ' - ' -# RUN: cd %t && %lld -lSystem test.o foo.a no-debug.o -o %t/test +# RUN: cd %t && %lld-mac -lSystem test.o foo.a no-debug.o -o %t/test # RUN: (llvm-objdump --section-headers %t/test; dsymutil -s %t/test) | \ # RUN: FileCheck %s -DDIR=%t -DFOO_PATH=%t/foo.a\(foo.o\) \ # RUN: -D#TEST_TIME=0x10 -D#FOO_TIME=0x20 @@ -134,7 +134,7 @@ ## Check that we don't attempt to emit rebase opcodes for the debug sections ## when building a PIE (since we have filtered the sections out). -# RUN: %lld -lSystem %t/test.o %t/foo.a %t/no-debug.o -o %t/test +# RUN: %lld-mac -lSystem %t/test.o %t/foo.a %t/no-debug.o -o %t/test # RUN: llvm-objdump --macho --rebase %t/test | FileCheck %s --check-prefix=PIE # PIE: Rebase table: # PIE-NEXT: segment section address type Index: lld/test/MachO/start-end.s =================================================================== --- lld/test/MachO/start-end.s +++ lld/test/MachO/start-end.s @@ -6,7 +6,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/seg.s -o %t/seg.o -# RUN: %lld -lSystem %t/main.o %t/foo.o -o %t.out \ +# RUN: %lld-mac -lSystem %t/main.o %t/foo.o -o %t.out \ # RUN: -rename_section __FOO __bar __BAZ __quux \ # RUN: -rename_section __WHAT __ever __FOO __bar \ # RUN: -u 'section$start$__UFLAG_SEG$__uflag_sect' \ @@ -29,7 +29,7 @@ ## Nothing should change if we reorder two functions in the text segment. ## (Reorder some section$start/end symbols too for good measure.) -# RUN: %lld -lSystem %t/main.o %t/foo.o -o %t.ordered.out \ +# RUN: %lld-mac -lSystem %t/main.o %t/foo.o -o %t.ordered.out \ # RUN: -order_file %t/order.txt \ # RUN: -rename_section __FOO __bar __BAZ __quux \ # RUN: -rename_section __WHAT __ever __FOO __bar \ @@ -43,7 +43,7 @@ # RUN: FileCheck %s < %t-ordered-dump.txt ## `-undefined dynamic_lookup` also shouldn't change anything. -# RUN: %lld -lSystem %t/main.o %t/foo.o -o %t.dl.out -undefined dynamic_lookup \ +# RUN: %lld-mac -lSystem %t/main.o %t/foo.o -o %t.dl.out -undefined dynamic_lookup \ # RUN: -rename_section __FOO __bar __BAZ __quux \ # RUN: -rename_section __WHAT __ever __FOO __bar \ # RUN: -u 'section$start$__UFLAG_SEG$__uflag_sect' \ @@ -66,13 +66,13 @@ ## Test that the link succeeds with dead-stripping enabled too. -# RUN: %lld -dead_strip -lSystem %t/main.o -o %t/stripped.out +# RUN: %lld-mac -dead_strip -lSystem %t/main.o -o %t/stripped.out # RUN: llvm-objdump --macho --syms --section-headers %t/stripped.out > %t-stripped-dump.txt # RUN: llvm-objdump --macho -d --no-symbolic-operands --no-show-raw-insn %t/stripped.out >> %t-stripped-dump.txt # RUN: FileCheck --check-prefix=STRIP %s < %t-stripped-dump.txt ## -u 'section$start$*' does not cause an undefined symbol error. This matches ld64. -# RUN: %lld -dead_strip -lSystem %t/main.o -u 'section$start$__FOO$__notexist' -o %t/stripped1.out +# RUN: %lld-mac -dead_strip -lSystem %t/main.o -u 'section$start$__FOO$__notexist' -o %t/stripped1.out # RUN: llvm-objdump --section-headers %t/stripped1.out | FileCheck --check-prefix=STRIP2 %s ## (Fun fact: `-e 'section$start$__TEXT$__text -dead_strip` strips @@ -216,7 +216,7 @@ ############################################################################### ## Test segment$start and segment$end. -# RUN: %lld -lSystem %t/seg.o -o %t.seg.out \ +# RUN: %lld-mac -lSystem %t/seg.o -o %t.seg.out \ # RUN: -rename_segment __FOO __BAZ \ # RUN: -rename_segment __WHAT __FOO \ # RUN: -u 'segment$start$__UFLAG_SEG' \ Index: lld/test/MachO/start-lib.s =================================================================== --- lld/test/MachO/start-lib.s +++ lld/test/MachO/start-lib.s @@ -11,15 +11,15 @@ # RUN: llvm-as 2.ll -o 2.bc ## Neither 1.o nor 2.o is loaded. -# RUN: %lld main.o --start-lib 1.o 2.o --end-lib -why_load | count 0 -# RUN: %lld main.o --start-lib -filelist filelist --end-lib -why_load | count 0 +# RUN: %lld-mac main.o --start-lib 1.o 2.o --end-lib -why_load | count 0 +# RUN: %lld-mac main.o --start-lib -filelist filelist --end-lib -why_load | count 0 # RUN: llvm-readobj -s a.out | FileCheck %s # CHECK-NOT: Name: _foo # CHECK-NOT: Name: _bar ## _bar loads 2.o. The last --end-lib can be omitted. -# RUN: %lld main.o -u _bar --start-lib 1.o 2.o -t -why_load | FileCheck %s --check-prefix=CHECK2WHY -# RUN: %lld main.o -u _bar --start-lib -filelist filelist -t -why_load | FileCheck %s --check-prefix=CHECK2WHY +# RUN: %lld-mac main.o -u _bar --start-lib 1.o 2.o -t -why_load | FileCheck %s --check-prefix=CHECK2WHY +# RUN: %lld-mac main.o -u _bar --start-lib -filelist filelist -t -why_load | FileCheck %s --check-prefix=CHECK2WHY # RUN: llvm-readobj -s a.out | FileCheck --check-prefix=CHECK2 %s # CHECK2WHY: main.o # CHECK2WHY-NEXT: 2.o @@ -30,9 +30,9 @@ # CHECK2-NOT: Name: _foo ## _foo loads 1.o. 1.o loads 2.o. -# RUN: %lld main.o -u _foo --start-lib 1.o 2.o -why_load | FileCheck %s --check-prefix=CHECK3WHY +# RUN: %lld-mac main.o -u _foo --start-lib 1.o 2.o -why_load | FileCheck %s --check-prefix=CHECK3WHY # RUN: llvm-readobj -s a.out | FileCheck --check-prefix=CHECK3 %s -# RUN: %lld main.o -u _foo --start-lib 2.o --end-lib --start-lib 1.o -why_load | FileCheck %s --check-prefix=CHECK3WHY +# RUN: %lld-mac main.o -u _foo --start-lib 2.o --end-lib --start-lib 1.o -why_load | FileCheck %s --check-prefix=CHECK3WHY # RUN: llvm-readobj -s a.out | FileCheck --check-prefix=CHECK3 %s # CHECK3WHY: _foo forced load of 1.o # CHECK3WHY-NEXT: _bar forced load of 2.o @@ -41,25 +41,25 @@ # CHECK3-DAG: Name: _bar ## Don't treat undefined _bar in 1.o as a lazy definition. -# RUN: not %lld main.o -u _bar --start-lib 1.o 2>&1 | FileCheck %s --check-prefix=CHECK4 +# RUN: not %lld-mac main.o -u _bar --start-lib 1.o 2>&1 | FileCheck %s --check-prefix=CHECK4 # CHECK4: error: undefined symbol: _bar -# RUN: %lld main.o -u _common --start-lib common.o +# RUN: %lld-mac main.o -u _common --start-lib common.o # RUN: llvm-readobj -s a.out | FileCheck %s --check-prefix=COMMON1 # COMMON1: Name: _common -# RUN: %lld main.o --start-lib common.o +# RUN: %lld-mac main.o --start-lib common.o # RUN: llvm-readobj -s a.out | FileCheck %s --check-prefix=COMMON2 # COMMON2-NOT: Name: _common ## Neither 1.bc nor 2.bc is loaded. -# RUN: %lld main.o --start-lib 1.bc 2.bc -why_load | count 0 +# RUN: %lld-mac main.o --start-lib 1.bc 2.bc -why_load | count 0 # RUN: llvm-readobj -s a.out | FileCheck %s --check-prefix=BITCODE # BITCODE-NOT: Name: _foo # BITCODE-NOT: Name: _bar ## _bar loads 2.bc. -# RUN: %lld main.o -u _bar --start-lib 1.bc 2.bc -why_load | FileCheck %s --check-prefix=BITCODE2WHY +# RUN: %lld-mac main.o -u _bar --start-lib 1.bc 2.bc -why_load | FileCheck %s --check-prefix=BITCODE2WHY # RUN: llvm-readobj -s a.out | FileCheck %s --check-prefix=BITCODE2 # BITCODE2WHY: _bar forced load of 2.bc # BITCODE2WHY-EMPTY: @@ -68,19 +68,19 @@ # BITCODE2-NOT: Name: _foo ## calls-foo.o loads 1.bc. 1.bc loads 2.bc. -# RUN: %lld calls-foo.o --start-lib 1.bc 2.bc -why_load | FileCheck %s --check-prefix=BITCODE3WHY +# RUN: %lld-mac calls-foo.o --start-lib 1.bc 2.bc -why_load | FileCheck %s --check-prefix=BITCODE3WHY # RUN: llvm-readobj -s a.out | FileCheck --check-prefix=BITCODE3 %s -# RUN: %lld calls-foo.o --start-lib 2.bc --end-lib --start-lib 1.bc -why_load | FileCheck %s --check-prefix=BITCODE3WHY +# RUN: %lld-mac calls-foo.o --start-lib 2.bc --end-lib --start-lib 1.bc -why_load | FileCheck %s --check-prefix=BITCODE3WHY # RUN: llvm-readobj -s a.out | FileCheck --check-prefix=BITCODE3 %s # BITCODE3WHY: _foo forced load of 1.bc # BITCODE3WHY-NEXT: _bar forced load of 2.bc # BITCODE3WHY-EMPTY: # BITCODE3-DAG: Name: _foo -# RUN: not %lld main.o --start-lib --start-lib 2>&1 | FileCheck -check-prefix=NESTED-LIB %s +# RUN: not %lld-mac main.o --start-lib --start-lib 2>&1 | FileCheck -check-prefix=NESTED-LIB %s # NESTED-LIB: error: nested --start-lib -# RUN: not %lld --end-lib 2>&1 | FileCheck %s --check-prefix=STRAY +# RUN: not %lld-mac --end-lib 2>&1 | FileCheck %s --check-prefix=STRAY # STRAY: error: stray --end-lib #--- main.s Index: lld/test/MachO/static-link.s =================================================================== --- lld/test/MachO/static-link.s +++ 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 -o %t/test -L%t -lgoodbye %t/test.o +# RUN: %lld-mac -o %t/test -L%t -lgoodbye %t/test.o # # RUN: llvm-objdump --syms -d -r %t/test | FileCheck %s Index: lld/test/MachO/sub-library.s =================================================================== --- lld/test/MachO/sub-library.s +++ 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 -dylib %t/libhello.o -o %t/libhello.dylib -# RUN: %lld -dylib -L%t -sub_library libhello -lhello \ +# RUN: %lld-mac -dylib %t/libhello.o -o %t/libhello.dylib +# RUN: %lld-mac -dylib -L%t -sub_library libhello -lhello \ # RUN: %t/libgoodbye.o -o %t/libgoodbye.dylib -# RUN: %lld -dylib -L%t -sub_library libgoodbye -lgoodbye -install_name \ +# RUN: %lld-mac -dylib -L%t -sub_library libgoodbye -lgoodbye -install_name \ # RUN: @executable_path/libsuper.dylib %t/libsuper.o -o %t/libsuper.dylib @@ -28,11 +28,11 @@ # RUN: llvm-otool -l %t/libsuper.dylib | FileCheck %s \ # RUN: --check-prefix=REEXPORT-HEADERS -DPATH=%t/libgoodbye.dylib -# RUN: %lld -dylib -L%t -reexport-lgoodbye -install_name \ +# RUN: %lld-mac -dylib -L%t -reexport-lgoodbye -install_name \ # RUN: @executable_path/libsuper.dylib %t/libsuper.o -o %t/libsuper.dylib # RUN: llvm-otool -l %t/libsuper.dylib | FileCheck %s \ # RUN: --check-prefix=REEXPORT-HEADERS -DPATH=%t/libgoodbye.dylib -# RUN: %lld -dylib -reexport_library %t/libgoodbye.dylib -install_name \ +# RUN: %lld-mac -dylib -reexport_library %t/libgoodbye.dylib -install_name \ # RUN: @executable_path/libsuper.dylib %t/libsuper.o -o %t/libsuper.dylib # RUN: llvm-otool -l %t/libsuper.dylib | FileCheck %s \ # RUN: --check-prefix=REEXPORT-HEADERS -DPATH=%t/libgoodbye.dylib @@ -43,7 +43,7 @@ # REEXPORT-HEADERS: name [[PATH]] # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/sub-library.o -# RUN: %lld -o %t/sub-library -L%t -lsuper %t/sub-library.o +# RUN: %lld-mac -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: @@ -52,37 +52,37 @@ ## Check that we fail gracefully if the sub-library is missing -# RUN: not %lld -dylib -o %t/sub-library -sub_library libmissing %t/sub-library.o 2>&1 \ +# RUN: not %lld-mac -dylib -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 -o %t/sub-library -L%t -lsuper %t/sub-library.o 2>&1 \ +# RUN: not %lld-mac -o %t/sub-library -L%t -lsuper %t/sub-library.o 2>&1 \ # RUN: | FileCheck %s --check-prefix=MISSING-REEXPORT -DDIR=%t # MISSING-REEXPORT: error: unable to locate re-export with install name [[DIR]]/libgoodbye.dylib ## We can match dylibs without extensions too. # RUN: mkdir -p %t/Hello.framework -# RUN: %lld -dylib %t/libhello.o -o %t/Hello.framework/Hello -# RUN: %lld -dylib -o %t/libgoodbye2.dylib -sub_library Hello %t/Hello.framework/Hello %t/libgoodbye.o +# RUN: %lld-mac -dylib %t/libhello.o -o %t/Hello.framework/Hello +# RUN: %lld-mac -dylib -o %t/libgoodbye2.dylib -sub_library Hello %t/Hello.framework/Hello %t/libgoodbye.o # RUN: llvm-otool -l %t/libgoodbye2.dylib | FileCheck %s \ # RUN: --check-prefix=REEXPORT-HEADERS -DPATH=%t/Hello.framework/Hello ## -sub_umbrella works almost identically... -# RUN: %lld -dylib -o %t/libgoodbye3.dylib -sub_umbrella Hello %t/Hello.framework/Hello %t/libgoodbye.o +# RUN: %lld-mac -dylib -o %t/libgoodbye3.dylib -sub_umbrella Hello %t/Hello.framework/Hello %t/libgoodbye.o # RUN: llvm-otool -l %t/libgoodbye3.dylib | FileCheck %s \ # RUN: --check-prefix=REEXPORT-HEADERS -DPATH=%t/Hello.framework/Hello -# RUN: %lld -dylib -o %t/libgoodbye3.dylib -F %t -framework Hello -sub_umbrella Hello %t/libgoodbye.o +# RUN: %lld-mac -dylib -o %t/libgoodbye3.dylib -F %t -framework Hello -sub_umbrella Hello %t/libgoodbye.o # RUN: llvm-otool -l %t/libgoodbye3.dylib | FileCheck %s \ # RUN: --check-prefix=REEXPORT-HEADERS -DPATH=%t/Hello.framework/Hello -# RUN: %lld -dylib -o %t/libgoodbye3.dylib -F %t -reexport_framework Hello %t/libgoodbye.o +# RUN: %lld-mac -dylib -o %t/libgoodbye3.dylib -F %t -reexport_framework Hello %t/libgoodbye.o # RUN: llvm-otool -l %t/libgoodbye3.dylib | FileCheck %s \ # RUN: --check-prefix=REEXPORT-HEADERS -DPATH=%t/Hello.framework/Hello ## But it doesn't match .dylib extensions: -# RUN: not %lld -dylib -L%t -sub_umbrella libhello -lhello %t/libgoodbye.o \ +# RUN: not %lld-mac -dylib -L%t -sub_umbrella libhello -lhello %t/libgoodbye.o \ # RUN: -o %t/libgoodbye.dylib 2>&1 | FileCheck %s --check-prefix=MISSING-FRAMEWORK # MISSING-FRAMEWORK: error: -sub_umbrella libhello does not match a supplied dylib @@ -90,31 +90,31 @@ ## Check that -F (but not -L) can override the search path in install_name for ## frameworks. # RUN: mkdir -p %t/Hello2.framework -# RUN: %lld -dylib %t/libhello.o \ +# RUN: %lld-mac -dylib %t/libhello.o \ # RUN: -install_name /path/to/Hello2.framework/Hello2 \ # RUN: -o %t/Hello2.framework/Hello2 -# RUN: %lld -dylib -o %t/libgoodbye4.dylib %t/libgoodbye.o \ +# RUN: %lld-mac -dylib -o %t/libgoodbye4.dylib %t/libgoodbye.o \ # RUN: -reexport_library %t/Hello2.framework/Hello2 -# RUN: not %lld -lSystem -o %t/hello %t/libgoodbye4.dylib %t/sub-library.o 2>&1 \ +# RUN: not %lld-mac -lSystem -o %t/hello %t/libgoodbye4.dylib %t/sub-library.o 2>&1 \ # RUN: | FileCheck %s --check-prefix=NOTFOUND -# RUN: not %lld -lSystem -o %t/hello -L%t %t/libgoodbye4.dylib %t/sub-library.o 2>&1 \ +# RUN: not %lld-mac -lSystem -o %t/hello -L%t %t/libgoodbye4.dylib %t/sub-library.o 2>&1 \ # RUN: | FileCheck %s --check-prefix=NOTFOUND # NOTFOUND: unable to locate re-export with install name /path/to/Hello2.framework/Hello2 -# RUN: %lld -lSystem -o %t/hello -F%t %t/libgoodbye4.dylib %t/sub-library.o +# RUN: %lld-mac -lSystem -o %t/hello -F%t %t/libgoodbye4.dylib %t/sub-library.o ## Check that -L (but not -F) can override the search path in install_name for ## libraries. -# RUN: %lld -dylib %t/libhello.o \ +# RUN: %lld-mac -dylib %t/libhello.o \ # RUN: -install_name /path/to/libhello2.dylib \ # RUN: -o %t/libhello2.dylib -# RUN: %lld -dylib -o %t/libgoodbye5.dylib %t/libgoodbye.o \ +# RUN: %lld-mac -dylib -o %t/libgoodbye5.dylib %t/libgoodbye.o \ # RUN: -reexport_library %t/libhello2.dylib -# RUN: not %lld -lSystem -o %t/hello %t/libgoodbye5.dylib %t/sub-library.o 2>&1 \ +# RUN: not %lld-mac -lSystem -o %t/hello %t/libgoodbye5.dylib %t/sub-library.o 2>&1 \ # RUN: | FileCheck %s --check-prefix=NOTFOUND2 -# RUN: not %lld -lSystem -o %t/hello -F%t %t/libgoodbye5.dylib %t/sub-library.o 2>&1 \ +# RUN: not %lld-mac -lSystem -o %t/hello -F%t %t/libgoodbye5.dylib %t/sub-library.o 2>&1 \ # RUN: | FileCheck %s --check-prefix=NOTFOUND2 # NOTFOUND2: unable to locate re-export with install name /path/to/libhello2.dylib -# RUN: %lld -lSystem -o %t/hello -L%t %t/libgoodbye5.dylib %t/sub-library.o +# RUN: %lld-mac -lSystem -o %t/hello -L%t %t/libgoodbye5.dylib %t/sub-library.o .text .globl _main Index: lld/test/MachO/subsections-symbol-relocs.s =================================================================== --- lld/test/MachO/subsections-symbol-relocs.s +++ lld/test/MachO/subsections-symbol-relocs.s @@ -2,9 +2,9 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o -# RUN: %lld -o %t/test-1 %t/test.o -order_file %t/order-file-1 +# RUN: %lld-mac -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 -o %t/test-2 %t/test.o -order_file %t/order-file-2 +# RUN: %lld-mac -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: <_ba{{r|z}}>: Index: lld/test/MachO/symbol-resolution.s =================================================================== --- lld/test/MachO/symbol-resolution.s +++ lld/test/MachO/symbol-resolution.s @@ -1,19 +1,19 @@ # REQUIRES: x86 # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/libresolution.s -o %t/libresolution.o -# RUN: %lld -dylib -install_name \ +# RUN: %lld-mac -dylib -install_name \ # RUN: @executable_path/libresolution.dylib %t/libresolution.o -o %t/libresolution.dylib -# RUN: %lld -dylib -install_name \ +# RUN: %lld-mac -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 %t/resolution.s -o %t/resolution.o ## Check that we select the symbol defined in the first dylib passed on the ## command line. -# RUN: %lld -o %t/dylib-first -L%t -lresolution -lresolution2 %t/resolution.o +# RUN: %lld-mac -o %t/dylib-first -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 -o %t/dylib2-first -L%t -lresolution2 -lresolution %t/resolution.o +# RUN: %lld-mac -o %t/dylib2-first -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 @@ -23,7 +23,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 -o %t/obj-first -L%t %t/resolution.o -lresolution +# RUN: %lld-mac -o %t/obj-first -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. Index: lld/test/MachO/symtab.s =================================================================== --- lld/test/MachO/symtab.s +++ lld/test/MachO/symtab.s @@ -3,8 +3,8 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test2.s -o %t/test2.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/libfoo.s -o %t/libfoo.o -# RUN: %lld -dylib %t/libfoo.o -o %t/libfoo.dylib -# RUN: %lld -lSystem %t/test.o %t/test2.o %t/libfoo.dylib -o %t/test +# RUN: %lld-mac -dylib %t/libfoo.o -o %t/libfoo.dylib +# RUN: %lld-mac -lSystem %t/test.o %t/test2.o %t/libfoo.dylib -o %t/test # RUN: llvm-readobj --syms --sort-symbols=type,name --macho-dysymtab %t/test | FileCheck %s # CHECK: Symbols [ Index: lld/test/MachO/syslibroot.test =================================================================== --- lld/test/MachO/syslibroot.test +++ lld/test/MachO/syslibroot.test @@ -1,5 +1,5 @@ # Ensure that a nonexistent path is ignored with a syslibroot -# Don't use %lld to not pick up the default syslibroot flag. +# Don't use %lld-mac to not pick up the default syslibroot flag. RUN: %no-arg-lld -arch x86_64 -platform_version macos 10 11 -v -dylib \ RUN: -o /dev/null -syslibroot /var/empty 2>&1 \ Index: lld/test/MachO/t.s =================================================================== --- lld/test/MachO/t.s +++ lld/test/MachO/t.s @@ -2,7 +2,7 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s -# RUN: %lld -dylib -o %t/libfoo.dylib %t/foo.o +# RUN: %lld-mac -dylib -o %t/libfoo.dylib %t/foo.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/bar.o %t/bar.s # RUN: llvm-ar csr %t/bar.a %t/bar.o @@ -11,7 +11,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s -# RUN: %lld %t/main.o %t/baz.o %t/bar.a %t/libfoo.dylib -lSystem -o /dev/null -t | FileCheck -DPATH='%t' %s +# RUN: %lld-mac %t/main.o %t/baz.o %t/bar.a %t/libfoo.dylib -lSystem -o /dev/null -t | FileCheck -DPATH='%t' %s # CHECK-DAG: bar.a(bar.o) # CHECK-DAG: [[PATH]]/main.o Index: lld/test/MachO/tapi-framework.s =================================================================== --- lld/test/MachO/tapi-framework.s +++ lld/test/MachO/tapi-framework.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: mkdir -p %t # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %s -o %t/test.o -# RUN: %lld -o %t/test -framework CoreFoundation %t/test.o +# RUN: %lld-mac -o %t/test -framework CoreFoundation %t/test.o # # RUN: llvm-objdump --macho --dylibs-used %t/test | FileCheck %s # CHECK: /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation Index: lld/test/MachO/tapi-link.s =================================================================== --- lld/test/MachO/tapi-link.s +++ lld/test/MachO/tapi-link.s @@ -4,13 +4,13 @@ # RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %t/test.s -o %t/test.o -# RUN: %lld -o %t/test -lSystem -lc++ -framework CoreFoundation %t/libNested.tbd %t/test.o +# RUN: %lld-mac -o %t/test -lSystem -lc++ -framework CoreFoundation %t/libNested.tbd %t/test.o # RUN: llvm-objdump --bind --no-show-raw-insn -d -r %t/test | FileCheck %s ## libReexportSystem.tbd tests that we can reference symbols from a 2nd-level ## tapi document, re-exported by a top-level tapi document, which itself is ## re-exported by another top-level tapi document. -# RUN: %lld -o %t/with-reexport -lSystem -L%t %t/libReexportNested.tbd -lc++ -framework CoreFoundation %t/test.o +# RUN: %lld-mac -o %t/with-reexport -lSystem -L%t %t/libReexportNested.tbd -lc++ -framework CoreFoundation %t/test.o # RUN: llvm-objdump --bind --no-show-raw-insn -d -r %t/with-reexport | FileCheck %s # CHECK: Bind table: Index: lld/test/MachO/thin-archive.s =================================================================== --- lld/test/MachO/thin-archive.s +++ lld/test/MachO/thin-archive.s @@ -8,19 +8,19 @@ # RUN: llvm-ar csr %t/lib.a %t/lib.o # RUN: llvm-ar csrT %t/lib_thin.a %t/lib.o -# RUN: %lld %t/main.o %t/lib.a -o %t/out +# RUN: %lld-mac %t/main.o %t/lib.a -o %t/out # RUN: llvm-nm %t/out -# RUN: %lld %t/main.o %t/lib_thin.a -o %t/out +# RUN: %lld-mac %t/main.o %t/lib_thin.a -o %t/out # RUN: llvm-nm %t/out -# RUN: %lld %t/main.o -force_load %t/lib_thin.a -o %t/out +# RUN: %lld-mac %t/main.o -force_load %t/lib_thin.a -o %t/out # RUN: llvm-nm %t/out # RUN: rm %t/lib.o -# RUN: %lld %t/main.o %t/lib.a -o %t/out +# RUN: %lld-mac %t/main.o %t/lib.a -o %t/out # RUN: llvm-nm %t/out -# RUN: not %lld %t/main.o %t/lib_thin.a -demangle -o %t/out 2>&1 | \ +# RUN: not %lld-mac %t/main.o %t/lib_thin.a -demangle -o %t/out 2>&1 | \ # RUN: FileCheck --check-prefix=NOOBJ %s -# RUN: not %lld %t/main.o %t/lib_thin.a -o %t/out 2>&1 | \ +# RUN: not %lld-mac %t/main.o %t/lib_thin.a -o %t/out 2>&1 | \ # RUN: FileCheck --check-prefix=NOOBJNODEMANGLE %s # CHECK: __Z1fv Index: lld/test/MachO/thinlto-jobs.ll =================================================================== --- lld/test/MachO/thinlto-jobs.ll +++ lld/test/MachO/thinlto-jobs.ll @@ -8,12 +8,12 @@ ; RUN: opt -module-summary %t/f.s -o %t/f.o ; RUN: opt -module-summary %t/g.s -o %t/g.o -; RUN: %lld --time-trace --thinlto-jobs=1 -dylib %t/f.o %t/g.o -o %t/out -; RUN: %lld --time-trace --thinlto-jobs=2 -dylib %t/f.o %t/g.o -o %t/out -; RUN: %lld --thinlto-jobs=all -dylib %t/f.o %t/g.o -o /dev/null +; RUN: %lld-mac --time-trace --thinlto-jobs=1 -dylib %t/f.o %t/g.o -o %t/out +; RUN: %lld-mac --time-trace --thinlto-jobs=2 -dylib %t/f.o %t/g.o -o %t/out +; RUN: %lld-mac --thinlto-jobs=all -dylib %t/f.o %t/g.o -o /dev/null ;; Test with a bad value -; RUN: not %lld --thinlto-jobs=foo -dylib %t/f.o %t/g.o -o /dev/null 2>&1 | FileCheck %s +; RUN: not %lld-mac --thinlto-jobs=foo -dylib %t/f.o %t/g.o -o /dev/null 2>&1 | FileCheck %s ; CHECK: error: --thinlto-jobs: invalid job count: foo ;--- f.s Index: lld/test/MachO/thinlto-time-trace.ll =================================================================== --- lld/test/MachO/thinlto-time-trace.ll +++ lld/test/MachO/thinlto-time-trace.ll @@ -4,7 +4,7 @@ ; Test ThinLTO with time trace ; RUN: opt -module-summary %t/f.s -o %t/f.o ; RUN: opt -module-summary %t/g.s -o %t/g.o -; RUN: %lld --time-trace --time-trace-granularity=0 -dylib %t/f.o %t/g.o -o %t/libTest.dylib +; RUN: %lld-mac --time-trace --time-trace-granularity=0 -dylib %t/f.o %t/g.o -o %t/libTest.dylib ; RUN: cat %t/libTest.dylib.time-trace \ ; RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \ ; RUN: | FileCheck %s Index: lld/test/MachO/threads.s =================================================================== --- lld/test/MachO/threads.s +++ lld/test/MachO/threads.s @@ -2,12 +2,12 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o ## A positive integer is allowed. -# RUN: %lld --threads=1 %t.o -o /dev/null -# RUN: %lld --threads=2 %t.o -o /dev/null +# RUN: %lld-mac --threads=1 %t.o -o /dev/null +# RUN: %lld-mac --threads=2 %t.o -o /dev/null -# RUN: not %lld --threads=all %t.o -o /dev/null 2>&1 | FileCheck %s -DN=all -# RUN: not %lld --threads=0 %t.o -o /dev/null 2>&1 | FileCheck %s -DN=0 -# RUN: not %lld --threads=-1 %t.o -o /dev/null 2>&1 | FileCheck %s -DN=-1 +# RUN: not %lld-mac --threads=all %t.o -o /dev/null 2>&1 | FileCheck %s -DN=all +# RUN: not %lld-mac --threads=0 %t.o -o /dev/null 2>&1 | FileCheck %s -DN=0 +# RUN: not %lld-mac --threads=-1 %t.o -o /dev/null 2>&1 | FileCheck %s -DN=-1 # CHECK: error: --threads=: expected a positive integer, but got '[[N]]' Index: lld/test/MachO/time-trace.s =================================================================== --- lld/test/MachO/time-trace.s +++ lld/test/MachO/time-trace.s @@ -6,19 +6,19 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o ## Test implicit trace file name -# RUN: %lld --time-trace --time-trace-granularity=0 -o %t1.macho %t.o +# RUN: %lld-mac --time-trace --time-trace-granularity=0 -o %t1.macho %t.o # RUN: cat %t1.macho.time-trace \ # RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \ # RUN: | FileCheck %s ## Test specified trace file name, also test that `--time-trace` is not needed if the other two are used. -# RUN: %lld --time-trace-file=%t2.json --time-trace-granularity=0 -o %t2.macho %t.o +# RUN: %lld-mac --time-trace-file=%t2.json --time-trace-granularity=0 -o %t2.macho %t.o # RUN: cat %t2.json \ # RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \ # RUN: | FileCheck %s ## Test trace requested to stdout, also test that `--time-trace` is not needed if the other two are used. -# RUN: %lld --time-trace-file=- --time-trace-granularity=0 -o %t3.macho %t.o \ +# RUN: %lld-mac --time-trace-file=- --time-trace-granularity=0 -o %t3.macho %t.o \ # RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \ # RUN: | FileCheck %s Index: lld/test/MachO/tlv-dylib.s =================================================================== --- lld/test/MachO/tlv-dylib.s +++ lld/test/MachO/tlv-dylib.s @@ -2,7 +2,7 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/libtlv.s -o %t/libtlv.o -# RUN: %lld -dylib -install_name @executable_path/libtlv.dylib \ +# RUN: %lld-mac -dylib -install_name @executable_path/libtlv.dylib \ # RUN: -lSystem -o %t/libtlv.dylib %t/libtlv.o # RUN: llvm-objdump --macho --exports-trie --rebase %t/libtlv.dylib | \ # RUN: FileCheck %s --check-prefix=DYLIB @@ -14,7 +14,7 @@ # DYLIB-EMPTY: # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o -# RUN: %lld -lSystem -L%t -ltlv %t/test.o -o %t/test +# RUN: %lld-mac -lSystem -L%t -ltlv %t/test.o -o %t/test # RUN: llvm-objdump --bind -d --no-show-raw-insn %t/test | FileCheck %s # CHECK: movq [[#]](%rip), %rax ## 0x[[#%x, FOO:]] Index: lld/test/MachO/tlv.s =================================================================== --- lld/test/MachO/tlv.s +++ lld/test/MachO/tlv.s @@ -3,24 +3,24 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/regular.s -o %t/regular.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/tbss.s -o %t/tbss.o -# RUN: %lld -lSystem -no_pie -o %t/regular-no-pie %t/regular.o +# RUN: %lld-mac -lSystem -no_pie -o %t/regular-no-pie %t/regular.o # RUN: llvm-otool -hv %t/regular-no-pie | FileCheck %s --check-prefix=HEADER # RUN: llvm-objdump -d --bind --rebase %t/regular-no-pie | FileCheck %s --check-prefixes=REG,LINKEDIT # RUN: llvm-objdump --macho --section=__DATA,__thread_vars %t/regular-no-pie | \ # RUN: FileCheck %s --check-prefix=REG-TLVP -# RUN: %lld -lSystem %t/regular.o -o %t/regular-pie +# RUN: %lld-mac -lSystem %t/regular.o -o %t/regular-pie # RUN: llvm-otool -hv %t/regular-pie | FileCheck %s --check-prefix=HEADER # RUN: llvm-objdump -d --bind --rebase %t/regular-pie | FileCheck %s --check-prefixes=REG,LINKEDIT # RUN: llvm-objdump --macho --section=__DATA,__thread_vars %t/regular-pie | \ # RUN: FileCheck %s --check-prefix=REG-TLVP -# RUN: %lld -lSystem %t/tbss.o -o %t/tbss -e _f +# RUN: %lld-mac -lSystem %t/tbss.o -o %t/tbss -e _f # RUN: llvm-objdump -d --bind --rebase %t/tbss | FileCheck %s --check-prefixes=TBSS,LINKEDIT # RUN: llvm-objdump --macho --section=__DATA,__thread_vars %t/tbss | \ # RUN: FileCheck %s --check-prefix=TBSS-TLVP -# RUN: %lld -lSystem %t/regular.o %t/tbss.o -o %t/regular-and-tbss +# RUN: %lld-mac -lSystem %t/regular.o %t/tbss.o -o %t/regular-and-tbss # RUN: llvm-objdump -d --bind --rebase %t/regular-and-tbss | FileCheck %s --check-prefixes=REG,TBSS,LINKEDIT # RUN: llvm-objdump --macho --section=__DATA,__thread_vars %t/regular-and-tbss | \ # RUN: FileCheck %s --check-prefix=REG-TBSS-TLVP @@ -28,7 +28,7 @@ ## Check that we always put __thread_bss immediately after __thread_data, ## regardless of the order of the input files. -# RUN: %lld -lSystem %t/tbss.o %t/regular.o -o %t/regular-and-tbss +# RUN: %lld-mac -lSystem %t/tbss.o %t/regular.o -o %t/regular-and-tbss # RUN: llvm-objdump --section-headers %t/regular-and-tbss | FileCheck %s --check-prefix=SECTIONS # HEADER: MH_HAS_TLV_DESCRIPTORS Index: lld/test/MachO/treat-undef-sym.s =================================================================== --- lld/test/MachO/treat-undef-sym.s +++ lld/test/MachO/treat-undef-sym.s @@ -4,40 +4,40 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t/live.s -o %t/live.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t/dead.s -o %t/dead.o -# RUN: not %lld -undefined bogus -o /dev/null %t/live.o 2>&1 | \ +# RUN: not %lld-mac -undefined bogus -o /dev/null %t/live.o 2>&1 | \ # RUN: FileCheck %s -check-prefix=UNKNOWN -# RUN: not %lld -undefined error -o /dev/null %t/live.o 2>&1 | \ +# RUN: not %lld-mac -undefined error -o /dev/null %t/live.o 2>&1 | \ # RUN: FileCheck %s -check-prefix=ERROR -# RUN: not %lld -undefined warning -o /dev/null %t/live.o 2>&1 | \ +# RUN: not %lld-mac -undefined warning -o /dev/null %t/live.o 2>&1 | \ # RUN: FileCheck %s -check-prefix=INVAL-WARNING -# RUN: not %lld -undefined suppress -o /dev/null %t/live.o 2>&1 | \ +# RUN: not %lld-mac -undefined suppress -o /dev/null %t/live.o 2>&1 | \ # RUN: FileCheck %s -check-prefix=INVAL-SUPPRESS -# RUN: %lld -undefined dynamic_lookup -lSystem -o %t/live.out %t/live.o 2>&1 | count 0 +# RUN: %lld-mac -undefined dynamic_lookup -lSystem -o %t/live.out %t/live.o 2>&1 | count 0 # RUN: llvm-objdump --macho --lazy-bind %t/live.out \ # RUN: | FileCheck --check-prefix=BIND %s -# RUN: %no-fatal-warnings-lld -lSystem -flat_namespace -undefined warning \ +# RUN: %no-fatal-warnings-lld-mac -lSystem -flat_namespace -undefined warning \ # RUN: -o %t/live.out %t/live.o 2>&1 | \ # RUN: FileCheck %s -check-prefix=WARNING # RUN: llvm-objdump --macho --lazy-bind %t/live.out \ # RUN: | FileCheck --check-prefix=BIND %s -# RUN: %lld -flat_namespace -lSystem -undefined suppress -o %t/live.out %t/live.o \ +# RUN: %lld-mac -flat_namespace -lSystem -undefined suppress -o %t/live.out %t/live.o \ # RUN: 2>&1 | count 0 # RUN: llvm-objdump --macho --lazy-bind %t/live.out \ # RUN: | FileCheck --check-prefix=BIND %s -# RUN: %lld -flat_namespace -lSystem -undefined dynamic_lookup -o \ +# RUN: %lld-mac -flat_namespace -lSystem -undefined dynamic_lookup -o \ # RUN: %t/live.out %t/live.o 2>&1 | count 0 # RUN: llvm-objdump --macho --lazy-bind %t/live.out \ # RUN: | FileCheck --check-prefix=BIND %s ## Undefined symbols in dead code should not raise an error iff ## -dead_strip is enabled. -# RUN: not %lld -dylib -undefined error -o /dev/null %t/dead.o 2>&1 \ +# RUN: not %lld-mac -dylib -undefined error -o /dev/null %t/dead.o 2>&1 \ # RUN: | FileCheck --check-prefix=ERROR %s -# RUN: not %lld -dylib -dead_strip -undefined error -o /dev/null %t/live.o 2>&1\ +# RUN: not %lld-mac -dylib -dead_strip -undefined error -o /dev/null %t/live.o 2>&1\ # RUN: | FileCheck --check-prefix=ERROR %s -# RUN: %lld -dylib -dead_strip -undefined error -o /dev/null %t/dead.o +# RUN: %lld-mac -dylib -dead_strip -undefined error -o /dev/null %t/dead.o # ERROR: error: undefined symbol: _bar # ERROR-NEXT: >>> referenced by Index: lld/test/MachO/u.s =================================================================== --- lld/test/MachO/u.s +++ lld/test/MachO/u.s @@ -6,15 +6,15 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s -# RUN: %lld -lSystem %t/main.o %t/lib.a -o /dev/null -why_load | count 0 +# RUN: %lld-mac -lSystem %t/main.o %t/lib.a -o /dev/null -why_load | count 0 -# RUN: %lld -lSystem %t/main.o %t/lib.a -u _foo -o /dev/null -why_load | \ +# RUN: %lld-mac -lSystem %t/main.o %t/lib.a -u _foo -o /dev/null -why_load | \ # RUN: FileCheck %s --check-prefix=FOO -# RUN: not %lld %t/main.o %t/lib.a -u _asdf -u _fdsa -o /dev/null 2>&1 | \ +# RUN: not %lld-mac %t/main.o %t/lib.a -u _asdf -u _fdsa -o /dev/null 2>&1 | \ # RUN: FileCheck %s --check-prefix=UNDEF -# RUN: %lld -lSystem %t/main.o %t/lib.a -u _asdf -undefined dynamic_lookup -o %t/dyn-lookup +# RUN: %lld-mac -lSystem %t/main.o %t/lib.a -u _asdf -undefined dynamic_lookup -o %t/dyn-lookup # RUN: llvm-objdump --macho --syms %t/dyn-lookup | FileCheck %s --check-prefix=DYN # FOO: _foo forced load of {{.+}}lib.a(foo.o) Index: lld/test/MachO/umbrella.s =================================================================== --- lld/test/MachO/umbrella.s +++ lld/test/MachO/umbrella.s @@ -1,11 +1,11 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t.o %s -# RUN: %lld -dylib -o %t.dylib -umbrella umbrella.dylib %t.o +# RUN: %lld-mac -dylib -o %t.dylib -umbrella umbrella.dylib %t.o # RUN: llvm-otool -lv %t.dylib | FileCheck %s -# RUN: %no-fatal-warnings-lld -bundle -o %t.so -umbrella umbrella.dylib %t.o \ -# RUN: 2>&1 | FileCheck --check-prefix=WARN %s +# RUN: %no-fatal-warnings-lld-mac -bundle -o %t.so -umbrella umbrella.dylib \ +# RUN: %t.o 2>&1 | FileCheck --check-prefix=WARN %s # WARN: warning: -umbrella used, but not creating dylib # RUN: llvm-otool -lv %t.so | FileCheck %s Index: lld/test/MachO/unsorted-relocations.yaml =================================================================== --- lld/test/MachO/unsorted-relocations.yaml +++ lld/test/MachO/unsorted-relocations.yaml @@ -6,7 +6,7 @@ ## this. # RUN: yaml2obj %s -o %t.o -# RUN: %lld -dylib -o %t %t.o +# RUN: %lld-mac -dylib -o %t %t.o # RUN: llvm-objdump --macho -d %t | FileCheck %s # CHECK: _foo: Index: lld/test/MachO/uuid.s =================================================================== --- lld/test/MachO/uuid.s +++ lld/test/MachO/uuid.s @@ -2,8 +2,8 @@ # UNSUPPORTED: system-windows # RUN: rm -rf %t && mkdir -p %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/test.o -# RUN: %lld -lSystem %t/test.o -o %t/a -# RUN: %lld -lSystem %t/test.o -o %t/b +# RUN: %lld-mac -lSystem %t/test.o -o %t/a +# RUN: %lld-mac -lSystem %t/test.o -o %t/b # RUN: llvm-dwarfdump --uuid %t/a | awk '{print $2}' > %t/uuida # RUN: llvm-dwarfdump --uuid %t/b | awk '{print $2}' > %t/uuidb # RUN: FileCheck %s < %t/uuida @@ -12,7 +12,7 @@ ## Ensure -final_output is used for universal binaries, which may be linked with ## temporary output file names -# RUN: %lld -lSystem %t/test.o -o %t/c -final_output %t/a +# RUN: %lld-mac -lSystem %t/test.o -o %t/c -final_output %t/a # RUN: llvm-dwarfdump --uuid %t/c | awk '{print $2}' > %t/uuidc # RUN: cmp %t/uuida %t/uuidc Index: lld/test/MachO/weak-binding.s =================================================================== --- lld/test/MachO/weak-binding.s +++ lld/test/MachO/weak-binding.s @@ -2,8 +2,8 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/libfoo.s -o %t/libfoo.o -# RUN: %lld -dylib %t/libfoo.o -o %t/libfoo.dylib -# RUN: %lld %t/test.o -L%t -lfoo -o %t/test -lSystem +# RUN: %lld-mac -dylib %t/libfoo.o -o %t/libfoo.dylib +# RUN: %lld-mac %t/test.o -L%t -lfoo -o %t/test -lSystem # RUN: llvm-objdump -d --no-show-raw-insn --rebase --bind --lazy-bind \ # RUN: --weak-bind --full-contents %t/test | FileCheck %s Index: lld/test/MachO/weak-def-can-be-hidden.s =================================================================== --- lld/test/MachO/weak-def-can-be-hidden.s +++ lld/test/MachO/weak-def-can-be-hidden.s @@ -22,7 +22,7 @@ ## Think: Inline function compiled without any -fvisibility flags, inline ## function does not have its address taken. In -O2 compiles, GlobalOpt will ## upgrade the inline function from .weak_definition to .weak_def_can_be_hidden. -# RUN: %lld -dylib -o %t/weak-autohide-foo.dylib \ +# RUN: %lld-mac -dylib -o %t/weak-autohide-foo.dylib \ # RUN: %t/weak-autohide-foo.o %t/ref-foo.o # RUN: llvm-objdump --syms --exports-trie %t/weak-autohide-foo.dylib | \ # RUN: FileCheck --check-prefix=EXPORTS %s @@ -52,7 +52,7 @@ ## ld64 sets WEAKBIND and BINDS_TO_WEAK in the mach-o header even though there ## are no weak bindings or weak definitions after processing the autohide. That -## looks like a bug in ld64 (?) If you change lit.local.cfg to set %lld to ld to +## looks like a bug in ld64 (?) If you change lit.local.cfg to set %lld-mac to ld to ## test compatibility, you have to add some arbitrary suffix to these two lines: # HEADERS-NOT: WEAK_DEFINES # HEADERS-NOT: BINDS_TO_WEAK @@ -60,7 +60,7 @@ ## Same behavior for a symbol that's both .weak_def_can_be_hidden and ## .private_extern. Think: Inline function compiled with ## -fvisibility-inlines-hidden. -# RUN: %lld -dylib -o %t/weak-autohide-foo-pe.dylib \ +# RUN: %lld-mac -dylib -o %t/weak-autohide-foo-pe.dylib \ # RUN: %t/weak-autohide-foo-pe.o %t/ref-foo.o # RUN: llvm-objdump --syms --exports-trie %t/weak-autohide-foo-pe.dylib | \ # RUN: FileCheck --check-prefix=EXPORTS %s @@ -73,7 +73,7 @@ ## In fact, a regular weak symbol that's .private_extern behaves the same ## as well. -# RUN: %lld -dylib -o %t/weak-foo-pe.dylib %t/weak-foo-pe.o %t/ref-foo.o +# RUN: %lld-mac -dylib -o %t/weak-foo-pe.dylib %t/weak-foo-pe.o %t/ref-foo.o # RUN: llvm-objdump --syms --exports-trie %t/weak-foo-pe.dylib | \ # RUN: FileCheck --check-prefix=EXPORTS %s # RUN: llvm-nm -m %t/weak-foo-pe.dylib | \ @@ -85,7 +85,7 @@ ## Combining a regular weak_definition with a weak_def_can_be_hidden produces ## a regular weak external. -# RUN: %lld -dylib -o %t/weak-foo.dylib -lSystem \ +# RUN: %lld-mac -dylib -o %t/weak-foo.dylib -lSystem \ # RUN: %t/weak-autohide-foo.o %t/weak-foo.o %t/ref-foo.o # RUN: llvm-objdump --syms --exports-trie %t/weak-foo.dylib | \ # RUN: FileCheck --check-prefix=WEAK %s Index: lld/test/MachO/weak-definition-direct-fetch.s =================================================================== --- lld/test/MachO/weak-definition-direct-fetch.s +++ lld/test/MachO/weak-definition-direct-fetch.s @@ -9,9 +9,9 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weakfoo.s -o %t/weakfoo.o -# RUN: %lld -dylib -install_name \ +# RUN: %lld-mac -dylib -install_name \ # RUN: @executable_path/libfoo.dylib %t/foo.o -o %t/libfoo.dylib -# RUN: %lld -dylib -install_name \ +# RUN: %lld-mac -dylib -install_name \ # RUN: @executable_path/libweakfoo.dylib %t/weakfoo.o -o %t/libweakfoo.dylib # RUN: llvm-objdump --macho --exports-trie %t/libweakfoo.dylib | FileCheck %s --check-prefix WEAK-DYLIB-CHECK @@ -42,83 +42,83 @@ ## For dylibs and object files, the non-weak symbol always wins. But the weak ## flag has no effect when we are dealing with two archive symbols. -# RUN: %lld -lSystem -o %t/weak-nonweak-dylibs -L%t -lweakfoo -lfoo %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/weak-nonweak-dylibs -L%t -lweakfoo -lfoo %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-nonweak-dylibs | FileCheck %s --check-prefix=PREFER-NONWEAK-DYLIB -# RUN: %lld -lSystem -o %t/nonweak-weak-dylibs -L%t -lfoo -lweakfoo %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/nonweak-weak-dylibs -L%t -lfoo -lweakfoo %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/nonweak-weak-dylibs | FileCheck %s --check-prefix=PREFER-NONWEAK-DYLIB -# RUN: %lld -lSystem -o %t/weak-nonweak-objs %t/weakfoo.o %t/foo.o %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/weak-nonweak-objs %t/weakfoo.o %t/foo.o %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-nonweak-objs | FileCheck %s --check-prefix=PREFER-NONWEAK-OBJECT -# RUN: %lld -lSystem -o %t/nonweak-weak-objs %t/foo.o %t/weakfoo.o %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/nonweak-weak-objs %t/foo.o %t/weakfoo.o %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/nonweak-weak-objs | FileCheck %s --check-prefix=PREFER-NONWEAK-OBJECT -# RUN: %lld -lSystem -o %t/weak-nonweak-archives %t/weakfoo.a %t/foo.a %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/weak-nonweak-archives %t/weakfoo.a %t/foo.a %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-nonweak-archives | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -lSystem -o %t/nonweak-weak-archives %t/foo.a %t/weakfoo.a %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/nonweak-weak-archives %t/foo.a %t/weakfoo.a %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/nonweak-weak-archives | FileCheck %s --check-prefix=PREFER-NONWEAK-OBJECT ## The next 5 chunks refs-foo.symbol pairs of different types. ## (Weak) archive symbols take precedence over weak dylib symbols. -# RUN: %lld -lSystem -o %t/weak-dylib-weak-ar -L%t -lweakfoo %t/weakfoo.a %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/weak-dylib-weak-ar -L%t -lweakfoo %t/weakfoo.a %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-dylib-weak-ar | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -lSystem -o %t/weak-ar-weak-dylib -L%t %t/weakfoo.a -lweakfoo %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/weak-ar-weak-dylib -L%t %t/weakfoo.a -lweakfoo %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-ar-weak-dylib | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -lSystem -o %t/weak-dylib-weak-ar -L%t -lweakfoo --start-lib %t/weakfoo.o --end-lib %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/weak-dylib-weak-ar -L%t -lweakfoo --start-lib %t/weakfoo.o --end-lib %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-dylib-weak-ar | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -lSystem -o %t/weak-ar-weak-dylib -L%t --start-lib %t/weakfoo.o --end-lib -lweakfoo %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/weak-ar-weak-dylib -L%t --start-lib %t/weakfoo.o --end-lib -lweakfoo %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-ar-weak-dylib | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT ## (Weak) archive symbols have the same precedence as dylib symbols. -# RUN: %lld -lSystem -o %t/weak-ar-nonweak-dylib -L%t %t/weakfoo.a -lfoo %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/weak-ar-nonweak-dylib -L%t %t/weakfoo.a -lfoo %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-ar-nonweak-dylib | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -lSystem -o %t/nonweak-dylib-weak-ar -L%t -lfoo %t/weakfoo.a %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/nonweak-dylib-weak-ar -L%t -lfoo %t/weakfoo.a %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/nonweak-dylib-weak-ar | FileCheck %s --check-prefix=PREFER-NONWEAK-DYLIB ## Weak defined symbols take precedence over weak dylib symbols. -# RUN: %lld -lSystem -o %t/weak-dylib-weak-obj -L%t -lweakfoo %t/weakfoo.o %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/weak-dylib-weak-obj -L%t -lweakfoo %t/weakfoo.o %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-dylib-weak-obj | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -lSystem -o %t/weak-obj-weak-dylib -L%t %t/weakfoo.o -lweakfoo %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/weak-obj-weak-dylib -L%t %t/weakfoo.o -lweakfoo %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-obj-weak-dylib | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT ## Weak defined symbols take precedence over dylib symbols. -# RUN: %lld -lSystem -o %t/weak-obj-nonweak-dylib -L%t %t/weakfoo.o -lfoo %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/weak-obj-nonweak-dylib -L%t %t/weakfoo.o -lfoo %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-obj-nonweak-dylib | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -lSystem -o %t/nonweak-dylib-weak-obj -L%t -lfoo %t/weakfoo.o %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/nonweak-dylib-weak-obj -L%t -lfoo %t/weakfoo.o %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/nonweak-dylib-weak-obj | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT ## Weak defined symbols take precedence over archive symbols. -# RUN: %lld -lSystem -o %t/weak-obj-nonweak-ar %t/weakfoo.o %t/foo.a %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/weak-obj-nonweak-ar %t/weakfoo.o %t/foo.a %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-obj-nonweak-ar | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -lSystem -o %t/nonweak-ar-weak-obj %t/foo.a %t/weakfoo.o %t/refs-foo.o +# RUN: %lld-mac -lSystem -o %t/nonweak-ar-weak-obj %t/foo.a %t/weakfoo.o %t/refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/nonweak-ar-weak-obj | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT ## Regression test: A weak dylib symbol that isn't referenced by an undefined ## symbol should not cause an archive symbol to get loaded. -# RUN: %lld -dylib -lSystem -o %t/weak-ar-weak-unref-dylib -L%t %t/weakfoo.a -lweakfoo +# RUN: %lld-mac -dylib -lSystem -o %t/weak-ar-weak-unref-dylib -L%t %t/weakfoo.a -lweakfoo # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-ar-weak-unref-dylib | FileCheck %s --check-prefix=NO-SYM -# RUN: %lld -dylib -lSystem -o %t/weak-unref-dylib-weak-ar -L%t -lweakfoo %t/weakfoo.a +# RUN: %lld-mac -dylib -lSystem -o %t/weak-unref-dylib-weak-ar -L%t -lweakfoo %t/weakfoo.a # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-unref-dylib-weak-ar | FileCheck %s --check-prefix=NO-SYM -# RUN: %lld -dylib -lSystem -o %t/weak-ar-weak-unref-dylib -L%t --start-lib %t/weakfoo.o --end-lib -lweakfoo +# RUN: %lld-mac -dylib -lSystem -o %t/weak-ar-weak-unref-dylib -L%t --start-lib %t/weakfoo.o --end-lib -lweakfoo # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-ar-weak-unref-dylib | FileCheck %s --check-prefix=NO-SYM -# RUN: %lld -dylib -lSystem -o %t/weak-unref-dylib-weak-ar -L%t -lweakfoo --start-lib %t/weakfoo.o --end-lib +# RUN: %lld-mac -dylib -lSystem -o %t/weak-unref-dylib-weak-ar -L%t -lweakfoo --start-lib %t/weakfoo.o --end-lib # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-unref-dylib-weak-ar | FileCheck %s --check-prefix=NO-SYM ## However, weak references are sufficient to cause the archive to be loaded. -# RUN: %lld -dylib -lSystem -o %t/weak-ar-weak-ref-weak-dylib -L%t %t/weakfoo.a -lweakfoo %t/weak-refs-foo.o +# RUN: %lld-mac -dylib -lSystem -o %t/weak-ar-weak-ref-weak-dylib -L%t %t/weakfoo.a -lweakfoo %t/weak-refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-ar-weak-ref-weak-dylib | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -dylib -lSystem -o %t/weak-ref-weak-dylib-weak-ar -L%t -lweakfoo %t/weakfoo.a %t/weak-refs-foo.o +# RUN: %lld-mac -dylib -lSystem -o %t/weak-ref-weak-dylib-weak-ar -L%t -lweakfoo %t/weakfoo.a %t/weak-refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-ref-weak-dylib-weak-ar | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -dylib -lSystem -o %t/weak-ref-weak-dylib-weak-ar -L%t -lweakfoo %t/weak-refs-foo.o %t/weakfoo.a +# RUN: %lld-mac -dylib -lSystem -o %t/weak-ref-weak-dylib-weak-ar -L%t -lweakfoo %t/weak-refs-foo.o %t/weakfoo.a # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-ref-weak-dylib-weak-ar | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -dylib -lSystem -o %t/weak-ar-weak-ref-weak-dylib -L%t --start-lib %t/weakfoo.o --end-lib -lweakfoo %t/weak-refs-foo.o +# RUN: %lld-mac -dylib -lSystem -o %t/weak-ar-weak-ref-weak-dylib -L%t --start-lib %t/weakfoo.o --end-lib -lweakfoo %t/weak-refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-ar-weak-ref-weak-dylib | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -dylib -lSystem -o %t/weak-ref-weak-dylib-weak-ar -L%t -lweakfoo --start-lib %t/weakfoo.o --end-lib %t/weak-refs-foo.o +# RUN: %lld-mac -dylib -lSystem -o %t/weak-ref-weak-dylib-weak-ar -L%t -lweakfoo --start-lib %t/weakfoo.o --end-lib %t/weak-refs-foo.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-ref-weak-dylib-weak-ar | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -dylib -lSystem -o %t/weak-ref-weak-dylib-weak-ar -L%t -lweakfoo %t/weak-refs-foo.o --start-lib %t/weakfoo.o --end-lib +# RUN: %lld-mac -dylib -lSystem -o %t/weak-ref-weak-dylib-weak-ar -L%t -lweakfoo %t/weak-refs-foo.o --start-lib %t/weakfoo.o --end-lib # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-ref-weak-dylib-weak-ar | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT #--- foo.s Index: lld/test/MachO/weak-definition-gc.s =================================================================== --- lld/test/MachO/weak-definition-gc.s +++ lld/test/MachO/weak-definition-gc.s @@ -9,11 +9,11 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weak-nosub.s -o %t/weak-nosub.o ## Test that weak symbols are emitted just once with .subsections_via_symbols -# RUN: %lld -dylib -o %t/out.dylib %t/weak-sub.o %t/weak-sub.o +# RUN: %lld-mac -dylib -o %t/out.dylib %t/weak-sub.o %t/weak-sub.o # RUN: llvm-otool -jtV %t/out.dylib | FileCheck --check-prefix=SUB %s -# RUN: %lld -dylib -o %t/out.dylib %t/weak-nosub.o %t/weak-sub.o +# RUN: %lld-mac -dylib -o %t/out.dylib %t/weak-nosub.o %t/weak-sub.o # RUN: llvm-otool -jtV %t/out.dylib | FileCheck --check-prefix=SUB %s -# RUN: %lld -dylib -o %t/out.dylib %t/weak-sub.o %t/weak-nosub.o +# RUN: %lld-mac -dylib -o %t/out.dylib %t/weak-sub.o %t/weak-nosub.o # RUN: llvm-otool -jtV %t/out.dylib | FileCheck --check-prefix=SUB %s # SUB: _foo # SUB-NEXT: retq @@ -24,17 +24,17 @@ ## We can even strip weak symbols without subsections_via_symbols as long ## as none of the weak symbols in a section are needed. -# RUN: %lld -dylib -o %t/out.dylib %t/weak-nosub.o %t/weak-nosub.o +# RUN: %lld-mac -dylib -o %t/out.dylib %t/weak-nosub.o %t/weak-nosub.o # RUN: llvm-otool -jtV %t/out.dylib | FileCheck --check-prefix=SUB %s ## Test that omitted weak symbols don't add entries to the compact unwind table. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/weak-sub-lsda.s -o %t/weak-sub-lsda.o -# RUN: %lld -dylib -lc++ -o %t/out.dylib %t/weak-sub-lsda.o %t/weak-sub-lsda.o +# RUN: %lld-mac -dylib -lc++ -o %t/out.dylib %t/weak-sub-lsda.o %t/weak-sub-lsda.o # RUN: llvm-objdump --macho --unwind-info --syms %t/out.dylib | FileCheck %s --check-prefix=ONE-UNWIND -# RUN: %lld -dylib -lc++ -o %t/out.dylib %t/weak-sub.o %t/weak-sub-lsda.o +# RUN: %lld-mac -dylib -lc++ -o %t/out.dylib %t/weak-sub.o %t/weak-sub-lsda.o # RUN: llvm-objdump --macho --unwind-info --syms %t/out.dylib | FileCheck %s --check-prefix=NO-UNWIND # RUN: yaml2obj %t/weak-sub-lsda-r.yaml -o %t/weak-sub-lsda-r.o -# RUN: %lld -dylib -lc++ -o %t/out.dylib %t/weak-sub.o %t/weak-sub-lsda-r.o +# RUN: %lld-mac -dylib -lc++ -o %t/out.dylib %t/weak-sub.o %t/weak-sub-lsda-r.o # RUN: llvm-objdump --macho --unwind-info --syms %t/out.dylib | FileCheck %s --check-prefix=NO-UNWIND # ONE-UNWIND: SYMBOL TABLE: @@ -60,12 +60,12 @@ ## the right order. We're happy to not crash at link time for now. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/weak-sub-alt.s -o %t/weak-sub-alt.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/weak-sub-alt2.s -o %t/weak-sub-alt2.o -# RUN: %lld -dylib -o %t/out.dylib %t/weak-sub-alt.o %t/weak-sub-alt2.o -# RUN: %lld -dylib -o %t/out.dylib %t/weak-sub-alt2.o %t/weak-sub-alt.o +# RUN: %lld-mac -dylib -o %t/out.dylib %t/weak-sub-alt.o %t/weak-sub-alt2.o +# RUN: %lld-mac -dylib -o %t/out.dylib %t/weak-sub-alt2.o %t/weak-sub-alt.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/weak-aligned-1.s -o %t/weak-aligned-1.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/weak-aligned-2.s -o %t/weak-aligned-2.o -# RUN: %lld -o %t/out -lSystem %t/weak-aligned-1.o %t/weak-aligned-2.o +# RUN: %lld-mac -o %t/out -lSystem %t/weak-aligned-1.o %t/weak-aligned-2.o # RUN: llvm-objdump --syms --section=__const --full-contents %t/out | FileCheck --check-prefix=ALIGN %s # ALIGN: SYMBOL TABLE: # ALIGN-DAG: [[#%x, ADDR:]] l O __DATA_CONST,__const _weak1 @@ -78,8 +78,8 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/weak-def.s -o %t/weak-def.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/strong-def.s -o %t/strong-def.o -# RUN: %lld -dylib -lc++ -o %t/weak-strong-mixed.dylib %t/weak-def.o %t/strong-def.o -# RUN: %lld -dylib -lc++ -o %t/strong-weak-mixed.dylib %t/strong-def.o %t/weak-def.o +# RUN: %lld-mac -dylib -lc++ -o %t/weak-strong-mixed.dylib %t/weak-def.o %t/strong-def.o +# RUN: %lld-mac -dylib -lc++ -o %t/strong-weak-mixed.dylib %t/strong-def.o %t/weak-def.o ## Check that omitted weak symbols are not adding their section and unwind stuff. # RUN: llvm-otool -jtV %t/weak-strong-mixed.dylib | FileCheck --check-prefix=MIXED %s Index: lld/test/MachO/weak-definition-in-main-file.s =================================================================== --- lld/test/MachO/weak-definition-in-main-file.s +++ lld/test/MachO/weak-definition-in-main-file.s @@ -11,7 +11,7 @@ # PREFER-DIRECT-OBJECT-NOT: O __TEXT,weak __foo -# RUN: %lld -lSystem -o %t/out %t/weakfoo.a %t/test.o +# RUN: %lld-mac -lSystem -o %t/out %t/weakfoo.a %t/test.o # RUN: llvm-objdump --syms %t/out | FileCheck %s --check-prefix=PREFER-DIRECT-OBJECT #--- weakfoo.s Index: lld/test/MachO/weak-definition-indirect-fetch.s =================================================================== --- lld/test/MachO/weak-definition-indirect-fetch.s +++ lld/test/MachO/weak-definition-indirect-fetch.s @@ -18,19 +18,19 @@ # PREFER-NONWEAK-OBJECT: O __TEXT,nonweak _foo -# RUN: %lld -lSystem -o %t/weak-nonweak-archives %t/weakfoo.a %t/foo.a %t/test.o +# RUN: %lld-mac -lSystem -o %t/weak-nonweak-archives %t/weakfoo.a %t/foo.a %t/test.o # RUN: llvm-objdump --syms %t/weak-nonweak-archives | FileCheck %s --check-prefix=PREFER-NONWEAK-OBJECT -# RUN: %lld -lSystem -o %t/nonweak-weak-archives %t/foo.a %t/weakfoo.a %t/test.o +# RUN: %lld-mac -lSystem -o %t/nonweak-weak-archives %t/foo.a %t/weakfoo.a %t/test.o # RUN: llvm-objdump --syms %t/nonweak-weak-archives | FileCheck %s --check-prefix=PREFER-NONWEAK-OBJECT -# RUN: %lld -lSystem -o %t/weak-nonweak-objs %t/weakfoo.o %t/foo.o %t/test.o +# RUN: %lld-mac -lSystem -o %t/weak-nonweak-objs %t/weakfoo.o %t/foo.o %t/test.o # RUN: llvm-objdump --syms %t/weak-nonweak-objs | FileCheck %s --check-prefix=PREFER-NONWEAK-OBJECT -# RUN: %lld -lSystem -o %t/nonweak-weak-objs %t/foo.o %t/weakfoo.o %t/test.o +# RUN: %lld-mac -lSystem -o %t/nonweak-weak-objs %t/foo.o %t/weakfoo.o %t/test.o # RUN: llvm-objdump --syms %t/nonweak-weak-objs | FileCheck %s --check-prefix=PREFER-NONWEAK-OBJECT -# RUN: %lld -lSystem -o %t/weak-obj-nonweak-ar %t/weakfoo.o %t/foo.a %t/test.o +# RUN: %lld-mac -lSystem -o %t/weak-obj-nonweak-ar %t/weakfoo.o %t/foo.a %t/test.o # RUN: llvm-objdump --syms %t/weak-obj-nonweak-ar | FileCheck %s --check-prefix=PREFER-NONWEAK-OBJECT -# RUN: %lld -lSystem -o %t/nonweak-ar-weak-obj %t/foo.a %t/weakfoo.o %t/test.o +# RUN: %lld-mac -lSystem -o %t/nonweak-ar-weak-obj %t/foo.a %t/weakfoo.o %t/test.o # RUN: llvm-objdump --syms %t/nonweak-ar-weak-obj | FileCheck %s --check-prefix=PREFER-NONWEAK-OBJECT #--- foo.s Index: lld/test/MachO/weak-definition-order.s =================================================================== --- lld/test/MachO/weak-definition-order.s +++ lld/test/MachO/weak-definition-order.s @@ -9,22 +9,22 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weak1.s -o %t/weak1.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weak2.s -o %t/weak2.o -# RUN: %lld -lSystem -o %t/obj12 %t/weak1.o %t/weak2.o %t/test.o +# RUN: %lld-mac -lSystem -o %t/obj12 %t/weak1.o %t/weak2.o %t/test.o # RUN: llvm-objdump --syms %t/obj12 | FileCheck %s --check-prefix=WEAK1 -# RUN: %lld -lSystem -o %t/obj21 %t/weak2.o %t/weak1.o %t/test.o +# RUN: %lld-mac -lSystem -o %t/obj21 %t/weak2.o %t/weak1.o %t/test.o # RUN: llvm-objdump --syms %t/obj21 | FileCheck %s --check-prefix=WEAK2 # WEAK1: O __TEXT,weak1 _foo # WEAK2: O __TEXT,weak2 _foo -# RUN: %lld -dylib -install_name \ +# RUN: %lld-mac -dylib -install_name \ # RUN: @executable_path/libweak1.dylib %t/weak1.o -o %t/libweak1.dylib -# RUN: %lld -dylib -install_name \ +# RUN: %lld-mac -dylib -install_name \ # RUN: @executable_path/libweak2.dylib %t/weak2.o -o %t/libweak2.dylib -# RUN: %lld -lSystem -o %t/dylib12 -L%t -lweak1 -lweak2 %t/test.o +# RUN: %lld-mac -lSystem -o %t/dylib12 -L%t -lweak1 -lweak2 %t/test.o # RUN: llvm-objdump --macho --bind %t/dylib12 | FileCheck %s --check-prefix=DYLIB1 -# RUN: %lld -lSystem -o %t/dylib21 -L%t -lweak2 -lweak1 %t/test.o +# RUN: %lld-mac -lSystem -o %t/dylib21 -L%t -lweak2 -lweak1 %t/test.o # RUN: llvm-objdump --macho --bind %t/dylib21 | FileCheck %s --check-prefix=DYLIB2 # DYLIB1: __DATA __la_symbol_ptr 0x{{[0-9a-f]*}} pointer 0 libweak1 _foo # DYLIB2: __DATA __la_symbol_ptr 0x{{[0-9a-f]*}} pointer 0 libweak2 _foo Index: lld/test/MachO/weak-definition-over-dysym.s =================================================================== --- lld/test/MachO/weak-definition-over-dysym.s +++ lld/test/MachO/weak-definition-over-dysym.s @@ -7,7 +7,7 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/libfoo.s -o %t/libfoo.o -# RUN: %lld -dylib -install_name @executable_path/libfoo.dylib %t/libfoo.o -o %t/libfoo.dylib +# RUN: %lld-mac -dylib -install_name @executable_path/libfoo.dylib %t/libfoo.o -o %t/libfoo.dylib # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o @@ -19,14 +19,14 @@ # PREFER-WEAK-OBJECT: O __TEXT,weak _foo # PREFER-NONWEAK-OBJECT: O __TEXT,nonweak _foo -# RUN: %lld -lSystem -o %t/nonweak-dylib-weak-ar -L%t -lfoo %t/weakfoo.a %t/test.o +# RUN: %lld-mac -lSystem -o %t/nonweak-dylib-weak-ar -L%t -lfoo %t/weakfoo.a %t/test.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/nonweak-dylib-weak-ar | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -lSystem -o %t/weak-ar-nonweak-dylib -L%t %t/weakfoo.a -lfoo %t/test.o +# RUN: %lld-mac -lSystem -o %t/weak-ar-nonweak-dylib -L%t %t/weakfoo.a -lfoo %t/test.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-ar-nonweak-dylib | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -lSystem -o %t/weak-obj-nonweak-dylib -L%t %t/weakfoo.o -lfoo %t/test.o +# RUN: %lld-mac -lSystem -o %t/weak-obj-nonweak-dylib -L%t %t/weakfoo.o -lfoo %t/test.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/weak-obj-nonweak-dylib | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT -# RUN: %lld -lSystem -o %t/nonweak-dylib-weak-obj -L%t -lfoo %t/weakfoo.o %t/test.o +# RUN: %lld-mac -lSystem -o %t/nonweak-dylib-weak-obj -L%t -lfoo %t/weakfoo.o %t/test.o # RUN: llvm-objdump --macho --lazy-bind --syms %t/nonweak-dylib-weak-obj | FileCheck %s --check-prefix=PREFER-WEAK-OBJECT #--- libfoo.s Index: lld/test/MachO/weak-header-flags.s =================================================================== --- lld/test/MachO/weak-header-flags.s +++ lld/test/MachO/weak-header-flags.s @@ -2,15 +2,15 @@ # RUN: rm -rf %t; split-file %s %t # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/libweak-defines.s -o %t/libweak-defines.o -# RUN: %lld -dylib %t/libweak-defines.o -o %t/libweak-defines.dylib +# RUN: %lld-mac -dylib %t/libweak-defines.o -o %t/libweak-defines.dylib # RUN: llvm-readobj --file-headers %t/libweak-defines.dylib | FileCheck %s --check-prefix=WEAK-DEFINES-AND-BINDS # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/binds-to-weak.s -o %t/binds-to-weak.o -# RUN: %lld -lSystem -L%t -lweak-defines -o %t/binds-to-weak %t/binds-to-weak.o +# RUN: %lld-mac -lSystem -L%t -lweak-defines -o %t/binds-to-weak %t/binds-to-weak.o # RUN: llvm-readobj --file-headers %t/binds-to-weak | FileCheck %s --check-prefix=WEAK-BINDS-ONLY # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/overrides-weak.s -o %t/overrides-weak.o -# RUN: %lld -lSystem -L%t -lweak-defines -o %t/overrides-weak %t/overrides-weak.o +# RUN: %lld-mac -lSystem -L%t -lweak-defines -o %t/overrides-weak %t/overrides-weak.o # RUN: llvm-readobj --file-headers %t/overrides-weak | FileCheck %s --check-prefix=WEAK-DEFINES-ONLY # WEAK-DEFINES-AND-BINDS: MH_BINDS_TO_WEAK Index: lld/test/MachO/weak-import.s =================================================================== --- lld/test/MachO/weak-import.s +++ lld/test/MachO/weak-import.s @@ -8,30 +8,30 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/bar.s -o %t/bar.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/weak-reexport.s -o %t/weak-reexport.o -# RUN: %lld -lSystem -dylib %t/bar.o -o %t/libbar.dylib -# RUN: %lld -lSystem -dylib %t/foo.o %t/libbar.dylib -sub_library libbar -o %t/libfoo.dylib +# RUN: %lld-mac -lSystem -dylib %t/bar.o -o %t/libbar.dylib +# RUN: %lld-mac -lSystem -dylib %t/foo.o %t/libbar.dylib -sub_library libbar -o %t/libfoo.dylib -# RUN: %lld -weak-lSystem %t/test.o -weak_framework CoreFoundation -weak_library %t/libfoo.dylib -o %t/basic +# RUN: %lld-mac -weak-lSystem %t/test.o -weak_framework CoreFoundation -weak_library %t/libfoo.dylib -o %t/basic # RUN: llvm-objdump --macho --all-headers %t/basic | FileCheck %s -DDIR=%t --check-prefixes=WEAK-SYS,WEAK-FOO -# RUN: %lld -weak-lSystem %t/test.o \ +# RUN: %lld-mac -weak-lSystem %t/test.o \ # RUN: -framework CoreFoundation -weak_framework CoreFoundation -framework CoreFoundation \ # RUN: %t/libfoo.dylib -weak_library %t/libfoo.dylib %t/libfoo.dylib -o %t/basic-weak-strong # RUN: llvm-objdump --macho --all-headers %t/basic-weak-strong | FileCheck %s -DDIR=%t --check-prefixes=WEAK-SYS,WEAK-FOO -# RUN: %lld -lSystem -dylib %t/libfoo.dylib %t/weak-ref-only.o -o %t/weak-ref-only +# RUN: %lld-mac -lSystem -dylib %t/libfoo.dylib %t/weak-ref-only.o -o %t/weak-ref-only # RUN: llvm-objdump --macho --all-headers %t/weak-ref-only | FileCheck %s -DDIR=%t --check-prefixes=SYS,WEAK-FOO -# RUN: %lld -lSystem -dylib %t/libfoo.dylib %t/weak-ref-sub-library.o -o %t/weak-ref-sub-library +# RUN: %lld-mac -lSystem -dylib %t/libfoo.dylib %t/weak-ref-sub-library.o -o %t/weak-ref-sub-library # RUN: llvm-objdump --macho --all-headers %t/weak-ref-sub-library | FileCheck %s -DDIR=%t --check-prefixes=SYS,WEAK-FOO -# RUN: %lld -lSystem -dylib %t/libfoo.dylib %t/mixed-ref.o -o %t/mixed-ref +# RUN: %lld-mac -lSystem -dylib %t/libfoo.dylib %t/mixed-ref.o -o %t/mixed-ref # RUN: llvm-objdump --macho --all-headers %t/mixed-ref | FileCheck %s -DDIR=%t --check-prefixes=SYS,FOO -# RUN: %lld -framework CoreFoundation %t/test.o -weak_framework CoreFoundation -o %t/strong-weak-import.out +# RUN: %lld-mac -framework CoreFoundation %t/test.o -weak_framework CoreFoundation -o %t/strong-weak-import.out # RUN: llvm-objdump --macho --bind %t/strong-weak-import.out | FileCheck %s --check-prefix=WEAK-IMP # RUN: llvm-objdump --macho --bind %t/basic-weak-strong | FileCheck %s --check-prefix=WEAK-IMP ## This references the gxx_personality_v0 symbol, which is defined in libc++abi, which is then ## reexported by libc++. ## Check that reexported symbols from weak libraries are also weakly-referenced. -# RUN: %lld -weak-lc++ %t/weak-reexport.o -o %t/weak-reexport.out +# RUN: %lld-mac -weak-lc++ %t/weak-reexport.o -o %t/weak-reexport.out # RUN: llvm-objdump --macho --bind %t/weak-reexport.out | FileCheck %s --check-prefix=WEAK-REEXPORT # WEAK-SYS: cmd LC_LOAD_WEAK_DYLIB Index: lld/test/MachO/weak-private-extern.s =================================================================== --- lld/test/MachO/weak-private-extern.s +++ lld/test/MachO/weak-private-extern.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %s -o %t.o -# RUN: %lld -dylib %t.o -o %t.dylib -lSystem +# RUN: %lld-mac -dylib %t.o -o %t.dylib -lSystem # RUN: llvm-objdump --macho --bind --weak-bind %t.dylib | FileCheck %s # CHECK-NOT: __got Index: lld/test/MachO/weak-reference.s =================================================================== --- lld/test/MachO/weak-reference.s +++ lld/test/MachO/weak-reference.s @@ -4,15 +4,15 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/strongref.s -o %t/strongref.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/invalid.s -o %t/invalid.o -# RUN: %lld -lSystem -dylib %t/libfoo.o -o %t/libfoo.dylib +# RUN: %lld-mac -lSystem -dylib %t/libfoo.o -o %t/libfoo.dylib -# RUN: %lld -lSystem %t/test.o %t/libfoo.dylib -o %t/test +# RUN: %lld-mac -lSystem %t/test.o %t/libfoo.dylib -o %t/test # RUN: llvm-objdump --macho --syms --bind %t/test | FileCheck %s --check-prefixes=SYMS,BIND ## llvm-objdump doesn't print out all the flags info for lazy & weak bindings, ## so we use obj2yaml instead to test them. # RUN: obj2yaml %t/test | FileCheck %s --check-prefix=YAML -# RUN: %lld -lSystem %t/libfoo.dylib %t/test.o -o %t/test +# RUN: %lld-mac -lSystem %t/libfoo.dylib %t/test.o -o %t/test # RUN: llvm-objdump --macho --syms --bind %t/test | FileCheck %s --check-prefixes=SYMS,BIND # RUN: obj2yaml %t/test | FileCheck %s --check-prefix=YAML @@ -47,22 +47,22 @@ ## reference takes priority. NOTE: ld64 actually emits a strong reference if ## the reference is to a function symbol or a TLV. I'm not sure if there's a ## good reason for that, so I'm deviating here for a simpler implementation. -# RUN: %lld -lSystem %t/test.o %t/strongref.o %t/libfoo.dylib -o %t/with-strong +# RUN: %lld-mac -lSystem %t/test.o %t/strongref.o %t/libfoo.dylib -o %t/with-strong # RUN: llvm-objdump --macho --bind %t/with-strong | FileCheck %s --check-prefix=STRONG-BIND # RUN: obj2yaml %t/with-strong | FileCheck %s --check-prefix=STRONG-YAML -# RUN: %lld -lSystem %t/strongref.o %t/test.o %t/libfoo.dylib -o %t/with-strong +# RUN: %lld-mac -lSystem %t/strongref.o %t/test.o %t/libfoo.dylib -o %t/with-strong # RUN: llvm-objdump --macho --bind %t/with-strong | FileCheck %s --check-prefix=STRONG-BIND # RUN: obj2yaml %t/with-strong | FileCheck %s --check-prefix=STRONG-YAML -# RUN: %lld -lSystem %t/libfoo.dylib %t/strongref.o %t/test.o -o %t/with-strong +# RUN: %lld-mac -lSystem %t/libfoo.dylib %t/strongref.o %t/test.o -o %t/with-strong # RUN: llvm-objdump --macho --bind %t/with-strong | FileCheck %s --check-prefix=STRONG-BIND # RUN: obj2yaml %t/with-strong | FileCheck %s --check-prefix=STRONG-YAML -# RUN: %lld -lSystem %t/libfoo.dylib %t/test.o %t/strongref.o -o %t/with-strong +# RUN: %lld-mac -lSystem %t/libfoo.dylib %t/test.o %t/strongref.o -o %t/with-strong # RUN: llvm-objdump --macho --bind %t/with-strong | FileCheck %s --check-prefix=STRONG-BIND # RUN: obj2yaml %t/with-strong | FileCheck %s --check-prefix=STRONG-YAML -# RUN: %lld -lSystem %t/test.o %t/libfoo.dylib %t/strongref.o -o %t/with-strong +# RUN: %lld-mac -lSystem %t/test.o %t/libfoo.dylib %t/strongref.o -o %t/with-strong # RUN: llvm-objdump --macho --bind %t/with-strong | FileCheck %s --check-prefix=STRONG-BIND # RUN: obj2yaml %t/with-strong | FileCheck %s --check-prefix=STRONG-YAML -# RUN: %lld -lSystem %t/strongref.o %t/libfoo.dylib %t/test.o -o %t/with-strong +# RUN: %lld-mac -lSystem %t/strongref.o %t/libfoo.dylib %t/test.o -o %t/with-strong # RUN: llvm-objdump --macho --bind %t/with-strong | FileCheck %s --check-prefix=STRONG-BIND # RUN: obj2yaml %t/with-strong | FileCheck %s --check-prefix=STRONG-YAML @@ -89,7 +89,7 @@ # STRONG-YAML-NEXT: Symbol: _foo_fn ## Weak references must still be satisfied at link time. -# RUN: not %lld -lSystem %t/invalid.o -o /dev/null 2>&1 | FileCheck %s \ +# RUN: not %lld-mac -lSystem %t/invalid.o -o /dev/null 2>&1 | FileCheck %s \ # RUN: --check-prefix=INVALID -DDIR=%t # INVALID: error: undefined symbol: _missing Index: lld/test/MachO/why-live.s =================================================================== --- lld/test/MachO/why-live.s +++ lld/test/MachO/why-live.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %s -o %t.o -# RUN: %lld -lSystem -dead_strip -why_live _foo -why_live _undef -U _undef \ +# RUN: %lld-mac -lSystem -dead_strip -why_live _foo -why_live _undef -U _undef \ # RUN: -why_live _support -why_live _support_refs_dylib_fun \ # RUN: -why_live _abs %t.o -o /dev/null 2>&1 | FileCheck %s Index: lld/test/MachO/why-load.s =================================================================== --- lld/test/MachO/why-load.s +++ lld/test/MachO/why-load.s @@ -9,22 +9,22 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s # The first line checks that we never demangle symbols in -why_load output. -# RUN: %lld %t/main.o %t/lib.a -o /dev/null -why_load -demangle | \ +# RUN: %lld-mac %t/main.o %t/lib.a -o /dev/null -why_load -demangle | \ # RUN: FileCheck %s --check-prefix=WHY -# RUN: %lld %t/main.o -force_load %t/lib.a -o /dev/null -whyload | \ +# RUN: %lld-mac %t/main.o -force_load %t/lib.a -o /dev/null -whyload | \ # RUN: FileCheck %s --check-prefix=WHYFORCE -# RUN: %lld %t/main.o %t/lib.a -o /dev/null -all_load -why_load | \ +# RUN: %lld-mac %t/main.o %t/lib.a -o /dev/null -all_load -why_load | \ # RUN: FileCheck %s --check-prefix=WHYALL -# RUN: %lld %t/main.o -force_load %t/lib.a -o /dev/null -all_load -why_load | \ +# RUN: %lld-mac %t/main.o -force_load %t/lib.a -o /dev/null -all_load -why_load | \ # RUN: FileCheck %s --check-prefix=WHYALLFORCE -# RUN: %lld %t/main.o %t/lib.a -o /dev/null -ObjC -why_load | \ +# RUN: %lld-mac %t/main.o %t/lib.a -o /dev/null -ObjC -why_load | \ # RUN: FileCheck %s --check-prefix=WHYOBJC -# RUN: %lld %t/main.o -force_load %t/lib.a -o /dev/null -ObjC -why_load | \ +# RUN: %lld-mac %t/main.o -force_load %t/lib.a -o /dev/null -ObjC -why_load | \ # RUN: FileCheck %s --check-prefix=WHYOBJCFORCE -# RUN: %lld %t/main.o %t/lib.a -o /dev/null -ObjC -all_load -why_load | \ +# RUN: %lld-mac %t/main.o %t/lib.a -o /dev/null -ObjC -all_load -why_load | \ # RUN: FileCheck %s --check-prefix=WHYOBJCALL -# RUN: %lld %t/main.o -force_load %t/lib.a -o /dev/null -ObjC -all_load -why_load | \ +# RUN: %lld-mac %t/main.o -force_load %t/lib.a -o /dev/null -ObjC -all_load -why_load | \ # RUN: FileCheck %s --check-prefix=WHYOBJCALLFORCE # WHY-DAG: _bar forced load of {{.+}}lib.a(bar.o) Index: lld/test/MachO/x86-64-reloc-got-load.s =================================================================== --- lld/test/MachO/x86-64-reloc-got-load.s +++ lld/test/MachO/x86-64-reloc-got-load.s @@ -4,7 +4,7 @@ ## Note: GOT_LOAD relocations to dylib symbols are already tested in dylink.s. # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld -o %t %t.o +# RUN: %lld-mac -o %t %t.o # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s # CHECK: leaq [[#]](%rip), %rax ## {{.*}} <_foo> Index: lld/test/MachO/x86-64-reloc-signed.s =================================================================== --- lld/test/MachO/x86-64-reloc-signed.s +++ lld/test/MachO/x86-64-reloc-signed.s @@ -1,7 +1,7 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o # RUN: echo _t > %t.order -# RUN: %lld -o %t -order_file %t.order %t.o +# RUN: %lld-mac -o %t -order_file %t.order %t.o # RUN: llvm-objdump --section-headers --syms -D %t | FileCheck %s # CHECK-LABEL: Sections: Index: lld/test/MachO/x86-64-reloc-unsigned.s =================================================================== --- lld/test/MachO/x86-64-reloc-unsigned.s +++ lld/test/MachO/x86-64-reloc-unsigned.s @@ -1,13 +1,13 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld -o %t %t.o +# RUN: %lld-mac -o %t %t.o # RUN: llvm-objdump --macho --rebase --full-contents %t | FileCheck %s -# RUN: %lld -pie -o %t-pie %t.o +# RUN: %lld-mac -pie -o %t-pie %t.o # RUN: llvm-objdump --macho --rebase %t-pie | FileCheck %s --check-prefix=PIE -# RUN: %lld -pie -no_pie -o %t-no-pie %t.o +# RUN: %lld-mac -pie -no_pie -o %t-no-pie %t.o # RUN: llvm-objdump --macho --rebase %t-no-pie | FileCheck %s --check-prefix=NO-PIE -# RUN: %lld -no_pie -pie -o %t-pie %t.o +# RUN: %lld-mac -no_pie -pie -o %t-pie %t.o # RUN: llvm-objdump --macho --rebase %t-pie | FileCheck %s --check-prefix=PIE # CHECK: Contents of section __DATA,foo: Index: lld/test/MachO/x86-64-relocs.s =================================================================== --- lld/test/MachO/x86-64-relocs.s +++ lld/test/MachO/x86-64-relocs.s @@ -1,6 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld -lSystem -o %t %t.o +# RUN: %lld-mac -lSystem -o %t %t.o # RUN: llvm-objdump --section-headers --syms -d %t | FileCheck %s # CHECK-LABEL: Sections: Index: lld/test/MachO/x86-64-stubs.s =================================================================== --- lld/test/MachO/x86-64-stubs.s +++ lld/test/MachO/x86-64-stubs.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 -dylib \ +# RUN: %lld-mac -dylib \ # RUN: -install_name @executable_path/libhello.dylib %t/libhello.o \ # RUN: -o %t/libhello.dylib -# RUN: %lld -dylib \ +# RUN: %lld-mac -dylib \ # 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 -no_pie -data_const -o %t/dylink-lazy-no-pie \ +# RUN: %lld-mac -no_pie -data_const -o %t/dylink-lazy-no-pie \ # RUN: -L%t -lhello -lgoodbye %t/dylink-lazy.o -lSystem ## When looking at the __stubs section alone, we are unable to easily tell which @@ -23,7 +23,7 @@ # RUN: llvm-objdump -D --no-show-raw-insn %t/dylink-lazy-no-pie >> %t/objdump-no-pie # RUN: FileCheck %s --check-prefixes=CHECK,NO-PIE < %t/objdump-no-pie -# RUN: %lld -o %t/dylink-lazy -L%t -lhello -lgoodbye %t/dylink-lazy.o -lSystem +# RUN: %lld-mac -o %t/dylink-lazy -L%t -lhello -lgoodbye %t/dylink-lazy.o -lSystem # RUN: llvm-objdump -d --no-show-raw-insn --syms --rebase --bind --lazy-bind %t/dylink-lazy > %t/objdump # RUN: llvm-objdump -D --no-show-raw-insn %t/dylink-lazy >> %t/objdump # RUN: FileCheck %s --check-prefixes=CHECK,PIE < %t/objdump Index: lld/test/MachO/zippered.yaml =================================================================== --- lld/test/MachO/zippered.yaml +++ lld/test/MachO/zippered.yaml @@ -5,7 +5,7 @@ # RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-ios13.15.0-macabi -o %t/test_maccatalyst.o # RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-ios13.15.0 -o %t/test_ios.o -# RUN: %lld -lSystem -dylib %t/test.dylib %t/test_macos.o -o /dev/null +# RUN: %lld-mac -lSystem -dylib %t/test.dylib %t/test_macos.o -o /dev/null # RUN: %lld -lSystem -dylib -platform_version mac-catalyst 13.15.0 14.0 %t/test.dylib %t/test_maccatalyst.o -o /dev/null # RUN: not %lld -lSystem -dylib -platform_version ios 13.15.0 14.0 %t/test.dylib %t/test_ios.o -o /dev/null 2>&1 | FileCheck %s