blob: 75279b9e0c5daa93f2e9e5019ab91862cf3a75fa [file] [log] [blame]
Steven Wua74bbaf2015-02-04 18:10:38 +00001// RUN: %clang -target armv6-apple-darwin9 -c %s -### 2>&1 | \
2// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX %s
Renato Goline11531f2015-03-17 11:55:43 +00003// CHECK-VERSION-OSX: "armv6k-apple-macosx10.5.0"
Steven Wua74bbaf2015-02-04 18:10:38 +00004// RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=2.0 -c %s -### 2>&1 | \
5// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS2 %s
Renato Goline11531f2015-03-17 11:55:43 +00006// CHECK-VERSION-IOS2: "armv6k-apple-ios2.0.0"
Steven Wua74bbaf2015-02-04 18:10:38 +00007// RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=2.2 -c %s -### 2>&1 | \
8// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS22 %s
Renato Goline11531f2015-03-17 11:55:43 +00009// CHECK-VERSION-IOS22: "armv6k-apple-ios2.2.0"
Steven Wua74bbaf2015-02-04 18:10:38 +000010// RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=3.0 -c %s -### 2>&1 | \
11// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS3 %s
Renato Goline11531f2015-03-17 11:55:43 +000012// CHECK-VERSION-IOS3: "armv6k-apple-ios3.0.0"
Akira Hatanakadc9d8fb2017-07-01 00:57:52 +000013
14// RUN: env IPHONEOS_DEPLOYMENT_TARGET=11.0 \
Alex Lorenz1acc63f2017-12-19 19:05:04 +000015// RUN: %clang -target armv7-apple-darwin -c -### %s 2> %t.err
Akira Hatanakadc9d8fb2017-07-01 00:57:52 +000016// RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS4 %s
17// CHECK-VERSION-IOS4: invalid iOS deployment version 'IPHONEOS_DEPLOYMENT_TARGET=11.0'
18
Alex Lorenz1acc63f2017-12-19 19:05:04 +000019// RUN: %clang -target armv7-apple-ios11.0 -c -### %s 2> %t.err
20// RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS41 %s
21// CHECK-VERSION-IOS41: invalid iOS deployment version '--target=armv7-apple-ios11.0'
22
23// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=11.0 -c -### %s 2> %t.err
Akira Hatanakadc9d8fb2017-07-01 00:57:52 +000024// RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS5 %s
25// CHECK-VERSION-IOS5: invalid iOS deployment version '-miphoneos-version-min=11.0'
26
27// RUN: %clang -target i386-apple-darwin -mios-simulator-version-min=11.0 -c -### %s 2> %t.err
28// RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS6 %s
29// CHECK-VERSION-IOS6: invalid iOS deployment version '-mios-simulator-version-min=11.0'
30
31// RUN: %clang -target armv7-apple-ios11.1 -c -### %s 2>&1 | \
Alex Lorenz1acc63f2017-12-19 19:05:04 +000032// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS71 %s
33// CHECK-VERSION-IOS71: invalid iOS deployment version
34// RUN: %clang -target armv7-apple-darwin -Wno-missing-sysroot -isysroot SDKs/iPhoneOS11.0.sdk -c -### %s 2>&1 | \
Akira Hatanaka4a94d8d2017-07-31 22:19:34 +000035// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS7 %s
Akira Hatanakadc9d8fb2017-07-01 00:57:52 +000036// CHECK-VERSION-IOS7: thumbv7-apple-ios10.99.99
37
38// RUN: env IPHONEOS_DEPLOYMENT_TARGET=11.0 \
Alex Lorenz1acc63f2017-12-19 19:05:04 +000039// RUN: %clang -target arm64-apple-darwin -c -### %s 2>&1 | \
Akira Hatanakadc9d8fb2017-07-01 00:57:52 +000040// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS8 %s
41// CHECK-VERSION-IOS8: arm64-apple-ios11.0.0
42
43// RUN: %clang -target arm64-apple-ios11.0 -miphoneos-version-min=11.0 -c -### %s 2>&1 | \
44// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS9 %s
45// CHECK-VERSION-IOS9: arm64-apple-ios11.0.0
46
47// RUN: %clang -target x86_64-apple-darwin -mios-simulator-version-min=11.0 -c -### %s 2>&1 | \
48// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS10 %s
Alex Lorenz6cdef0e2017-12-07 19:04:10 +000049// CHECK-VERSION-IOS10: x86_64-apple-ios11.0.0-simulator
Akira Hatanakadc9d8fb2017-07-01 00:57:52 +000050
51// RUN: %clang -target arm64-apple-ios11.1 -c -### %s 2>&1 | \
52// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS11 %s
53// CHECK-VERSION-IOS11: arm64-apple-ios11.1.0
54
Akira Hatanakafb82a592017-07-31 19:16:40 +000055// RUN: %clang -target armv7-apple-ios9.0 -miphoneos-version-min=11.0 -c -Wno-invalid-ios-deployment-target -### %s 2>&1 | \
56// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS12 %s
Alex Lorenz1acc63f2017-12-19 19:05:04 +000057// CHECK-VERSION-IOS12: thumbv7-apple-ios9.0.0
Akira Hatanakafb82a592017-07-31 19:16:40 +000058
Steven Wua74bbaf2015-02-04 18:10:38 +000059// RUN: %clang -target i686-apple-darwin8 -c %s -### 2>&1 | \
60// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX4 %s
61// RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.4 -c %s -### 2>&1 | \
62// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX4 %s
63// CHECK-VERSION-OSX4: "i386-apple-macosx10.4.0"
64// RUN: %clang -target i686-apple-darwin9 -c %s -### 2>&1 | \
65// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX5 %s
66// RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.5 -c %s -### 2>&1 | \
67// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX5 %s
68// CHECK-VERSION-OSX5: "i386-apple-macosx10.5.0"
69// RUN: %clang -target i686-apple-darwin10 -c %s -### 2>&1 | \
70// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX6 %s
71// RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.6 -c %s -### 2>&1 | \
72// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX6 %s
73// CHECK-VERSION-OSX6: "i386-apple-macosx10.6.0"
74// RUN: %clang -target x86_64-apple-darwin14 -c %s -### 2>&1 | \
75// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX10 %s
Alex Lorenz1acc63f2017-12-19 19:05:04 +000076// RUN: %clang -target x86_64-apple-darwin -mmacosx-version-min=10.10 -c %s -### 2>&1 | \
Steven Wua74bbaf2015-02-04 18:10:38 +000077// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX10 %s
Alex Lorenz1acc63f2017-12-19 19:05:04 +000078// RUN: %clang -target x86_64-apple-darwin -mmacos-version-min=10.10 -c %s -### 2>&1 | \
Alex Lorenz921ab752017-05-05 14:52:48 +000079// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX10 %s
Steven Wua74bbaf2015-02-04 18:10:38 +000080// CHECK-VERSION-OSX10: "x86_64-apple-macosx10.10.0"
Alex Lorenz1acc63f2017-12-19 19:05:04 +000081// RUN: %clang -target x86_64-apple-darwin -mmacosx-version-min= -c %s -### 2>&1 | \
Bob Wilson433cb312015-04-07 01:03:35 +000082// RUN: FileCheck --check-prefix=CHECK-VERSION-MISSING %s
Alex Lorenz1acc63f2017-12-19 19:05:04 +000083// RUN: %clang -target x86_64-apple-darwin -mmacos-version-min= -c %s -### 2>&1 | \
Alex Lorenz921ab752017-05-05 14:52:48 +000084// RUN: FileCheck --check-prefix=CHECK-VERSION-MISSING %s
Bob Wilson433cb312015-04-07 01:03:35 +000085// CHECK-VERSION-MISSING: invalid version number
Tim Northover6f3ff222015-10-30 16:30:27 +000086// RUN: %clang -target armv7k-apple-darwin -mwatchos-version-min=2.0 -c %s -### 2>&1 | \
87// RUN: FileCheck --check-prefix=CHECK-VERSION-WATCHOS20 %s
88// RUN: %clang -target armv7-apple-darwin -mtvos-version-min=8.3 -c %s -### 2>&1 | \
89// RUN: FileCheck --check-prefix=CHECK-VERSION-TVOS83 %s
90// CHECK-VERSION-TVOS83: "thumbv7-apple-tvos8.3.0"
91// RUN: %clang -target i386-apple-darwin -mtvos-simulator-version-min=8.3 -c %s -### 2>&1 | \
92// RUN: FileCheck --check-prefix=CHECK-VERSION-TVSIM83 %s
Alex Lorenz6cdef0e2017-12-07 19:04:10 +000093// CHECK-VERSION-TVSIM83: "i386-apple-tvos8.3.0-simulator"
Tim Northover935d79b2015-11-02 21:14:48 +000094// RUN: %clang -target armv7k-apple-darwin -mwatchos-version-min=2.0 -c %s -### 2>&1 | \
95// RUN: FileCheck --check-prefix=CHECK-VERSION-WATCHOS20 %s
Tim Northover6f3ff222015-10-30 16:30:27 +000096// CHECK-VERSION-WATCHOS20: "thumbv7k-apple-watchos2.0.0"
97// RUN: %clang -target i386-apple-darwin -mwatchos-simulator-version-min=2.0 -c %s -### 2>&1 | \
98// RUN: FileCheck --check-prefix=CHECK-VERSION-WATCHSIM20 %s
Alex Lorenz6cdef0e2017-12-07 19:04:10 +000099// CHECK-VERSION-WATCHSIM20: "i386-apple-watchos2.0.0-simulator"
Daniel Dunbarb5023e92009-04-10 21:00:07 +0000100
Steven Wua74bbaf2015-02-04 18:10:38 +0000101// Check environment variable gets interpreted correctly
Tim Northover6f3ff222015-10-30 16:30:27 +0000102// RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 IPHONEOS_DEPLOYMENT_TARGET=2.0 \
Steven Wua74bbaf2015-02-04 18:10:38 +0000103// RUN: %clang -target i386-apple-darwin9 -c %s -### 2>&1 | \
104// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX5 %s
Tim Northover6f3ff222015-10-30 16:30:27 +0000105// RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 IPHONEOS_DEPLOYMENT_TARGET=2.0 \
Steven Wua74bbaf2015-02-04 18:10:38 +0000106// RUN: %clang -target armv6-apple-darwin9 -c %s -### 2>&1 | \
107// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS2 %s
Daniel Dunbarbbd48222011-04-21 21:27:33 +0000108
109// RUN: env MACOSX_DEPLOYMENT_TARGET=10.4.10 \
Steven Wua74bbaf2015-02-04 18:10:38 +0000110// RUN: %clang -target i386-apple-darwin9 -c %s -### 2>&1 | \
111// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX49 %s
112// CHECK-VERSION-OSX49: "i386-apple-macosx10.4.10"
113// RUN: env IPHONEOS_DEPLOYMENT_TARGET=2.3.1 \
114// RUN: %clang -target armv6-apple-darwin9 -c %s -### 2>&1 | \
115// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS231 %s
Renato Goline11531f2015-03-17 11:55:43 +0000116// CHECK-VERSION-IOS231: "armv6k-apple-ios2.3.1"
Tim Northover6f3ff222015-10-30 16:30:27 +0000117
118// RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 TVOS_DEPLOYMENT_TARGET=8.3.1 \
119// RUN: %clang -target armv7-apple-darwin9 -c %s -### 2>&1 | \
120// RUN: FileCheck --check-prefix=CHECK-VERSION-TVOS %s
121// CHECK-VERSION-TVOS: "thumbv7-apple-tvos8.3.1"
122// RUN: env TVOS_DEPLOYMENT_TARGET=8.3.1 \
123// RUN: %clang -target i386-apple-darwin9 -c %s -### 2>&1 | \
124// RUN: FileCheck --check-prefix=CHECK-VERSION-TVOSSIM %s
Alex Lorenz6cdef0e2017-12-07 19:04:10 +0000125// CHECK-VERSION-TVOSSIM: "i386-apple-tvos8.3.1-simulator"
Tim Northover6f3ff222015-10-30 16:30:27 +0000126
127// RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 WATCHOS_DEPLOYMENT_TARGET=2.0 \
128// RUN: %clang -target armv7-apple-darwin9 -c %s -### 2>&1 | \
129// RUN: FileCheck --check-prefix=CHECK-VERSION-WATCHOS %s
130// CHECK-VERSION-WATCHOS: "thumbv7-apple-watchos2.0.0"
131// RUN: env WATCHOS_DEPLOYMENT_TARGET=2.0 \
132// RUN: %clang -target i386-apple-darwin9 -c %s -### 2>&1 | \
133// RUN: FileCheck --check-prefix=CHECK-VERSION-WATCHOSSIM %s
Alex Lorenz6cdef0e2017-12-07 19:04:10 +0000134// CHECK-VERSION-WATCHOSSIM: "i386-apple-watchos2.0.0-simulator"
Akira Hatanaka136ec492017-07-14 00:21:32 +0000135
136// RUN: %clang -target x86_64-apple-ios11.0.0 -c %s -### 2>&1 | \
137// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS-TARGET %s
Alex Lorenz6cdef0e2017-12-07 19:04:10 +0000138// CHECK-VERSION-IOS-TARGET: "x86_64-apple-ios11.0.0-simulator"
Akira Hatanaka136ec492017-07-14 00:21:32 +0000139
140// RUN: %clang -target x86_64-apple-tvos11.0 -c %s -### 2>&1 | \
141// RUN: FileCheck --check-prefix=CHECK-VERSION-TVOS-TARGET %s
Alex Lorenz6cdef0e2017-12-07 19:04:10 +0000142// CHECK-VERSION-TVOS-TARGET: "x86_64-apple-tvos11.0.0-simulator"
Akira Hatanaka136ec492017-07-14 00:21:32 +0000143
144// RUN: %clang -target x86_64-apple-watchos4.0 -c %s -### 2>&1 | \
145// RUN: FileCheck --check-prefix=CHECK-VERSION-WATCHOS-TARGET %s
Alex Lorenz6cdef0e2017-12-07 19:04:10 +0000146// CHECK-VERSION-WATCHOS-TARGET: "x86_64-apple-watchos4.0.0-simulator"
Alex Lorenzf04fb272017-12-09 02:27:11 +0000147
148// RUN: env MACOSX_DEPLOYMENT_TARGET=1000.1000 \
Alex Lorenz25e93db2017-12-09 02:56:48 +0000149// RUN: %clang -target x86_64-apple-darwin -c %s -### 2>&1 | \
Alex Lorenzf04fb272017-12-09 02:27:11 +0000150// RUN: FileCheck --check-prefix=CHECK-VERSION-INVALID-ENV %s
151// CHECK-VERSION-INVALID-ENV: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=1000.1000'
Alex Lorenz1acc63f2017-12-19 19:05:04 +0000152
153
154
155// Target can specify the OS version:
156
157// RUN: %clang -target x86_64-apple-macos10.11.2 -c %s -### 2>&1 | \
158// RUN: FileCheck --check-prefix=CHECK-VERSION-TMAC2 %s
159// CHECK-VERSION-TMAC2: "x86_64-apple-macosx10.11.2"
160
161// RUN: %clang -target arm64-apple-ios11.1 -c %s -### 2>&1 | \
162// RUN: FileCheck --check-prefix=CHECK-VERSION-TIOS1 %s
163// CHECK-VERSION-TIOS1: "arm64-apple-ios11.1.0"
164
165// RUN: %clang -target arm64-apple-tvos10.3 -c %s -### 2>&1 | \
166// RUN: FileCheck --check-prefix=CHECK-VERSION-TTVOS1 %s
167// CHECK-VERSION-TTVOS1: "arm64-apple-tvos10.3.0"
168
169// RUN: %clang -target armv7k-apple-watchos4.1 -c %s -### 2>&1 | \
170// RUN: FileCheck --check-prefix=CHECK-VERSION-TWATCHOS1 %s
171// CHECK-VERSION-TWATCHOS1: "thumbv7k-apple-watchos4.1.0"
172
173// "darwin" always back to the -m<os>version-min and environment:
174
175// RUN: %clang -target x86_64-apple-darwin14 -c %s -### 2>&1 | \
176// RUN: FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL1 %s
177// CHECK-VERSION-TDARWIN-FALL1: "x86_64-apple-macosx10.10.0"
178
179// RUN: %clang -target x86_64-apple-darwin14 -miphoneos-version-min=10.1 -c %s -### 2>&1 | \
180// RUN: FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL2 %s
181// CHECK-VERSION-TDARWIN-FALL2: "x86_64-apple-ios10.1.0-simulator"
182
183// RUN: env IPHONEOS_DEPLOYMENT_TARGET=9.1 \
184// RUN: %clang -target arm64-apple-darwin14 -c %s -### 2>&1 | \
185// RUN: FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL3 %s
186// CHECK-VERSION-TDARWIN-FALL3: "arm64-apple-ios9.1.0"
187
188// RUN: %clang -target arm64-apple-darwin14 -isysroot SDKs/iPhoneOS11.0.sdk -c %s -### 2>&1 | \
189// RUN: FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL4 %s
190// CHECK-VERSION-TDARWIN-FALL4: "arm64-apple-ios11.0.0"
191
192// RUN: %clang -target unknown-apple-darwin12 -arch armv7 -c %s -### 2>&1 | \
193// RUN: FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL5 %s
194// CHECK-VERSION-TDARWIN-FALL5: "thumbv7-apple-ios5.0.0"
195
196// Warn about -m<os>-version-min when it's used with target:
197
198// RUN: %clang -target x86_64-apple-macos10.11.2 -mmacos-version-min=10.6 -c %s -### 2>&1 | \
199// RUN: FileCheck --check-prefix=CHECK-VERSION-TNO-OSV1 %s
Alex Lorenzcdb52402017-12-20 02:31:30 +0000200// CHECK-VERSION-TNO-OSV1: overriding '-mmacosx-version-min=10.6' option with '--target=x86_64-apple-macos10.11.2'
Alex Lorenz1acc63f2017-12-19 19:05:04 +0000201
202// RUN: %clang -target x86_64-apple-macos -miphoneos-version-min=9.1 -c %s -### 2>&1 | \
203// RUN: FileCheck --check-prefix=CHECK-VERSION-TNO-OSV2 %s
Alex Lorenzcdb52402017-12-20 02:31:30 +0000204// CHECK-VERSION-TNO-OSV2: overriding '-miphoneos-version-min=9.1' option with '--target=x86_64-apple-macos'
205
206// RUN: %clang -target x86_64-apple-ios -miphonesimulator-version-min=10.0 -c %s -### 2>&1 | \
207// RUN: FileCheck --check-prefix=CHECK-VERSION-TNO-OSV3 %s
Alex Lorenz78df5da2017-12-29 17:42:40 +0000208// CHECK-VERSION-TNO-OSV3: "x86_64-apple-ios10.0.0-simulator"
209// CHECK-VERSION-TNO-OSV3-NOT: overriding '-mios-simulator-version-min
Alex Lorenzcdb52402017-12-20 02:31:30 +0000210// CHECK-VERSION-TNO-OSV3-NOT: argument unused during compilation
211
212// RUN: %clang -target arm64-apple-ios10.1.0 -miphoneos-version-min=10.1.0.1 -c %s -### 2>&1 | \
213// RUN: FileCheck --check-prefix=CHECK-VERSION-TNO-OSV4 %s
214// CHECK-VERSION-TNO-OSV4: overriding '-miphoneos-version-min=10.1.0.1' option with '--target=arm64-apple-ios10.1.0'
215
216// RUN: %clang -target x86_64-apple-macos10.6 -mmacos-version-min=10.6 -c %s -### 2>&1 | \
217// RUN: FileCheck --check-prefix=CHECK-VERSION-TNO-SAME %s
218// CHECK-VERSION-TNO-SAME-NOT: overriding
219// CHECK-VERSION-TNO-SAME-NOT: argument unused during compilation
Alex Lorenz1acc63f2017-12-19 19:05:04 +0000220
Alexander Kornienko2a8c18d2018-04-06 15:14:32 +0000221// Target with OS version is not overridden by -m<os>-version-min variables:
Alex Lorenz1acc63f2017-12-19 19:05:04 +0000222
223// RUN: %clang -target x86_64-apple-macos10.11.2 -mmacos-version-min=10.6 -c %s -### 2>&1 | \
224// RUN: FileCheck --check-prefix=CHECK-VERSION-TIGNORE-OSV1 %s
225// CHECK-VERSION-TIGNORE-OSV1: "x86_64-apple-macosx10.11.2"
226
227// RUN: %clang -target arm64-apple-ios11.0 -mios-version-min=9.0 -c %s -### 2>&1 | \
228// RUN: FileCheck --check-prefix=CHECK-VERSION-TIGNORE-OSV2 %s
229// CHECK-VERSION-TIGNORE-OSV2: "arm64-apple-ios11.0.0"
230
231// RUN: %clang -target arm64-apple-tvos11.0 -mtvos-version-min=9.0 -c %s -### 2>&1 | \
232// RUN: FileCheck --check-prefix=CHECK-VERSION-TIGNORE-OSV3 %s
233// CHECK-VERSION-TIGNORE-OSV3: "arm64-apple-tvos11.0.0"
234
235// RUN: %clang -target armv7k-apple-watchos3 -mwatchos-version-min=4 -c %s -### 2>&1 | \
236// RUN: FileCheck --check-prefix=CHECK-VERSION-TIGNORE-OSV4 %s
237// CHECK-VERSION-TIGNORE-OSV4: "thumbv7k-apple-watchos3.0.0"
238
Alexander Kornienko2a8c18d2018-04-06 15:14:32 +0000239// Target without OS version includes the OS given by -m<os>-version-min arguments:
Alex Lorenz78df5da2017-12-29 17:42:40 +0000240
241// RUN: %clang -target x86_64-apple-macos -mmacos-version-min=10.11 -c %s -### 2>&1 | \
242// RUN: FileCheck --check-prefix=CHECK-VERSION-USE-OS-ARG1 %s
243// CHECK-VERSION-USE-OS-ARG1: "x86_64-apple-macosx10.11.0"
244
245// RUN: %clang -target arm64-apple-ios -mios-version-min=9.0 -c %s -### 2>&1 | \
246// RUN: FileCheck --check-prefix=CHECK-VERSION-USE-OS-ARG2 %s
247// CHECK-VERSION-USE-OS-ARG2: "arm64-apple-ios9.0.0"
248
249// RUN: %clang -target arm64-apple-tvos -mtvos-version-min=10.0 -c %s -### 2>&1 | \
250// RUN: FileCheck --check-prefix=CHECK-VERSION-USE-OS-ARG3 %s
251// CHECK-VERSION-USE-OS-ARG3: "arm64-apple-tvos10.0.0"
252
253// RUN: %clang -target armv7k-apple-watchos -mwatchos-version-min=4 -c %s -### 2>&1 | \
254// RUN: FileCheck --check-prefix=CHECK-VERSION-USE-OS-ARG4 %s
255// CHECK-VERSION-USE-OS-ARG4: "thumbv7k-apple-watchos4.0.0"
256
Alexander Kornienko2a8c18d2018-04-06 15:14:32 +0000257// Target with OS version is not overridden by environment variables:
Alex Lorenz1acc63f2017-12-19 19:05:04 +0000258
259// RUN: env MACOSX_DEPLOYMENT_TARGET=10.1 \
260// RUN: %clang -target i386-apple-macos10.5 -c %s -### 2>&1 | \
261// RUN: FileCheck --check-prefix=CHECK-VERSION-TMACOS-CMD %s
262// CHECK-VERSION-TMACOS-CMD: "i386-apple-macosx10.5.0"
263
264// RUN: env IPHONEOS_DEPLOYMENT_TARGET=10.1 \
265// RUN: %clang -target arm64-apple-ios11 -c %s -### 2>&1 | \
266// RUN: FileCheck --check-prefix=CHECK-VERSION-TIOS-CMD %s
267// CHECK-VERSION-TIOS-CMD: "arm64-apple-ios11.0.0"
268
269// RUN: env TVOS_DEPLOYMENT_TARGET=8.3.1 \
270// RUN: %clang -target arm64-apple-tvos9 -c %s -### 2>&1 | \
271// RUN: FileCheck --check-prefix=CHECK-VERSION-TTVOS-CMD %s
272// CHECK-VERSION-TTVOS-CMD: "arm64-apple-tvos9.0.0"
273
274// RUN: env WATCHOS_DEPLOYMENT_TARGET=2 \
275// RUN: %clang -target armv7k-apple-watchos3 -c %s -### 2>&1 | \
276// RUN: FileCheck --check-prefix=CHECK-VERSION-TWATCHOS-CMD %s
277// CHECK-VERSION-TWATCHOS-CMD: "thumbv7k-apple-watchos3.0.0"
278
Alexander Kornienko2a8c18d2018-04-06 15:14:32 +0000279// Target with OS version is not overridden by the SDK:
Alex Lorenz1acc63f2017-12-19 19:05:04 +0000280
281// RUN: %clang -target armv7-apple-ios9 -Wno-missing-sysroot -isysroot SDKs/iPhoneOS11.0.sdk -c -### %s 2>&1 | \
282// RUN: FileCheck --check-prefix=CHECK-VERSION-TIOS-SDK %s
283// CHECK-VERSION-TIOS-SDK: thumbv7-apple-ios9
284
285// RUN: %clang -target armv7k-apple-watchos4 -Wno-missing-sysroot -isysroot SDKs/WatchOS3.0.sdk -c -### %s 2>&1 | \
286// RUN: FileCheck --check-prefix=CHECK-VERSION-TWATCHOS-SDK %s
287// CHECK-VERSION-TWATCHOS-SDK: thumbv7k-apple-watchos4
288
289// RUN: %clang -target armv7-apple-tvos9 -Wno-missing-sysroot -isysroot SDKs/AppleTVOS11.0.sdk -c -### %s 2>&1 | \
290// RUN: FileCheck --check-prefix=CHECK-VERSION-TTVOS-SDK %s
291// CHECK-VERSION-TTVOS-SDK: thumbv7-apple-tvos9
292
Alexander Kornienko2a8c18d2018-04-06 15:14:32 +0000293// Target with OS version is not overridden by arch:
Alex Lorenz1acc63f2017-12-19 19:05:04 +0000294
295// RUN: %clang -target uknown-apple-macos10.11.2 -arch=armv7k -c %s -### 2>&1 | \
296// RUN: FileCheck --check-prefix=CHECK-VERSION-TIGNORE-ARCH1 %s
297// CHECK-VERSION-TIGNORE-ARCH1: "unknown-apple-macosx10.11.2"
Alex Lorenz91f9cfc2017-12-19 19:56:14 +0000298
299// Target can be used to specify the environment:
300
301// RUN: %clang -target x86_64-apple-ios11-simulator -c %s -### 2>&1 | \
302// RUN: FileCheck --check-prefix=CHECK-VERSION-TENV-SIM1 %s
303// CHECK-VERSION-TENV-SIM1: "x86_64-apple-ios11.0.0-simulator"
304
305// RUN: %clang -target armv7k-apple-ios10.1-simulator -c %s -### 2>&1 | \
306// RUN: FileCheck --check-prefix=CHECK-VERSION-TENV-SIM2 %s
307// CHECK-VERSION-TENV-SIM2: "thumbv7k-apple-ios10.1.0-simulator"