| 1 |
// Check that ld gets arch_multiple. |
| 2 |
|
| 3 |
// RUN: %clang -target i386-apple-darwin9 -arch i386 -arch x86_64 %s -### -o foo 2> %t.log |
| 4 |
// RUN: grep '".*ld.*" .*"-arch_multiple" "-final_output" "foo"' %t.log |
| 5 |
|
| 6 |
// Make sure we run dsymutil on source input files. |
| 7 |
// RUN: %clang -target i386-apple-darwin9 -### -g %s -o BAR 2> %t.log |
| 8 |
// RUN: grep -E '".*dsymutil(\.exe)?" "-o" "BAR.dSYM" "BAR"' %t.log |
| 9 |
// RUN: %clang -target i386-apple-darwin9 -### -g -filelist FOO %s -o BAR 2> %t.log |
| 10 |
// RUN: grep -E '".*dsymutil(\.exe)?" "-o" "BAR.dSYM" "BAR"' %t.log |
| 11 |
|
| 12 |
// Check linker changes that came with new linkedit format. |
| 13 |
// RUN: touch %t.o |
| 14 |
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 %t.o 2> %t.log |
| 15 |
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 -dynamiclib %t.o 2>> %t.log |
| 16 |
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 -bundle %t.o 2>> %t.log |
| 17 |
// RUN: FileCheck -check-prefix=LINK_IPHONE_3_0 %s < %t.log |
| 18 |
|
| 19 |
// LINK_IPHONE_3_0: {{ld(.exe)?"}} |
| 20 |
// LINK_IPHONE_3_0: -iphoneos_version_min |
| 21 |
// LINK_IPHONE_3_0: 3.0.0 |
| 22 |
// LINK_IPHONE_3_0-NOT: -lcrt1.3.1.o |
| 23 |
// LINK_IPHONE_3_0: -lcrt1.o |
| 24 |
// LINK_IPHONE_3_0: -lSystem |
| 25 |
// LINK_IPHONE_3_0: {{ld(.exe)?"}} |
| 26 |
// LINK_IPHONE_3_0: -dylib |
| 27 |
// LINK_IPHONE_3_0: -ldylib1.o |
| 28 |
// LINK_IPHONE_3_0: -lSystem |
| 29 |
// LINK_IPHONE_3_0: {{ld(.exe)?"}} |
| 30 |
// LINK_IPHONE_3_0: -lbundle1.o |
| 31 |
// LINK_IPHONE_3_0: -lSystem |
| 32 |
|
| 33 |
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 %t.o 2> %t.log |
| 34 |
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 -dynamiclib %t.o 2>> %t.log |
| 35 |
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 -bundle %t.o 2>> %t.log |
| 36 |
// RUN: FileCheck -check-prefix=LINK_IPHONE_3_1 %s < %t.log |
| 37 |
|
| 38 |
// LINK_IPHONE_3_1: {{ld(.exe)?"}} |
| 39 |
// LINK_IPHONE_3_1: -iphoneos_version_min |
| 40 |
// LINK_IPHONE_3_1: 3.1.0 |
| 41 |
// LINK_IPHONE_3_1-NOT: -lcrt1.o |
| 42 |
// LINK_IPHONE_3_1: -lcrt1.3.1.o |
| 43 |
// LINK_IPHONE_3_1: -lSystem |
| 44 |
// LINK_IPHONE_3_1: {{ld(.exe)?"}} |
| 45 |
// LINK_IPHONE_3_1: -dylib |
| 46 |
// LINK_IPHONE_3_1-NOT: -ldylib1.o |
| 47 |
// LINK_IPHONE_3_1: -lSystem |
| 48 |
// LINK_IPHONE_3_1: {{ld(.exe)?"}} |
| 49 |
// LINK_IPHONE_3_1-NOT: -lbundle1.o |
| 50 |
// LINK_IPHONE_3_1: -lSystem |
| 51 |
|
| 52 |
// RUN: %clang -target i386-apple-darwin9 -fuse-ld= -mlinker-version=400 -### -arch i386 -mios-simulator-version-min=3.0 %t.o 2> %t.log |
| 53 |
// 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 |
| 54 |
// 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 |
| 55 |
// RUN: FileCheck -check-prefix=LINK_IOSSIM_3_0 %s < %t.log |
| 56 |
|
| 57 |
// LINK_IOSSIM_3_0: {{ld(.exe)?"}} |
| 58 |
// LINK_IOSSIM_3_0: -ios_simulator_version_min |
| 59 |
// LINK_IOSSIM_3_0: 3.0.0 |
| 60 |
// LINK_IOSSIM_3_0-NOT: -lcrt1.o |
| 61 |
// LINK_IOSSIM_3_0: -lSystem |
| 62 |
// LINK_IOSSIM_3_0: {{ld(.exe)?"}} |
| 63 |
// LINK_IOSSIM_3_0: -dylib |
| 64 |
// LINK_IOSSIM_3_0-NOT: -ldylib1.o |
| 65 |
// LINK_IOSSIM_3_0: -lSystem |
| 66 |
// LINK_IOSSIM_3_0: {{ld(.exe)?"}} |
| 67 |
// LINK_IOSSIM_3_0-NOT: -lbundle1.o |
| 68 |
// LINK_IOSSIM_3_0: -lSystem |
| 69 |
|
| 70 |
// RUN: %clang -target arm64-apple-darwin -fuse-ld= -mlinker-version=700 -### -arch arm64 -mios-simulator-version-min=15.0 %t.o 2>&1 | FileCheck -check-prefix=LINK_IOSSIM_ARM64 %s |
| 71 |
|
| 72 |
// LINK_IOSSIM_ARM64: "-platform_version" "ios-simulator" "15.0.0" "15.0.0" |
| 73 |
|
| 74 |
// RUN: %clang -target i386-apple-darwin9 -### -fpie %t.o 2> %t.log |
| 75 |
// RUN: FileCheck -check-prefix=LINK_EXPLICIT_PIE %s < %t.log |
| 76 |
// |
| 77 |
// LINK_EXPLICIT_PIE: {{ld(.exe)?"}} |
| 78 |
// LINK_EXPLICIT_PIE: "-pie" |
| 79 |
|
| 80 |
// RUN: %clang -target i386-apple-darwin9 -### -fno-pie %t.o 2> %t.log |
| 81 |
// RUN: FileCheck -check-prefix=LINK_EXPLICIT_NO_PIE %s < %t.log |
| 82 |
// |
| 83 |
// LINK_EXPLICIT_NO_PIE: {{ld(.exe)?"}} |
| 84 |
// LINK_EXPLICIT_NO_PIE: "-no_pie" |
| 85 |
|
| 86 |
// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \ |
| 87 |
// RUN: -fuse-ld= -mlinker-version=100 2> %t.log |
| 88 |
// RUN: FileCheck -check-prefix=LINK_NEWER_DEMANGLE %s < %t.log |
| 89 |
// |
| 90 |
// LINK_NEWER_DEMANGLE: {{ld(.exe)?"}} |
| 91 |
// LINK_NEWER_DEMANGLE: "-demangle" |
| 92 |
|
| 93 |
// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \ |
| 94 |
// RUN: -fuse-ld= -mlinker-version=100 -Wl,--no-demangle 2> %t.log |
| 95 |
// RUN: FileCheck -check-prefix=LINK_NEWER_NODEMANGLE %s < %t.log |
| 96 |
// |
| 97 |
// LINK_NEWER_NODEMANGLE: {{ld(.exe)?"}} |
| 98 |
// LINK_NEWER_NODEMANGLE-NOT: "-demangle" |
| 99 |
// LINK_NEWER_NODEMANGLE: "-lSystem" |
| 100 |
|
| 101 |
// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \ |
| 102 |
// RUN: -fuse-ld= -mlinker-version=95 2> %t.log |
| 103 |
// RUN: FileCheck -check-prefix=LINK_OLDER_NODEMANGLE %s < %t.log |
| 104 |
// |
| 105 |
// LINK_OLDER_NODEMANGLE: {{ld(.exe)?"}} |
| 106 |
// LINK_OLDER_NODEMANGLE-NOT: "-demangle" |
| 107 |
// LINK_OLDER_NODEMANGLE: "-lSystem" |
| 108 |
|
| 109 |
// RUN: %clang -target x86_64-apple-darwin10 -### %s \ |
| 110 |
// RUN: -fuse-ld= -mlinker-version=117 -flto 2> %t.log |
| 111 |
// RUN: cat %t.log |
| 112 |
// RUN: FileCheck -check-prefix=LINK_OBJECT_LTO_PATH %s < %t.log |
| 113 |
// |
| 114 |
// LINK_OBJECT_LTO_PATH: {{ld(.exe)?"}} |
| 115 |
// LINK_OBJECT_LTO_PATH: "-object_path_lto" |
| 116 |
|
| 117 |
// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \ |
| 118 |
// RUN: -force_load a -force_load b 2> %t.log |
| 119 |
// RUN: cat %t.log |
| 120 |
// RUN: FileCheck -check-prefix=FORCE_LOAD %s < %t.log |
| 121 |
// |
| 122 |
// FORCE_LOAD: {{ld(.exe)?"}} |
| 123 |
// FORCE_LOAD: "-force_load" "a" "-force_load" "b" |
| 124 |
|
| 125 |
// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \ |
| 126 |
// RUN: -lazy_framework Framework 2> %t.log |
| 127 |
// |
| 128 |
// RUN: FileCheck -check-prefix=LINK_LAZY_FRAMEWORK %s < %t.log |
| 129 |
// LINK_LAZY_FRAMEWORK: {{ld(.exe)?"}} |
| 130 |
// LINK_LAZY_FRAMEWORK: "-lazy_framework" "Framework" |
| 131 |
|
| 132 |
// RUN: %clang -target x86_64-apple-darwin10 -### %t.o \ |
| 133 |
// RUN: -lazy_library Library 2> %t.log |
| 134 |
// |
| 135 |
// RUN: FileCheck -check-prefix=LINK_LAZY_LIBRARY %s < %t.log |
| 136 |
// LINK_LAZY_LIBRARY: {{ld(.exe)?"}} |
| 137 |
// LINK_LAZY_LIBRARY: "-lazy_library" "Library" |
| 138 |
|
| 139 |
// RUN: %clang -target x86_64-apple-darwin10 -fuse-ld= -mlinker-version=400 -### %t.o 2> %t.log |
| 140 |
// RUN: %clang -target x86_64-apple-macosx10.7 -fuse-ld= -mlinker-version=400 -### %t.o 2>> %t.log |
| 141 |
// RUN: FileCheck -check-prefix=LINK_VERSION_MIN %s < %t.log |
| 142 |
// LINK_VERSION_MIN: {{ld(.exe)?"}} |
| 143 |
// LINK_VERSION_MIN: "-macosx_version_min" "10.6.0" |
| 144 |
// LINK_VERSION_MIN: {{ld(.exe)?"}} |
| 145 |
// LINK_VERSION_MIN: "-macosx_version_min" "10.7.0" |
| 146 |
|
| 147 |
// RUN: %clang -target x86_64-apple-ios13.1-macabi -fuse-ld= -mlinker-version=400 -### %t.o 2>> %t.log |
| 148 |
// RUN: FileCheck -check-prefix=LINK_VERSION_MIN_MACABI %s < %t.log |
| 149 |
// LINK_VERSION_MIN_MACABI: {{ld(.exe)?"}} |
| 150 |
// LINK_VERSION_MIN_MACABI: "-maccatalyst_version_min" "13.1.0" |
| 151 |
// LINK_VERSION_MIN_MACABI-NOT: macosx_version_min |
| 152 |
// LINK_VERSION_MIN_MACABI-NOT: macos_version_min |
| 153 |
|
| 154 |
// RUN: %clang -target x86_64-apple-darwin12 -### %t.o 2> %t.log |
| 155 |
// RUN: FileCheck -check-prefix=LINK_NO_CRT1 %s < %t.log |
| 156 |
// LINK_NO_CRT1-NOT: crt |
| 157 |
|
| 158 |
// RUN: %clang -target armv7-apple-ios6.0 -miphoneos-version-min=6.0 -### %t.o 2> %t.log |
| 159 |
// RUN: FileCheck -check-prefix=LINK_NO_IOS_CRT1 %s < %t.log |
| 160 |
// LINK_NO_IOS_CRT1-NOT: crt |
| 161 |
|
| 162 |
// RUN: %clang -target arm64-apple-ios5.0 -miphoneos-version-min=5.0 -### %t.o 2> %t.log |
| 163 |
// RUN: FileCheck -check-prefix=LINK_NO_IOS_ARM64_CRT1 %s < %t.log |
| 164 |
// LINK_NO_IOS_ARM64_CRT1-NOT: crt |
| 165 |
|
| 166 |
// 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 |
| 167 |
// RUN: FileCheck -check-prefix=LINK_IOSSIM_PROFILE %s < %t.log |
| 168 |
// LINK_IOSSIM_PROFILE: {{ld(.exe)?"}} |
| 169 |
// LINK_IOSSIM_PROFILE: libclang_rt.profile_iossim.a |
| 170 |
// LINK_IOSSIM_PROFILE: libclang_rt.iossim.a |
| 171 |
|
| 172 |
// 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 |
| 173 |
// RUN: FileCheck -check-prefix=LINK_TVOS_ARM64 %s < %t.log |
| 174 |
// LINK_TVOS_ARM64: {{ld(.exe)?"}} |
| 175 |
// LINK_TVOS_ARM64: -tvos_version_min |
| 176 |
// LINK_TVOS_ARM64-NOT: crt |
| 177 |
// LINK_TVOS_ARM64-NOT: lgcc_s.1 |
| 178 |
// LINK_TVOS_ARM64: libclang_rt.tvos.a |
| 179 |
|
| 180 |
// 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 |
| 181 |
// RUN: FileCheck -check-prefix=LINK_TVOS_PROFILE %s < %t.log |
| 182 |
// LINK_TVOS_PROFILE: {{ld(.exe)?"}} |
| 183 |
// LINK_TVOS_PROFILE: libclang_rt.profile_tvos.a |
| 184 |
// LINK_TVOS_PROFILE: libclang_rt.tvos.a |
| 185 |
|
| 186 |
// 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 |
| 187 |
// RUN: FileCheck -check-prefix=LINK_TVOS_KEXT %s < %t.log |
| 188 |
// LINK_TVOS_KEXT: {{ld(.exe)?"}} |
| 189 |
// LINK_TVOS_KEXT: libclang_rt.cc_kext_tvos.a |
| 190 |
// LINK_TVOS_KEXT: libclang_rt.tvos.a |
| 191 |
|
| 192 |
// RUN: %clang -target x86-64-apple-driverkit19.0 -fuse-ld= -mlinker-version=400 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log |
| 193 |
// RUN: FileCheck -check-prefix=LINK_DRIVERKIT %s < %t.log |
| 194 |
// LINK_DRIVERKIT: {{ld(.exe)?"}} |
| 195 |
// LINK_DRIVERKIT: -driverkit_version_min |
| 196 |
// LINK_DRIVERKIT-NOT: crt |
| 197 |
// LINK_DRIVERKIT-NOT: lgcc_s.1 |
| 198 |
// LINK_DRIVERKIT-NOT: lSystem |
| 199 |
// LINK_DRIVERKIT: libclang_rt.driverkit.a |
| 200 |
|
| 201 |
// 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 |
| 202 |
// RUN: FileCheck -check-prefix=LINK_WATCHOS_ARM %s < %t.log |
| 203 |
// LINK_WATCHOS_ARM: {{ld(.exe)?"}} |
| 204 |
// LINK_WATCHOS_ARM: -watchos_version_min |
| 205 |
// LINK_WATCHOS_ARM-NOT: crt |
| 206 |
// LINK_WATCHOS_ARM-NOT: lgcc_s.1 |
| 207 |
// LINK_WATCHOS_ARM: libclang_rt.watchos.a |
| 208 |
|
| 209 |
// 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 |
| 210 |
// RUN: FileCheck -check-prefix=LINK_WATCHOS_PROFILE %s < %t.log |
| 211 |
// LINK_WATCHOS_PROFILE: {{ld(.exe)?"}} |
| 212 |
// LINK_WATCHOS_PROFILE: libclang_rt.profile_watchos.a |
| 213 |
// LINK_WATCHOS_PROFILE: libclang_rt.watchos.a |
| 214 |
|
| 215 |
// 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 |
| 216 |
// RUN: FileCheck -check-prefix=LINK_WATCHOS_KEXT %s < %t.log |
| 217 |
// LINK_WATCHOS_KEXT: {{ld(.exe)?"}} |
| 218 |
// LINK_WATCHOS_KEXT: libclang_rt.cc_kext_watchos.a |
| 219 |
// LINK_WATCHOS_KEXT: libclang_rt.watchos.a |
| 220 |
|
| 221 |
// RUN: %clang -target i386-apple-darwin12 -pg -### %t.o 2> %t.log |
| 222 |
// RUN: FileCheck -check-prefix=LINK_PG %s < %t.log |
| 223 |
// LINK_PG: -lgcrt1.o |
| 224 |
// LINK_PG: -no_new_main |
| 225 |
|
| 226 |
// RUN: not %clang -target i386-apple-darwin13 -pg -### %t.o 2> %t.log |
| 227 |
// RUN: FileCheck -check-prefix=LINK_PG_NO_SUPPORT_OSX %s < %t.log |
| 228 |
// LINK_PG_NO_SUPPORT_OSX: error: the clang compiler does not support -pg option on versions of OS X |
| 229 |
|
| 230 |
// RUN: not %clang -target x86_64-apple-ios5.0 -pg -### %t.o 2> %t.log |
| 231 |
// RUN: FileCheck -check-prefix=LINK_PG_NO_SUPPORT %s < %t.log |
| 232 |
// LINK_PG_NO_SUPPORT: error: the clang compiler does not support -pg option on Darwin |
| 233 |
|
| 234 |
// Check that clang links with libgcc_s.1 for iOS 4 and earlier, but not arm64. |
| 235 |
// RUN: %clang -target armv7-apple-ios4.0 -miphoneos-version-min=4.0 -### %t.o 2> %t.log |
| 236 |
// RUN: FileCheck -check-prefix=LINK_IOS_LIBGCC_S %s < %t.log |
| 237 |
// LINK_IOS_LIBGCC_S: lgcc_s.1 |
| 238 |
|
| 239 |
// RUN: %clang -target arm64-apple-ios4.0 -miphoneos-version-min=4.0 -### %t.o 2> %t.log |
| 240 |
// RUN: FileCheck -check-prefix=LINK_NO_IOS_ARM64_LIBGCC_S %s < %t.log |
| 241 |
// LINK_NO_IOS_ARM64_LIBGCC_S-NOT: lgcc_s.1 |
| 242 |
|
| 243 |
// Check that clang links with libgcc_s.1 for Mac OS X 10.5 and earlier, but not arm64 |
| 244 |
// RUN: %clang -target x86_64-apple-macosx10.5 -mmacosx-version-min=10.5 -### %t.o 2> %t.log |
| 245 |
// RUN: FileCheck -check-prefix=LINK_OSX_LIBGCC_S %s < %t.log |
| 246 |
// LINK_OSX_LIBGCC_S: lgcc_s.1 |
| 247 |
|
| 248 |
// RUN: %clang -target arm64-apple-macosx10.5 -mmacosx-version-min=10.5 -### %t.o 2> %t.log |
| 249 |
// RUN: FileCheck -check-prefix=LINK_NO_OSX_ARM64_LIBGCC_S %s < %t.log |
| 250 |
// LINK_NO_OSX_ARM64_LIBGCC_S-NOT: lgcc_s.1 |
| 251 |
|
| 252 |
// RUN: %clang -target x86_64-apple-darwin12 -rdynamic -### %t.o \ |
| 253 |
// RUN: -fuse-ld= -mlinker-version=100 2> %t.log |
| 254 |
// RUN: FileCheck -check-prefix=LINK_NO_EXPORT_DYNAMIC %s < %t.log |
| 255 |
// LINK_NO_EXPORT_DYNAMIC: {{ld(.exe)?"}} |
| 256 |
// LINK_NO_EXPORT_DYNAMIC-NOT: "-export_dynamic" |
| 257 |
|
| 258 |
// RUN: %clang -target x86_64-apple-darwin12 -rdynamic -### %t.o \ |
| 259 |
// RUN: -fuse-ld= -mlinker-version=137 2> %t.log |
| 260 |
// RUN: FileCheck -check-prefix=LINK_EXPORT_DYNAMIC %s < %t.log |
| 261 |
// RUN: %clang -target x86_64-apple-darwin12 -rdynamic -### %t.o \ |
| 262 |
// RUN: -fuse-ld=lld -B%S/Inputs/lld -mlinker-version=100 2> %t.log |
| 263 |
// RUN: FileCheck -check-prefix=LINK_EXPORT_DYNAMIC %s < %t.log |
| 264 |
// LINK_EXPORT_DYNAMIC: {{ld(.exe)?"}} |
| 265 |
// LINK_EXPORT_DYNAMIC: "-export_dynamic" |
| 266 |
|
| 267 |
// RUN: %clang -target x86_64h-apple-darwin -### %t.o 2> %t.log |
| 268 |
// RUN: FileCheck -check-prefix=LINK_X86_64H_ARCH %s < %t.log |
| 269 |
// |
| 270 |
// LINK_X86_64H_ARCH: {{ld(.exe)?"}} |
| 271 |
// LINK_X86_64H_ARCH: "x86_64h" |
| 272 |
|
| 273 |
// RUN: %clang -target x86_64-apple-darwin -arch x86_64 -arch x86_64h -### %t.o 2> %t.log |
| 274 |
// RUN: FileCheck -check-prefix=LINK_X86_64H_MULTIARCH %s < %t.log |
| 275 |
// |
| 276 |
// LINK_X86_64H_MULTIARCH: {{ld(.exe)?"}} |
| 277 |
// LINK_X86_64H_MULTIARCH: "x86_64" |
| 278 |
// |
| 279 |
// LINK_X86_64H_MULTIARCH: {{ld(.exe)?"}} |
| 280 |
// LINK_X86_64H_MULTIARCH: "x86_64h" |
| 281 |
|
| 282 |
// Check for the linker options to specify the iOS version when the |
| 283 |
// IPHONEOS_DEPLOYMENT_TARGET variable is used instead of the command-line |
| 284 |
// deployment target options. |
| 285 |
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \ |
| 286 |
// RUN: %clang -target arm64-apple-darwin -fuse-ld= -mlinker-version=400 -### %t.o 2> %t.log |
| 287 |
// RUN: FileCheck -check-prefix=LINK_IPHONEOS_VERSION_MIN %s < %t.log |
| 288 |
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \ |
| 289 |
// RUN: %clang -target i386-apple-darwin -fuse-ld= -mlinker-version=400 -### %t.o 2> %t.log |
| 290 |
// RUN: FileCheck -check-prefix=LINK_IOS_SIMULATOR_VERSION_MIN %s < %t.log |
| 291 |
// LINK_IPHONEOS_VERSION_MIN: -iphoneos_version_min |
| 292 |
// LINK_IOS_SIMULATOR_VERSION_MIN: -ios_simulator_version_min |
| 293 |
|
| 294 |
// Ditto for tvOS.... |
| 295 |
// RUN: env TVOS_DEPLOYMENT_TARGET=7.0 \ |
| 296 |
// RUN: %clang -target armv7-apple-darwin -fuse-ld= -mlinker-version=400 -### %t.o 2> %t.log |
| 297 |
// RUN: FileCheck -check-prefix=LINK_TVOS_VERSION_MIN %s < %t.log |
| 298 |
// RUN: env TVOS_DEPLOYMENT_TARGET=7.0 \ |
| 299 |
// RUN: %clang -target x86_64-apple-darwin -fuse-ld= -mlinker-version=400 -### %t.o 2> %t.log |
| 300 |
// RUN: FileCheck -check-prefix=LINK_TVOS_SIMULATOR_VERSION_MIN %s < %t.log |
| 301 |
// LINK_TVOS_VERSION_MIN: -tvos_version_min |
| 302 |
// LINK_TVOS_SIMULATOR_VERSION_MIN: -tvos_simulator_version_min |
| 303 |
|
| 304 |
// ...and for watchOS. |
| 305 |
// RUN: env WATCHOS_DEPLOYMENT_TARGET=2.0 \ |
| 306 |
// RUN: %clang -target armv7k-apple-darwin -fuse-ld= -mlinker-version=400 -### %t.o 2> %t.log |
| 307 |
// RUN: FileCheck -check-prefix=LINK_WATCHOS_VERSION_MIN %s < %t.log |
| 308 |
// RUN: env WATCHOS_DEPLOYMENT_TARGET=2.0 \ |
| 309 |
// RUN: %clang -target i386-apple-darwin -fuse-ld= -mlinker-version=400 -### %t.o 2> %t.log |
| 310 |
// RUN: FileCheck -check-prefix=LINK_WATCHOS_SIMULATOR_VERSION_MIN %s < %t.log |
| 311 |
// LINK_WATCHOS_VERSION_MIN: -watchos_version_min |
| 312 |
// LINK_WATCHOS_SIMULATOR_VERSION_MIN: -watchos_simulator_version_min |
| 313 |
|
| 314 |
// Check -iframework gets forward to ld as -F |
| 315 |
// RUN: %clang -target x86_64-apple-darwin %s -iframework Bar -framework Foo -### 2>&1 | \ |
| 316 |
// RUN: FileCheck --check-prefix=LINK-IFRAMEWORK %s |
| 317 |
// LINK-IFRAMEWORK: {{ld(.exe)?"}} |
| 318 |
// LINK-IFRAMEWORK: "-FBar" |
| 319 |
|
| 320 |
// Check ld64 accepts up to 5 digits with no extra characters |
| 321 |
// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \ |
| 322 |
// RUN: -fuse-ld= -mlinker-version=133.3 2> %t.log |
| 323 |
// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \ |
| 324 |
// RUN: -fuse-ld= -mlinker-version=133.3.0 2>> %t.log |
| 325 |
// RUN: %clang -target x86_64-apple-darwin12 %s -### -o %t \ |
| 326 |
// RUN: -fuse-ld= -mlinker-version=133.3.0.1 2>> %t.log |
| 327 |
// RUN: not %clang -target x86_64-apple-darwin12 %s -### -o %t \ |
| 328 |
// RUN: -fuse-ld= -mlinker-version=133.3.0.1.2 2>> %t.log |
| 329 |
// RUN: not %clang -target x86_64-apple-darwin12 %s -### -o %t \ |
| 330 |
// RUN: -fuse-ld= -mlinker-version=133.3.0.1.2.6 2>> %t.log |
| 331 |
// RUN: not %clang -target x86_64-apple-darwin12 %s -### -o %t \ |
| 332 |
// RUN: -fuse-ld= -mlinker-version=133.3.0.1.a 2>> %t.log |
| 333 |
// RUN: not %clang -target x86_64-apple-darwin12 %s -### -o %t \ |
| 334 |
// RUN: -fuse-ld= -mlinker-version=133.3.0.1a 2>> %t.log |
| 335 |
// RUN: FileCheck -check-prefix=LINK_VERSION_DIGITS %s < %t.log |
| 336 |
// LINK_VERSION_DIGITS-NOT: invalid version number in '-mlinker-version=133.3' |
| 337 |
// LINK_VERSION_DIGITS-NOT: invalid version number in '-mlinker-version=133.3.0' |
| 338 |
// LINK_VERSION_DIGITS-NOT: invalid version number in '-mlinker-version=133.3.0.1' |
| 339 |
// LINK_VERSION_DIGITS: invalid version number in '-mlinker-version=133.3.0.1.2' |
| 340 |
// LINK_VERSION_DIGITS: invalid version number in '-mlinker-version=133.3.0.1.2.6' |
| 341 |
// LINK_VERSION_DIGITS: invalid version number in '-mlinker-version=133.3.0.1.a' |
| 342 |
// LINK_VERSION_DIGITS: invalid version number in '-mlinker-version=133.3.0.1a' |
| 343 |
|
| 344 |
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate -### %t.o 2> %t.log |
| 345 |
// RUN: FileCheck -check-prefix=PROFILE_SECTALIGN %s < %t.log |
| 346 |
// RUN: %clang -target arm64-apple-ios12 -fprofile-instr-generate -### %t.o 2> %t.log |
| 347 |
// RUN: FileCheck -check-prefix=PROFILE_SECTALIGN %s < %t.log |
| 348 |
// PROFILE_SECTALIGN: "-sectalign" "__DATA" "__llvm_prf_cnts" "0x4000" "-sectalign" "__DATA" "__llvm_prf_bits" "0x4000" "-sectalign" "__DATA" "__llvm_prf_data" "0x4000" |
| 349 |
|
| 350 |
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-instr-generate --coverage -### %t.o 2> %t.log |
| 351 |
// RUN: FileCheck -check-prefix=NO_PROFILE_EXPORT %s < %t.log |
| 352 |
// NO_PROFILE_EXPORT-NOT: "-exported_symbol" |
| 353 |
// |
| 354 |
// RUN: %clang -target x86_64-apple-darwin12 --coverage -exported_symbols_list /dev/null -### %t.o 2> %t.log |
| 355 |
// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log |
| 356 |
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-arcs -Wl,-exported_symbols_list,/dev/null -### %t.o 2> %t.log |
| 357 |
// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log |
| 358 |
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-arcs -Wl,-exported_symbol,foo -### %t.o 2> %t.log |
| 359 |
// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log |
| 360 |
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-arcs -Xlinker -exported_symbol -Xlinker foo -### %t.o 2> %t.log |
| 361 |
// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log |
| 362 |
// RUN: %clang -target x86_64-apple-darwin12 -fprofile-arcs -Xlinker -exported_symbols_list -Xlinker /dev/null -### %t.o 2> %t.log |
| 363 |
// RUN: FileCheck -check-prefix=GCOV_EXPORT %s < %t.log |
| 364 |
// GCOV_EXPORT: "-exported_symbol" "___gcov_dump" |
| 365 |
// GCOV_EXPORT: "-exported_symbol" "___gcov_reset" |
| 366 |
// |
| 367 |
// Check that we can pass the outliner down to the linker. |
| 368 |
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \ |
| 369 |
// RUN: %clang -target arm64-apple-darwin -moutline -### %t.o 2> %t.log |
| 370 |
// RUN: FileCheck -check-prefix=ARM64-MOUTLINE %s < %t.log |
| 371 |
// ARM64-MOUTLINE: {{ld(.exe)?"}} |
| 372 |
// ARM64-MOUTLINE-SAME: "-mllvm" "-enable-machine-outliner" "-mllvm" "-enable-linkonceodr-outlining" |
| 373 |
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \ |
| 374 |
// RUN: %clang -target arm64e-apple-darwin -moutline -### %t.o 2> %t.log |
| 375 |
// RUN: FileCheck -check-prefix=ARM64E-MOUTLINE %s < %t.log |
| 376 |
// ARM64E-MOUTLINE: {{ld(.exe)?"}} |
| 377 |
// ARM64E-MOUTLINE-SAME: "-mllvm" "-enable-linkonceodr-outlining" |
| 378 |
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \ |
| 379 |
// RUN: %clang -target armv7em-apple-darwin -moutline -### %t.o 2> %t.log |
| 380 |
// RUN: FileCheck -check-prefix=ARMV7EM-MOUTLINE %s < %t.log |
| 381 |
// ARMV7EM-MOUTLINE: {{ld(.exe)?"}} |
| 382 |
// ARMV7EM-MOUTLINE-SAME: "-mllvm" "-enable-linkonceodr-outlining" |
| 383 |
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \ |
| 384 |
// RUN: %clang -target arm64-apple-darwin -mno-outline -### %t.o 2> %t.log |
| 385 |
// RUN: FileCheck -check-prefix=ARM64-MNO_OUTLINE %s < %t.log |
| 386 |
// ARM64-MNO_OUTLINE: {{ld(.exe)?"}} |
| 387 |
// ARM64-MNO_OUTLINE-SAME: "-mllvm" "-enable-machine-outliner=never" "-mllvm" "-enable-linkonceodr-outlining" |
| 388 |
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \ |
| 389 |
// RUN: %clang -target arm64e-apple-darwin -mno-outline -### %t.o 2> %t.log |
| 390 |
// RUN: FileCheck -check-prefix=ARM64E-MNO_OUTLINE %s < %t.log |
| 391 |
// ARM64E-MNO_OUTLINE: {{ld(.exe)?"}} |
| 392 |
// ARM64E-MNO_OUTLINE-SAME: "-mllvm" "-enable-machine-outliner=never" "-mllvm" "-enable-linkonceodr-outlining" |
| 393 |
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \ |
| 394 |
// RUN: %clang -target armv7em-apple-darwin -mno-outline -### %t.o 2> %t.log |
| 395 |
// RUN: FileCheck -check-prefix=ARMV7EM-MNO_OUTLINE %s < %t.log |
| 396 |
// ARMV7EM-MNO_OUTLINE: {{ld(.exe)?"}} |
| 397 |
// ARMV7EM-MNO_OUTLINE-SAME: "-mllvm" "-enable-machine-outliner=never" "-mllvm" "-enable-linkonceodr-outlining" |