2009-03-27 00:29:05 +08:00
|
|
|
// Check that ld gets arch_multiple.
|
|
|
|
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin9 -arch i386 -arch x86_64 %s -### -o foo 2> %t.log
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: grep '".*ld.*" .*"-arch_multiple" "-final_output" "foo"' %t.log
|
|
|
|
|
2009-04-04 08:55:30 +08:00
|
|
|
// Make sure we run dsymutil on source input files.
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin9 -### -g %s -o BAR 2> %t.log
|
2019-08-03 03:26:05 +08:00
|
|
|
// RUN: grep -E '".*dsymutil(\.exe)?" "-o" "BAR.dSYM" "BAR"' %t.log
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin9 -### -g -filelist FOO %s -o BAR 2> %t.log
|
2019-08-03 03:26:05 +08:00
|
|
|
// RUN: grep -E '".*dsymutil(\.exe)?" "-o" "BAR.dSYM" "BAR"' %t.log
|
2009-04-04 08:55:30 +08:00
|
|
|
|
2010-01-27 08:56:56 +08:00
|
|
|
// Check linker changes that came with new linkedit format.
|
|
|
|
// RUN: touch %t.o
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 %t.o 2> %t.log
|
|
|
|
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 -dynamiclib %t.o 2>> %t.log
|
|
|
|
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 -bundle %t.o 2>> %t.log
|
2010-01-27 08:56:56 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_IPHONE_3_0 %s < %t.log
|
2009-03-27 00:29:05 +08:00
|
|
|
|
2010-09-12 04:43:12 +08:00
|
|
|
// LINK_IPHONE_3_0: {{ld(.exe)?"}}
|
2014-10-11 03:38:34 +08:00
|
|
|
// LINK_IPHONE_3_0: -iphoneos_version_min
|
|
|
|
// LINK_IPHONE_3_0: 3.0.0
|
2010-01-27 08:56:56 +08:00
|
|
|
// LINK_IPHONE_3_0-NOT: -lcrt1.3.1.o
|
|
|
|
// LINK_IPHONE_3_0: -lcrt1.o
|
|
|
|
// LINK_IPHONE_3_0: -lSystem
|
2010-09-12 04:43:12 +08:00
|
|
|
// LINK_IPHONE_3_0: {{ld(.exe)?"}}
|
2010-01-27 08:56:56 +08:00
|
|
|
// LINK_IPHONE_3_0: -dylib
|
|
|
|
// LINK_IPHONE_3_0: -ldylib1.o
|
|
|
|
// LINK_IPHONE_3_0: -lSystem
|
2010-09-12 04:43:12 +08:00
|
|
|
// LINK_IPHONE_3_0: {{ld(.exe)?"}}
|
2010-01-27 08:56:56 +08:00
|
|
|
// LINK_IPHONE_3_0: -lbundle1.o
|
|
|
|
// LINK_IPHONE_3_0: -lSystem
|
2009-03-27 00:29:05 +08:00
|
|
|
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 %t.o 2> %t.log
|
|
|
|
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 -dynamiclib %t.o 2>> %t.log
|
|
|
|
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 -bundle %t.o 2>> %t.log
|
2010-01-27 08:56:56 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_IPHONE_3_1 %s < %t.log
|
|
|
|
|
2010-09-12 04:43:12 +08:00
|
|
|
// LINK_IPHONE_3_1: {{ld(.exe)?"}}
|
2014-10-11 03:38:34 +08:00
|
|
|
// LINK_IPHONE_3_1: -iphoneos_version_min
|
|
|
|
// LINK_IPHONE_3_1: 3.1.0
|
2010-01-27 08:56:56 +08:00
|
|
|
// LINK_IPHONE_3_1-NOT: -lcrt1.o
|
|
|
|
// LINK_IPHONE_3_1: -lcrt1.3.1.o
|
|
|
|
// LINK_IPHONE_3_1: -lSystem
|
2010-09-12 04:43:12 +08:00
|
|
|
// LINK_IPHONE_3_1: {{ld(.exe)?"}}
|
2010-01-27 08:56:56 +08:00
|
|
|
// LINK_IPHONE_3_1: -dylib
|
|
|
|
// LINK_IPHONE_3_1-NOT: -ldylib1.o
|
|
|
|
// LINK_IPHONE_3_1: -lSystem
|
2010-09-12 04:43:12 +08:00
|
|
|
// LINK_IPHONE_3_1: {{ld(.exe)?"}}
|
2010-01-27 08:56:56 +08:00
|
|
|
// LINK_IPHONE_3_1-NOT: -lbundle1.o
|
|
|
|
// LINK_IPHONE_3_1: -lSystem
|
2010-07-14 07:31:40 +08:00
|
|
|
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch i386 -mios-simulator-version-min=3.0 %t.o 2> %t.log
|
|
|
|
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch i386 -mios-simulator-version-min=3.0 -dynamiclib %t.o 2>> %t.log
|
|
|
|
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch i386 -mios-simulator-version-min=3.0 -bundle %t.o 2>> %t.log
|
2014-01-21 08:17:10 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_IOSSIM_3_0 %s < %t.log
|
|
|
|
|
|
|
|
// LINK_IOSSIM_3_0: {{ld(.exe)?"}}
|
2014-10-11 03:38:34 +08:00
|
|
|
// LINK_IOSSIM_3_0: -ios_simulator_version_min
|
|
|
|
// LINK_IOSSIM_3_0: 3.0.0
|
2014-01-21 08:17:10 +08:00
|
|
|
// LINK_IOSSIM_3_0-NOT: -lcrt1.o
|
|
|
|
// LINK_IOSSIM_3_0: -lSystem
|
|
|
|
// LINK_IOSSIM_3_0: {{ld(.exe)?"}}
|
|
|
|
// LINK_IOSSIM_3_0: -dylib
|
|
|
|
// LINK_IOSSIM_3_0-NOT: -ldylib1.o
|
|
|
|
// LINK_IOSSIM_3_0: -lSystem
|
|
|
|
// LINK_IOSSIM_3_0: {{ld(.exe)?"}}
|
|
|
|
// LINK_IOSSIM_3_0-NOT: -lbundle1.o
|
|
|
|
// LINK_IOSSIM_3_0: -lSystem
|
|
|
|
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin9 -### -fpie %t.o 2> %t.log
|
2010-07-14 07:31:40 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_EXPLICIT_PIE %s < %t.log
|
|
|
|
//
|
2010-09-12 04:43:12 +08:00
|
|
|
// LINK_EXPLICIT_PIE: {{ld(.exe)?"}}
|
2010-07-14 07:31:40 +08:00
|
|
|
// LINK_EXPLICIT_PIE: "-pie"
|
|
|
|
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin9 -### -fno-pie %t.o 2> %t.log
|
2010-07-14 07:31:40 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_EXPLICIT_NO_PIE %s < %t.log
|
|
|
|
//
|
2010-09-12 04:43:12 +08:00
|
|
|
// LINK_EXPLICIT_NO_PIE: {{ld(.exe)?"}}
|
2010-07-14 07:31:40 +08:00
|
|
|
// LINK_EXPLICIT_NO_PIE: "-no_pie"
|
2010-08-12 07:07:50 +08:00
|
|
|
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: -fuse-ld= -mlinker-version=100 2> %t.log
|
2010-08-12 07:07:50 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_NEWER_DEMANGLE %s < %t.log
|
|
|
|
//
|
2010-09-12 04:43:12 +08:00
|
|
|
// LINK_NEWER_DEMANGLE: {{ld(.exe)?"}}
|
2010-08-12 07:07:50 +08:00
|
|
|
// LINK_NEWER_DEMANGLE: "-demangle"
|
|
|
|
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: -fuse-ld= -mlinker-version=100 -Wl,--no-demangle 2> %t.log
|
2010-08-12 07:07:50 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_NEWER_NODEMANGLE %s < %t.log
|
|
|
|
//
|
2010-09-12 04:43:12 +08:00
|
|
|
// LINK_NEWER_NODEMANGLE: {{ld(.exe)?"}}
|
2010-08-12 07:07:50 +08:00
|
|
|
// LINK_NEWER_NODEMANGLE-NOT: "-demangle"
|
2010-08-24 04:58:55 +08:00
|
|
|
// LINK_NEWER_NODEMANGLE: "-lSystem"
|
2010-08-12 07:07:50 +08:00
|
|
|
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: -fuse-ld= -mlinker-version=95 2> %t.log
|
2010-08-12 07:07:50 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_OLDER_NODEMANGLE %s < %t.log
|
|
|
|
//
|
2010-09-12 04:43:12 +08:00
|
|
|
// LINK_OLDER_NODEMANGLE: {{ld(.exe)?"}}
|
2010-08-12 07:07:50 +08:00
|
|
|
// LINK_OLDER_NODEMANGLE-NOT: "-demangle"
|
2010-08-24 04:58:55 +08:00
|
|
|
// LINK_OLDER_NODEMANGLE: "-lSystem"
|
2011-06-22 04:55:11 +08:00
|
|
|
|
2012-10-03 02:07:59 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -### %s \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: -fuse-ld= -mlinker-version=117 -flto 2> %t.log
|
2011-06-22 04:55:11 +08:00
|
|
|
// RUN: cat %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_OBJECT_LTO_PATH %s < %t.log
|
|
|
|
//
|
|
|
|
// LINK_OBJECT_LTO_PATH: {{ld(.exe)?"}}
|
|
|
|
// LINK_OBJECT_LTO_PATH: "-object_path_lto"
|
2011-06-29 04:16:02 +08:00
|
|
|
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
|
2011-06-29 04:16:02 +08:00
|
|
|
// RUN: -force_load a -force_load b 2> %t.log
|
|
|
|
// RUN: cat %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=FORCE_LOAD %s < %t.log
|
|
|
|
//
|
|
|
|
// FORCE_LOAD: {{ld(.exe)?"}}
|
|
|
|
// FORCE_LOAD: "-force_load" "a" "-force_load" "b"
|
2012-01-05 09:56:11 +08:00
|
|
|
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
|
2012-01-05 09:56:11 +08:00
|
|
|
// RUN: -lazy_framework Framework 2> %t.log
|
|
|
|
//
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_LAZY_FRAMEWORK %s < %t.log
|
|
|
|
// LINK_LAZY_FRAMEWORK: {{ld(.exe)?"}}
|
|
|
|
// LINK_LAZY_FRAMEWORK: "-lazy_framework" "Framework"
|
|
|
|
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \
|
2012-01-05 09:56:11 +08:00
|
|
|
// RUN: -lazy_library Library 2> %t.log
|
|
|
|
//
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_LAZY_LIBRARY %s < %t.log
|
|
|
|
// LINK_LAZY_LIBRARY: {{ld(.exe)?"}}
|
|
|
|
// LINK_LAZY_LIBRARY: "-lazy_library" "Library"
|
2012-02-01 05:30:03 +08:00
|
|
|
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -fuse-ld= -mlinker-version=400 -### %t.o 2> %t.log
|
|
|
|
// RUN: %clang -target x86_64-apple-macosx10.7 -fuse-ld= -mlinker-version=400 -### %t.o 2>> %t.log
|
2012-02-01 05:30:03 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_VERSION_MIN %s < %t.log
|
|
|
|
// LINK_VERSION_MIN: {{ld(.exe)?"}}
|
|
|
|
// LINK_VERSION_MIN: "-macosx_version_min" "10.6.0"
|
|
|
|
// LINK_VERSION_MIN: {{ld(.exe)?"}}
|
|
|
|
// LINK_VERSION_MIN: "-macosx_version_min" "10.7.0"
|
2012-03-07 04:05:56 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_NO_CRT1 %s < %t.log
|
|
|
|
// LINK_NO_CRT1-NOT: crt
|
2012-07-04 04:42:10 +08:00
|
|
|
|
2012-10-16 06:23:53 +08:00
|
|
|
// RUN: %clang -target armv7-apple-ios6.0 -miphoneos-version-min=6.0 -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_NO_IOS_CRT1 %s < %t.log
|
|
|
|
// LINK_NO_IOS_CRT1-NOT: crt
|
|
|
|
|
2014-03-29 23:09:45 +08:00
|
|
|
// RUN: %clang -target arm64-apple-ios5.0 -miphoneos-version-min=5.0 -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_NO_IOS_ARM64_CRT1 %s < %t.log
|
|
|
|
// LINK_NO_IOS_ARM64_CRT1-NOT: crt
|
|
|
|
|
2018-08-16 06:50:06 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-ios6.0 -miphoneos-version-min=6.0 -fprofile-instr-generate -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
|
2016-03-16 02:08:20 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_IOSSIM_PROFILE %s < %t.log
|
|
|
|
// LINK_IOSSIM_PROFILE: {{ld(.exe)?"}}
|
|
|
|
// LINK_IOSSIM_PROFILE: libclang_rt.profile_iossim.a
|
2020-07-25 07:01:48 +08:00
|
|
|
// LINK_IOSSIM_PROFILE: libclang_rt.iossim.a
|
2016-03-16 02:17:48 +08:00
|
|
|
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target arm64-apple-tvos8.3 -fuse-ld= -mlinker-version=400 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
|
2015-10-31 00:30:27 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_TVOS_ARM64 %s < %t.log
|
|
|
|
// LINK_TVOS_ARM64: {{ld(.exe)?"}}
|
|
|
|
// LINK_TVOS_ARM64: -tvos_version_min
|
|
|
|
// LINK_TVOS_ARM64-NOT: crt
|
|
|
|
// LINK_TVOS_ARM64-NOT: lgcc_s.1
|
2018-08-16 06:50:06 +08:00
|
|
|
// LINK_TVOS_ARM64: libclang_rt.tvos.a
|
2015-10-31 00:30:27 +08:00
|
|
|
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target arm64-apple-tvos8.3 -fuse-ld= -mlinker-version=400 -mtvos-version-min=8.3 -fprofile-instr-generate -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
|
2015-10-31 00:30:27 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_TVOS_PROFILE %s < %t.log
|
|
|
|
// LINK_TVOS_PROFILE: {{ld(.exe)?"}}
|
2018-08-16 06:50:06 +08:00
|
|
|
// LINK_TVOS_PROFILE: libclang_rt.profile_tvos.a
|
|
|
|
// LINK_TVOS_PROFILE: libclang_rt.tvos.a
|
|
|
|
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target arm64-apple-tvos8.3 -fuse-ld= -mlinker-version=400 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log
|
2015-10-31 00:30:27 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_TVOS_KEXT %s < %t.log
|
|
|
|
// LINK_TVOS_KEXT: {{ld(.exe)?"}}
|
2018-08-16 06:50:06 +08:00
|
|
|
// LINK_TVOS_KEXT: libclang_rt.cc_kext_tvos.a
|
|
|
|
// LINK_TVOS_KEXT: libclang_rt.tvos.a
|
|
|
|
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target armv7k-apple-watchos2.0 -fuse-ld= -mlinker-version=400 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
|
2015-10-31 00:30:27 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_WATCHOS_ARM %s < %t.log
|
|
|
|
// LINK_WATCHOS_ARM: {{ld(.exe)?"}}
|
|
|
|
// LINK_WATCHOS_ARM: -watchos_version_min
|
|
|
|
// LINK_WATCHOS_ARM-NOT: crt
|
|
|
|
// LINK_WATCHOS_ARM-NOT: lgcc_s.1
|
2018-08-16 06:50:06 +08:00
|
|
|
// LINK_WATCHOS_ARM: libclang_rt.watchos.a
|
2015-10-31 00:30:27 +08:00
|
|
|
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target armv7k-apple-watchos2.0 -fuse-ld= -mlinker-version=400 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -fprofile-instr-generate -### %t.o 2> %t.log
|
2015-10-31 00:30:27 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_WATCHOS_PROFILE %s < %t.log
|
|
|
|
// LINK_WATCHOS_PROFILE: {{ld(.exe)?"}}
|
2018-08-16 06:50:06 +08:00
|
|
|
// LINK_WATCHOS_PROFILE: libclang_rt.profile_watchos.a
|
|
|
|
// LINK_WATCHOS_PROFILE: libclang_rt.watchos.a
|
|
|
|
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target armv7k-apple-watchos2.0 -fuse-ld= -mlinker-version=400 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log
|
2015-10-31 00:30:27 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_WATCHOS_KEXT %s < %t.log
|
|
|
|
// LINK_WATCHOS_KEXT: {{ld(.exe)?"}}
|
2018-08-16 06:50:06 +08:00
|
|
|
// LINK_WATCHOS_KEXT: libclang_rt.cc_kext_watchos.a
|
|
|
|
// LINK_WATCHOS_KEXT: libclang_rt.watchos.a
|
2015-10-31 00:30:27 +08:00
|
|
|
|
2012-07-04 04:42:10 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin12 -pg -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_PG %s < %t.log
|
|
|
|
// LINK_PG: -lgcrt1.o
|
|
|
|
// LINK_PG: -no_new_main
|
2013-08-03 06:25:34 +08:00
|
|
|
|
2019-02-15 07:50:44 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin13 -pg -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_PG_NO_SUPPORT_OSX %s < %t.log
|
|
|
|
// LINK_PG_NO_SUPPORT_OSX: error: the clang compiler does not support -pg option on versions of OS X
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-apple-ios5.0 -pg -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_PG_NO_SUPPORT %s < %t.log
|
|
|
|
// LINK_PG_NO_SUPPORT: error: the clang compiler does not support -pg option on Darwin
|
|
|
|
|
2014-03-29 23:09:45 +08:00
|
|
|
// Check that clang links with libgcc_s.1 for iOS 4 and earlier, but not arm64.
|
|
|
|
// RUN: %clang -target armv7-apple-ios4.0 -miphoneos-version-min=4.0 -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_IOS_LIBGCC_S %s < %t.log
|
|
|
|
// LINK_IOS_LIBGCC_S: lgcc_s.1
|
|
|
|
|
|
|
|
// RUN: %clang -target arm64-apple-ios4.0 -miphoneos-version-min=4.0 -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_NO_IOS_ARM64_LIBGCC_S %s < %t.log
|
|
|
|
// LINK_NO_IOS_ARM64_LIBGCC_S-NOT: lgcc_s.1
|
|
|
|
|
2013-08-03 06:25:34 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -rdynamic -### %t.o \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: -fuse-ld= -mlinker-version=100 2> %t.log
|
2013-08-03 06:25:34 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_NO_EXPORT_DYNAMIC %s < %t.log
|
|
|
|
// LINK_NO_EXPORT_DYNAMIC: {{ld(.exe)?"}}
|
|
|
|
// LINK_NO_EXPORT_DYNAMIC-NOT: "-export_dynamic"
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -rdynamic -### %t.o \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: -fuse-ld= -mlinker-version=137 2> %t.log
|
2013-08-03 06:25:34 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_EXPORT_DYNAMIC %s < %t.log
|
|
|
|
// LINK_EXPORT_DYNAMIC: {{ld(.exe)?"}}
|
|
|
|
// LINK_EXPORT_DYNAMIC: "-export_dynamic"
|
|
|
|
|
2013-12-28 13:26:14 +08:00
|
|
|
// RUN: %clang -target x86_64h-apple-darwin -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_X86_64H_ARCH %s < %t.log
|
|
|
|
//
|
|
|
|
// LINK_X86_64H_ARCH: {{ld(.exe)?"}}
|
|
|
|
// LINK_X86_64H_ARCH: "x86_64h"
|
2014-01-08 09:02:06 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin -arch x86_64 -arch x86_64h -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_X86_64H_MULTIARCH %s < %t.log
|
|
|
|
//
|
|
|
|
// LINK_X86_64H_MULTIARCH: {{ld(.exe)?"}}
|
|
|
|
// LINK_X86_64H_MULTIARCH: "x86_64"
|
|
|
|
//
|
|
|
|
// LINK_X86_64H_MULTIARCH: {{ld(.exe)?"}}
|
|
|
|
// LINK_X86_64H_MULTIARCH: "x86_64h"
|
2014-02-02 05:06:21 +08:00
|
|
|
|
2014-10-11 03:38:34 +08:00
|
|
|
// Check for the linker options to specify the iOS version when the
|
|
|
|
// IPHONEOS_DEPLOYMENT_TARGET variable is used instead of the command-line
|
|
|
|
// deployment target options.
|
2014-02-02 05:06:21 +08:00
|
|
|
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target arm64-apple-darwin -fuse-ld= -mlinker-version=400 -### %t.o 2> %t.log
|
2014-02-02 05:06:21 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_IPHONEOS_VERSION_MIN %s < %t.log
|
2014-10-11 03:38:34 +08:00
|
|
|
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin -fuse-ld= -mlinker-version=400 -### %t.o 2> %t.log
|
2014-10-11 03:38:34 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_IOS_SIMULATOR_VERSION_MIN %s < %t.log
|
2014-02-02 05:06:21 +08:00
|
|
|
// LINK_IPHONEOS_VERSION_MIN: -iphoneos_version_min
|
2014-10-11 03:38:34 +08:00
|
|
|
// LINK_IOS_SIMULATOR_VERSION_MIN: -ios_simulator_version_min
|
2015-02-07 02:08:29 +08:00
|
|
|
|
2015-10-31 00:30:27 +08:00
|
|
|
// Ditto for tvOS....
|
|
|
|
// RUN: env TVOS_DEPLOYMENT_TARGET=7.0 \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target armv7-apple-darwin -fuse-ld= -mlinker-version=400 -### %t.o 2> %t.log
|
2015-10-31 00:30:27 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_TVOS_VERSION_MIN %s < %t.log
|
|
|
|
// RUN: env TVOS_DEPLOYMENT_TARGET=7.0 \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin -fuse-ld= -mlinker-version=400 -### %t.o 2> %t.log
|
2015-10-31 00:30:27 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_TVOS_SIMULATOR_VERSION_MIN %s < %t.log
|
|
|
|
// LINK_TVOS_VERSION_MIN: -tvos_version_min
|
|
|
|
// LINK_TVOS_SIMULATOR_VERSION_MIN: -tvos_simulator_version_min
|
|
|
|
|
|
|
|
// ...and for watchOS.
|
|
|
|
// RUN: env WATCHOS_DEPLOYMENT_TARGET=2.0 \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target armv7k-apple-darwin -fuse-ld= -mlinker-version=400 -### %t.o 2> %t.log
|
2015-10-31 00:30:27 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_WATCHOS_VERSION_MIN %s < %t.log
|
|
|
|
// RUN: env WATCHOS_DEPLOYMENT_TARGET=2.0 \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: %clang -target i386-apple-darwin -fuse-ld= -mlinker-version=400 -### %t.o 2> %t.log
|
2015-10-31 00:30:27 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_WATCHOS_SIMULATOR_VERSION_MIN %s < %t.log
|
|
|
|
// LINK_WATCHOS_VERSION_MIN: -watchos_version_min
|
|
|
|
// LINK_WATCHOS_SIMULATOR_VERSION_MIN: -watchos_simulator_version_min
|
|
|
|
|
2015-02-07 02:08:29 +08:00
|
|
|
// Check -iframework gets forward to ld as -F
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin %s -iframework Bar -framework Foo -### 2>&1 | \
|
|
|
|
// RUN: FileCheck --check-prefix=LINK-IFRAMEWORK %s
|
|
|
|
// LINK-IFRAMEWORK: {{ld(.exe)?"}}
|
|
|
|
// LINK-IFRAMEWORK: "-FBar"
|
2016-03-31 10:45:46 +08:00
|
|
|
|
|
|
|
// Check ld64 accepts up to 5 digits with no extra characters
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: -fuse-ld= -mlinker-version=133.3 2> %t.log
|
2016-03-31 10:45:46 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: -fuse-ld= -mlinker-version=133.3.0 2>> %t.log
|
2016-03-31 10:45:46 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: -fuse-ld= -mlinker-version=133.3.0.1 2>> %t.log
|
2016-03-31 10:45:46 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: -fuse-ld= -mlinker-version=133.3.0.1.2 2>> %t.log
|
2016-03-31 10:45:46 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: -fuse-ld= -mlinker-version=133.3.0.1.2.6 2>> %t.log
|
2016-03-31 10:45:46 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: -fuse-ld= -mlinker-version=133.3.0.1.a 2>> %t.log
|
2016-03-31 10:45:46 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \
|
2020-11-25 11:34:10 +08:00
|
|
|
// RUN: -fuse-ld= -mlinker-version=133.3.0.1a 2>> %t.log
|
2016-03-31 10:45:46 +08:00
|
|
|
// RUN: FileCheck -check-prefix=LINK_VERSION_DIGITS %s < %t.log
|
|
|
|
// LINK_VERSION_DIGITS-NOT: invalid version number in '-mlinker-version=133.3'
|
|
|
|
// LINK_VERSION_DIGITS-NOT: invalid version number in '-mlinker-version=133.3.0'
|
|
|
|
// LINK_VERSION_DIGITS-NOT: invalid version number in '-mlinker-version=133.3.0.1'
|
|
|
|
// LINK_VERSION_DIGITS-NOT: invalid version number in '-mlinker-version=133.3.0.1.2'
|
|
|
|
// LINK_VERSION_DIGITS: invalid version number in '-mlinker-version=133.3.0.1.2.6'
|
|
|
|
// LINK_VERSION_DIGITS: invalid version number in '-mlinker-version=133.3.0.1.a'
|
|
|
|
// LINK_VERSION_DIGITS: invalid version number in '-mlinker-version=133.3.0.1a'
|
2016-11-19 02:17:36 +08:00
|
|
|
|
2017-09-13 03:15:31 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-ios6.0 -miphoneos-version-min=6.0 -fprofile-instr-generate -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_PROFILE_FIRST %s < %t.log
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_PROFILE_FIRST %s < %t.log
|
|
|
|
// RUN: %clang -target i386-apple-darwin9 -fprofile-instr-generate -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_PROFILE_FIRST %s < %t.log
|
|
|
|
// RUN: %clang -target arm64-apple-ios5.0 -miphoneos-version-min=5.0 -fprofile-instr-generate -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=LINK_PROFILE_FIRST %s < %t.log
|
|
|
|
// LINK_PROFILE_FIRST: {{ld(.exe)?"}} "{{[^"]+}}libclang_rt.profile_{{[a-z]+}}.a"
|
2017-10-12 05:54:09 +08:00
|
|
|
|
[profile] Add a mode to continuously sync counter updates to a file
Add support for continuously syncing profile counter updates to a file.
The motivation for this is that programs do not always exit cleanly. On
iOS, for example, programs are usually killed via a signal from the OS.
Running atexit() handlers after catching a signal is unreliable, so some
method for progressively writing out profile data is necessary.
The approach taken here is to mmap() the `__llvm_prf_cnts` section onto
a raw profile. To do this, the linker must page-align the counter and
data sections, and the runtime must ensure that counters are mapped to a
page-aligned offset within a raw profile.
Continuous mode is (for the moment) incompatible with the online merging
mode. This limitation is lifted in https://reviews.llvm.org/D69586.
Continuous mode is also (for the moment) incompatible with value
profiling, as I'm not sure whether there is interest in this and the
implementation may be tricky.
As I have not been able to test extensively on non-Darwin platforms,
only Darwin support is included for the moment. However, continuous mode
may "just work" without modification on Linux and some UNIX-likes. AIUI
the default value for the GNU linker's `--section-alignment` flag is set
to the page size on many systems. This appears to be true for LLD as
well, as its `no_nmagic` option is on by default. Continuous mode will
not "just work" on Fuchsia or Windows, as it's not possible to mmap() a
section on these platforms. There is a proposal to add a layer of
indirection to the profile instrumentation to support these platforms.
rdar://54210980
Differential Revision: https://reviews.llvm.org/D68351
2019-09-20 02:56:43 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=PROFILE_SECTALIGN %s < %t.log
|
|
|
|
// RUN: %clang -target arm64-apple-ios12 -fprofile-instr-generate -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=PROFILE_SECTALIGN %s < %t.log
|
|
|
|
// PROFILE_SECTALIGN: "-sectalign" "__DATA" "__llvm_prf_cnts" "0x4000" "-sectalign" "__DATA" "__llvm_prf_data" "0x4000"
|
|
|
|
|
2018-04-14 07:43:59 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -exported_symbols_list /dev/null -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=PROFILE_EXPORT %s < %t.log
|
2017-10-12 05:54:09 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -Wl,-exported_symbols_list,/dev/null -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=PROFILE_EXPORT %s < %t.log
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -Wl,-exported_symbol,foo -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=PROFILE_EXPORT %s < %t.log
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -Xlinker -exported_symbol -Xlinker foo -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=PROFILE_EXPORT %s < %t.log
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -Xlinker -exported_symbols_list -Xlinker /dev/null -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=PROFILE_EXPORT %s < %t.log
|
2019-10-19 07:33:40 +08:00
|
|
|
// PROFILE_EXPORT: "-exported_symbol" "___llvm_profile_filename" "-exported_symbol" "___llvm_profile_raw_version"
|
2017-10-12 05:54:09 +08:00
|
|
|
//
|
2018-12-04 04:53:58 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate --coverage -### %t.o 2> %t.log
|
2017-10-12 05:54:09 +08:00
|
|
|
// RUN: FileCheck -check-prefix=NO_PROFILE_EXPORT %s < %t.log
|
|
|
|
// NO_PROFILE_EXPORT-NOT: "-exported_symbol"
|
2018-07-07 06:24:56 +08:00
|
|
|
//
|
2018-12-04 04:53:58 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 --coverage -exported_symbols_list /dev/null -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-arcs -Wl,-exported_symbols_list,/dev/null -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-arcs -Wl,-exported_symbol,foo -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-arcs -Xlinker -exported_symbol -Xlinker foo -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-arcs -Xlinker -exported_symbols_list -Xlinker /dev/null -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log
|
2020-07-19 06:07:46 +08:00
|
|
|
// GCOV_EXPORT: "-exported_symbol" "___gcov_dump"
|
|
|
|
// GCOV_EXPORT: "-exported_symbol" "___gcov_reset"
|
2018-12-04 04:53:58 +08:00
|
|
|
//
|
2018-07-07 06:24:56 +08:00
|
|
|
// Check that we can pass the outliner down to the linker.
|
|
|
|
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
|
|
|
|
// RUN: %clang -target arm64-apple-darwin -moutline -### %t.o 2> %t.log
|
2019-03-27 05:22:42 +08:00
|
|
|
// RUN: FileCheck -check-prefix=MOUTLINE %s < %t.log
|
|
|
|
// MOUTLINE: {{ld(.exe)?"}}
|
2018-07-07 06:24:56 +08:00
|
|
|
// MOUTLINE-SAME: "-mllvm" "-enable-machine-outliner" "-mllvm" "-enable-linkonceodr-outlining"
|
2019-03-27 05:22:42 +08:00
|
|
|
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
|
|
|
|
// RUN: %clang -target arm64-apple-darwin -mno-outline -### %t.o 2> %t.log
|
|
|
|
// RUN: FileCheck -check-prefix=MNO_OUTLINE %s < %t.log
|
|
|
|
// MNO_OUTLINE: {{ld(.exe)?"}}
|
|
|
|
// MNO_OUTLINE-SAME: "-mllvm" "-enable-machine-outliner=never"
|