diff --git a/lld/test/MachO/lc-build-version.s b/lld/test/MachO/lc-build-version.s index 3fc9ba24b31110..07eeae5a5edeea 100644 --- a/lld/test/MachO/lc-build-version.s +++ b/lld/test/MachO/lc-build-version.s @@ -2,67 +2,67 @@ # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o -# RUN: %lld -platform_version macos 10.14 10.15 -o %t.macos_10_14 %t.o -# RUN: llvm-objdump --macho --all-headers %t.macos_10_14 | FileCheck %s --check-prefix=MACOS_10_14 +# RUN: %lld -platform_version macos 10.14 10.15 -o %t.macos-10-14 %t.o +# RUN: llvm-objdump --macho --all-headers %t.macos-10-14 | FileCheck %s --check-prefix=MACOS-10-14 -# MACOS_10_14: cmd LC_BUILD_VERSION -# MACOS_10_14-NEXT: cmdsize 32 -# MACOS_10_14-NEXT: platform macos -# MACOS_10_14-NEXT: sdk 10.15 -# MACOS_10_14-NEXT: minos 10.14 -# MACOS_10_14-NEXT: ntools 1 -# MACOS_10_14-NEXT: tool ld -# MACOS_10_14-NEXT: version {{[0-9\.]+}} +# MACOS-10-14: cmd LC_BUILD_VERSION +# MACOS-10-14-NEXT: cmdsize 32 +# MACOS-10-14-NEXT: platform macos +# MACOS-10-14-NEXT: sdk 10.15 +# MACOS-10-14-NEXT: minos 10.14 +# MACOS-10-14-NEXT: ntools 1 +# MACOS-10-14-NEXT: tool ld +# MACOS-10-14-NEXT: version {{[0-9\.]+}} -# RUN: %lld -platform_version macos 10.13 10.15 -o %t.macos_10_13 %t.o -# RUN: llvm-objdump --macho --all-headers %t.macos_10_13 | FileCheck %s --check-prefix=MACOS_10_13 +# RUN: %lld -platform_version macos 10.13 10.15 -o %t.macos-10-13 %t.o +# RUN: llvm-objdump --macho --all-headers %t.macos-10-13 | FileCheck %s --check-prefix=MACOS-10-13 -# MACOS_10_13: cmd LC_VERSION_MIN_MACOSX -# MACOS_10_13-NEXT: cmdsize 16 -# MACOS_10_13-NEXT: version 10.13 -# MACOS_10_13-NEXT: sdk 10.15 +# MACOS-10-13: cmd LC_VERSION_MIN_MACOSX +# MACOS-10-13-NEXT: cmdsize 16 +# MACOS-10-13-NEXT: version 10.13 +# MACOS-10-13-NEXT: sdk 10.15 -# RUN: %no-arg-lld -arch x86_64 -platform_version ios 12.0 10.15 -o %t.ios_12_0 %t.o -# RUN: llvm-objdump --macho --all-headers %t.ios_12_0 | FileCheck %s --check-prefix=IOS_12_0 -# RUN: %no-arg-lld -arch x86_64 -platform_version ios-simulator 13.0 10.15 -o %t.ios_sim_13_0 %t.o -# RUN: llvm-objdump --macho --all-headers %t.ios_sim_13_0 | FileCheck %s --check-prefix=IOS_12_0 +# RUN: %no-arg-lld -arch x86_64 -platform_version ios 12.0 10.15 -o %t.ios-12-0 %t.o +# RUN: llvm-objdump --macho --all-headers %t.ios-12-0 | FileCheck %s --check-prefix=IOS-12-0 +# RUN: %no-arg-lld -arch x86_64 -platform_version ios-simulator 13.0 10.15 -o %t.ios-sim-13-0 %t.o +# RUN: llvm-objdump --macho --all-headers %t.ios-sim-13-0 | FileCheck %s --check-prefix=IOS-12-0 -# IOS_12_0: cmd LC_BUILD_VERSION +# IOS-12-0: cmd LC_BUILD_VERSION -# RUN: %no-arg-lld -arch x86_64 -platform_version ios 11.0 10.15 -o %t.ios_11_0 %t.o -# RUN: llvm-objdump --macho --all-headers %t.ios_11_0 | FileCheck %s --check-prefix=IOS_11_0 -# RUN: %no-arg-lld -arch x86_64 -platform_version ios-simulator 12.0 10.15 -o %t.ios_sim_12_0 %t.o -# RUN: llvm-objdump --macho --all-headers %t.ios_sim_12_0 | FileCheck %s --check-prefix=IOS_11_0 +# RUN: %no-arg-lld -arch x86_64 -platform_version ios 11.0 10.15 -o %t.ios-11-0 %t.o +# RUN: llvm-objdump --macho --all-headers %t.ios-11-0 | FileCheck %s --check-prefix=IOS-11-0 +# RUN: %no-arg-lld -arch x86_64 -platform_version ios-simulator 12.0 10.15 -o %t.ios-sim-12-0 %t.o +# RUN: llvm-objdump --macho --all-headers %t.ios-sim-12-0 | FileCheck %s --check-prefix=IOS-11-0 -# IOS_11_0: cmd LC_VERSION_MIN_IPHONEOS +# IOS-11-0: cmd LC_VERSION_MIN_IPHONEOS -# RUN: %no-arg-lld -arch x86_64 -platform_version tvos 12.0 10.15 -o %t.tvos_12_0 %t.o -# RUN: llvm-objdump --macho --all-headers %t.tvos_12_0 | FileCheck %s --check-prefix=TVOS_12_0 -# RUN: %no-arg-lld -arch x86_64 -platform_version tvos-simulator 13.0 10.15 -o %t.tvos_sim_13_0 %t.o -# RUN: llvm-objdump --macho --all-headers %t.tvos_sim_13_0 | FileCheck %s --check-prefix=TVOS_12_0 +# RUN: %no-arg-lld -arch x86_64 -platform_version tvos 12.0 10.15 -o %t.tvos-12-0 %t.o +# RUN: llvm-objdump --macho --all-headers %t.tvos-12-0 | FileCheck %s --check-prefix=TVOS-12-0 +# RUN: %no-arg-lld -arch x86_64 -platform_version tvos-simulator 13.0 10.15 -o %t.tvos-sim-13-0 %t.o +# RUN: llvm-objdump --macho --all-headers %t.tvos-sim-13-0 | FileCheck %s --check-prefix=TVOS-12-0 -# TVOS_12_0: cmd LC_BUILD_VERSION +# TVOS-12-0: cmd LC_BUILD_VERSION -# RUN: %no-arg-lld -arch x86_64 -platform_version tvos 11.0 10.15 -o %t.tvos_11_0 %t.o -# RUN: llvm-objdump --macho --all-headers %t.tvos_11_0 | FileCheck %s --check-prefix=TVOS_11_0 -# RUN: %no-arg-lld -arch x86_64 -platform_version tvos-simulator 12.0 10.15 -o %t.tvos_sim_12_0 %t.o -# RUN: llvm-objdump --macho --all-headers %t.tvos_sim_12_0 | FileCheck %s --check-prefix=TVOS_11_0 +# RUN: %no-arg-lld -arch x86_64 -platform_version tvos 11.0 10.15 -o %t.tvos-11-0 %t.o +# RUN: llvm-objdump --macho --all-headers %t.tvos-11-0 | FileCheck %s --check-prefix=TVOS-11-0 +# RUN: %no-arg-lld -arch x86_64 -platform_version tvos-simulator 12.0 10.15 -o %t.tvos-sim-12-0 %t.o +# RUN: llvm-objdump --macho --all-headers %t.tvos-sim-12-0 | FileCheck %s --check-prefix=TVOS-11-0 -# TVOS_11_0: cmd LC_VERSION_MIN_TVOS +# TVOS-11-0: cmd LC_VERSION_MIN_TVOS -# RUN: %no-arg-lld -arch x86_64 -platform_version watchos 5.0 10.15 -o %t.watchos_5_0 %t.o -# RUN: llvm-objdump --macho --all-headers %t.watchos_5_0 | FileCheck %s --check-prefix=WATCHOS_5_0 -# RUN: %no-arg-lld -arch x86_64 -platform_version watchos-simulator 6.0 10.15 -o %t.watchos_sim_6_0 %t.o -# RUN: llvm-objdump --macho --all-headers %t.watchos_sim_6_0 | FileCheck %s --check-prefix=WATCHOS_5_0 +# RUN: %no-arg-lld -arch x86_64 -platform_version watchos 5.0 10.15 -o %t.watchos-5-0 %t.o +# RUN: llvm-objdump --macho --all-headers %t.watchos-5-0 | FileCheck %s --check-prefix=WATCHOS-5-0 +# RUN: %no-arg-lld -arch x86_64 -platform_version watchos-simulator 6.0 10.15 -o %t.watchos-sim-6-0 %t.o +# RUN: llvm-objdump --macho --all-headers %t.watchos-sim-6-0 | FileCheck %s --check-prefix=WATCHOS-5-0 -# WATCHOS_5_0: cmd LC_BUILD_VERSION +# WATCHOS-5-0: cmd LC_BUILD_VERSION -# RUN: %no-arg-lld -arch x86_64 -platform_version watchos 4.0 10.15 -o %t.watchos_4_0 %t.o -# RUN: llvm-objdump --macho --all-headers %t.watchos_4_0 | FileCheck %s --check-prefix=WATCHOS_4_0 -# RUN: %no-arg-lld -arch x86_64 -platform_version watchos-simulator 5.0 10.15 -o %t.watchos_sim_5_0 %t.o -# RUN: llvm-objdump --macho --all-headers %t.watchos_sim_5_0 | FileCheck %s --check-prefix=WATCHOS_4_0 +# RUN: %no-arg-lld -arch x86_64 -platform_version watchos 4.0 10.15 -o %t.watchos-4-0 %t.o +# RUN: llvm-objdump --macho --all-headers %t.watchos-4-0 | FileCheck %s --check-prefix=WATCHOS-4-0 +# RUN: %no-arg-lld -arch x86_64 -platform_version watchos-simulator 5.0 10.15 -o %t.watchos-sim-5-0 %t.o +# RUN: llvm-objdump --macho --all-headers %t.watchos-sim-5-0 | FileCheck %s --check-prefix=WATCHOS-4-0 -# WATCHOS_4_0: cmd LC_VERSION_MIN_WATCHOS +# WATCHOS-4-0: cmd LC_VERSION_MIN_WATCHOS .text .global _main diff --git a/lld/test/MachO/lc-linker-option.ll b/lld/test/MachO/lc-linker-option.ll index 1a4aff138e9e92..ab16e2121e82b9 100644 --- a/lld/test/MachO/lc-linker-option.ll +++ b/lld/test/MachO/lc-linker-option.ll @@ -12,10 +12,10 @@ ; FRAME-NEXT: cmdsize ; FRAME-NEXT: name /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation -; RUN: not %lld %t/framework.o -o %t/frame_no_autolink -ignore_auto_link 2>&1 | FileCheck --check-prefix=NO_AUTOLINK %s -; RUN: not %lld %t/framework.o -o %t/frame_no_autolink --ignore-auto-link-option CoreFoundation 2>&1 | FileCheck --check-prefix=NO_AUTOLINK %s -; RUN: not %lld %t/framework.o -o %t/frame_no_autolink --ignore-auto-link-option=CoreFoundation 2>&1 | FileCheck --check-prefix=NO_AUTOLINK %s -; NO_AUTOLINK: error: undefined symbol: __CFBigNumGetInt128 +; RUN: not %lld %t/framework.o -o %t/frame_no_autolink -ignore_auto_link 2>&1 | FileCheck --check-prefix=NO-AUTOLINK %s +; RUN: not %lld %t/framework.o -o %t/frame_no_autolink --ignore-auto-link-option CoreFoundation 2>&1 | FileCheck --check-prefix=NO-AUTOLINK %s +; RUN: not %lld %t/framework.o -o %t/frame_no_autolink --ignore-auto-link-option=CoreFoundation 2>&1 | FileCheck --check-prefix=NO-AUTOLINK %s +; NO-AUTOLINK: error: undefined symbol: __CFBigNumGetInt128 ; RUN: llvm-as %t/l.ll -o %t/l.o ;; The dynamic call to _CFBigNumGetInt128 uses dyld_stub_binder, @@ -87,39 +87,39 @@ ;; Make sure -all_load has effect when libraries are loaded via LC_LINKER_OPTION flags and explicitly passed as well ; RUN: %lld -all_load %t/load-framework-foo.o %t/load-library-foo.o %t/main.o -o %t/main -F%t -L%t -lfoo -; RUN: llvm-objdump --macho --syms %t/main | FileCheck %s --check-prefix=SYMS_ALL_LOAD +; RUN: llvm-objdump --macho --syms %t/main | FileCheck %s --check-prefix=SYMS-ALL-LOAD ;; Note that _OBJC_CLASS_$_TestClass is *included* here. -; SYMS_ALL_LOAD: SYMBOL TABLE: -; SYMS_ALL_LOAD-NEXT: g F __TEXT,__text _main -; SYMS_ALL_LOAD-NEXT: g O __DATA,__objc_data _OBJC_CLASS_$_TestClass -; SYMS_ALL_LOAD-NEXT: g F __TEXT,__text __mh_execute_header -; SYMS_ALL_LOAD-NEXT: *UND* dyld_stub_binder -; SYMS_ALL_LOAD-EMPTY: +; SYMS-ALL-LOAD: SYMBOL TABLE: +; SYMS-ALL-LOAD-NEXT: g F __TEXT,__text _main +; SYMS-ALL-LOAD-NEXT: g O __DATA,__objc_data _OBJC_CLASS_$_TestClass +; SYMS-ALL-LOAD-NEXT: g F __TEXT,__text __mh_execute_header +; SYMS-ALL-LOAD-NEXT: *UND* dyld_stub_binder +; SYMS-ALL-LOAD-EMPTY: ;; Make sure -force_load has effect when libraries are loaded via LC_LINKER_OPTION flags and explicitly passed as well ; RUN: %lld %t/load-library-foo.o %t/main.o -o %t/main -F%t -L%t -force_load %t/libfoo.a -; RUN: llvm-objdump --macho --syms %t/main | FileCheck %s --check-prefix=SYMS_FORCE_LOAD +; RUN: llvm-objdump --macho --syms %t/main | FileCheck %s --check-prefix=SYMS-FORCE-LOAD ;; Note that _OBJC_CLASS_$_TestClass is *included* here. -; SYMS_FORCE_LOAD: SYMBOL TABLE: -; SYMS_FORCE_LOAD-NEXT: g F __TEXT,__text _main -; SYMS_FORCE_LOAD-NEXT: g O __DATA,__objc_data _OBJC_CLASS_$_TestClass -; SYMS_FORCE_LOAD-NEXT: g F __TEXT,__text __mh_execute_header -; SYMS_FORCE_LOAD-NEXT: *UND* dyld_stub_binder -; SYMS_FORCE_LOAD-EMPTY: +; SYMS-FORCE-LOAD: SYMBOL TABLE: +; SYMS-FORCE-LOAD-NEXT: g F __TEXT,__text _main +; SYMS-FORCE-LOAD-NEXT: g O __DATA,__objc_data _OBJC_CLASS_$_TestClass +; SYMS-FORCE-LOAD-NEXT: g F __TEXT,__text __mh_execute_header +; SYMS-FORCE-LOAD-NEXT: *UND* dyld_stub_binder +; SYMS-FORCE-LOAD-EMPTY: ;; Make sure -ObjC has effect when frameworks are loaded via LC_LINKER_OPTION flags and explicitly passed as well ; RUN: %lld -ObjC %t/load-framework-foo.o %t/load-library-foo.o %t/main.o -o %t/main -F%t -L%t -framework Foo -; RUN: llvm-objdump --macho --syms %t/main | FileCheck %s --check-prefix=SYMS_OBJC_LOAD +; RUN: llvm-objdump --macho --syms %t/main | FileCheck %s --check-prefix=SYMS-OBJC-LOAD ;; Note that _OBJC_CLASS_$_TestClass is *included* here. -; SYMS_OBJC_LOAD: SYMBOL TABLE: -; SYMS_OBJC_LOAD-NEXT: g F __TEXT,__text _main -; SYMS_OBJC_LOAD-NEXT: g O __DATA,__objc_data _OBJC_CLASS_$_TestClass -; SYMS_OBJC_LOAD-NEXT: g F __TEXT,__text __mh_execute_header -; SYMS_OBJC_LOAD-NEXT: *UND* dyld_stub_binder -; SYMS_OBJC_LOAD-EMPTY: +; SYMS-OBJC-LOAD: SYMBOL TABLE: +; SYMS-OBJC-LOAD-NEXT: g F __TEXT,__text _main +; SYMS-OBJC-LOAD-NEXT: g O __DATA,__objc_data _OBJC_CLASS_$_TestClass +; SYMS-OBJC-LOAD-NEXT: g F __TEXT,__text __mh_execute_header +; SYMS-OBJC-LOAD-NEXT: *UND* dyld_stub_binder +; SYMS-OBJC-LOAD-EMPTY: ;; Make sure that frameworks containing object files or bitcode instead of ;; dylibs or archives do not cause duplicate symbol errors diff --git a/lld/test/MachO/local-symbol-output.s b/lld/test/MachO/local-symbol-output.s index ca99d73f8ede71..c27e665635c147 100644 --- a/lld/test/MachO/local-symbol-output.s +++ b/lld/test/MachO/local-symbol-output.s @@ -13,13 +13,13 @@ # CONFLICT: error: cannot use both -non_global_symbols_no_strip_list and -non_global_symbols_strip_list ## Check that -x causes none of the local symbols to be emitted. -# RUN: %lld %t/main.o -x -o %t/no_local.out -# RUN: llvm-nm %t/no_local.out | FileCheck --check-prefix NO_LOCAL %s +# RUN: %lld %t/main.o -x -o %t/NO-LOCAL.out +# RUN: llvm-nm %t/NO-LOCAL.out | FileCheck --check-prefix NO-LOCAL %s -# NO_LOCAL-NOT: t _foo -# NO_LOCAL-NOT: t _bar -# NO_LOCAL-NOT: t _baz -# NO_LOCAL: T _main +# NO-LOCAL-NOT: t _foo +# NO-LOCAL-NOT: t _bar +# NO-LOCAL-NOT: t _baz +# NO-LOCAL: T _main ## Check that when using -x with -non_global_symbols_no_strip_list, whichever appears ## last in the command line arg list will take precedence. @@ -27,7 +27,7 @@ # RUN: llvm-nm %t/x_then_no_strip.out | FileCheck --check-prefix X-NO-STRIP %s # RUN: %lld %t/main.o -non_global_symbols_no_strip_list %t/foo.txt -x -o %t/no_strip_then_x.out -# RUN: llvm-nm %t/no_strip_then_x.out | FileCheck --check-prefix NO_LOCAL %s +# RUN: llvm-nm %t/no_strip_then_x.out | FileCheck --check-prefix NO-LOCAL %s # X-NO-STRIP-NOT: t _bar # X-NO-STRIP-DAG: t _foo @@ -51,7 +51,7 @@ # RUN: llvm-nm %t/x_then_strip.out | FileCheck --check-prefix X-STRIP %s # RUN: %lld %t/main.o -non_global_symbols_strip_list %t/foo.txt -x -o %t/strip_then_x.out -# RUN: llvm-nm %t/no_strip_then_x.out | FileCheck --check-prefix NO_LOCAL %s +# RUN: llvm-nm %t/no_strip_then_x.out | FileCheck --check-prefix NO-LOCAL %s # X-STRIP-NOT: t _foo # X-STRIP-DAG: t _bar