1 // Check that SDKROOT does not infer simulator on when it points to a regular
3 // REQUIRES: system-darwin && native
5 // RUN: rm -rf %t/SDKs/iPhoneOS8.0.0.sdk
6 // RUN: mkdir -p %t/SDKs/iPhoneOS8.0.0.sdk
7 // RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang -fuse-ld= %s -mlinker-version=400 -### 2>&1 \
8 // RUN: | FileCheck --check-prefix=CHECK-IPHONE %s
9 // RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk IPHONEOS_DEPLOYMENT_TARGET=8.0 %clang -fuse-ld= %s -mlinker-version=400 -### 2>&1 \
10 // RUN: | FileCheck --check-prefix=CHECK-IPHONE %s
11 // CHECK-IPHONE: clang
12 // CHECK-IPHONE: "-cc1"
13 // CHECK-IPHONE: -apple-ios8.0.0"
15 // CHECK-IPHONE: "-iphoneos_version_min" "8.0.0"
18 // RUN: rm -rf %t/SDKs/iPhoneSimulator8.0.sdk
19 // RUN: mkdir -p %t/SDKs/iPhoneSimulator8.0.sdk
20 // RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -fuse-ld= -arch x86_64 %s -mlinker-version=400 -### 2>&1 \
21 // RUN: | FileCheck --check-prefix=CHECK-SIMULATOR %s
23 // CHECK-SIMULATOR: clang
24 // CHECK-SIMULATOR: "-cc1"
25 // CHECK-SIMULATOR: -apple-ios8.0.0-simulator"
26 // CHECK-SIMULATOR: ld
27 // CHECK-SIMULATOR: "-ios_simulator_version_min" "8.0.0"
30 // RUN: rm -rf %t/SDKs/iPhoneSimulator14.0.sdk
31 // RUN: mkdir -p %t/SDKs/iPhoneSimulator14.0.sdk
32 // RUN: env SDKROOT=%t/SDKs/iPhoneSimulator14.0.sdk %clang -fuse-ld= -arch arm64 %s -mlinker-version=400 -### 2>&1 \
33 // RUN: | FileCheck --check-prefix=CHECK-SIMULATOR-ARM64 %s
35 // CHECK-SIMULATOR-ARM64: clang
36 // CHECK-SIMULATOR-ARM64: "-cc1"
37 // CHECK-SIMULATOR-ARM64: -apple-ios14.0.0-simulator"
38 // CHECK-SIMULATOR-ARM64: ld
39 // CHECK-SIMULATOR-ARM64: "-ios_simulator_version_min" "14.0.0"
42 // RUN: rm -rf %t/SDKs/WatchOS3.0.sdk
43 // RUN: mkdir -p %t/SDKs/WatchOS3.0.sdk
44 // RUN: env SDKROOT=%t/SDKs/WatchOS3.0.sdk %clang %s -fuse-ld= -mlinker-version=400 -### 2>&1 \
45 // RUN: | FileCheck --check-prefix=CHECK-WATCH %s
46 // RUN: env WATCHOS_DEPLOYMENT_TARGET=3.0 %clang %s -fuse-ld= -isysroot %t/SDKs/WatchOS3.0.sdk -mlinker-version=400 -### 2>&1 \
47 // RUN: | FileCheck --check-prefix=CHECK-WATCH %s
50 // CHECK-WATCH: "-cc1"
51 // CHECK-WATCH: -apple-watchos3.0.0"
53 // CHECK-WATCH: "-watchos_version_min" "3.0.0"
56 // RUN: rm -rf %t/SDKs/WatchSimulator3.0.sdk
57 // RUN: mkdir -p %t/SDKs/WatchSimulator3.0.sdk
58 // RUN: env SDKROOT=%t/SDKs/WatchSimulator3.0.sdk %clang -fuse-ld= -arch x86_64 %s -mlinker-version=400 -### 2>&1 \
59 // RUN: | FileCheck --check-prefix=CHECK-WATCH-SIMULATOR %s
61 // CHECK-WATCH-SIMULATOR: clang
62 // CHECK-WATCH-SIMULATOR: "-cc1"
63 // CHECK-WATCH-SIMULATOR: -apple-watchos3.0.0-simulator"
64 // CHECK-WATCH-SIMULATOR: ld
65 // CHECK-WATCH-SIMULATOR: "-watchos_simulator_version_min" "3.0.0"
68 // RUN: rm -rf %t/SDKs/WatchSimulator7.0.sdk
69 // RUN: mkdir -p %t/SDKs/WatchSimulator7.0.sdk
70 // RUN: env SDKROOT=%t/SDKs/WatchSimulator7.0.sdk %clang -fuse-ld= -arch arm64 %s -mlinker-version=400 -### 2>&1 \
71 // RUN: | FileCheck --check-prefix=CHECK-WATCH-SIMULATOR-ARM64 %s
73 // CHECK-WATCH-SIMULATOR-ARM64: clang
74 // CHECK-WATCH-SIMULATOR-ARM64: "-cc1"
75 // CHECK-WATCH-SIMULATOR-ARM64: -apple-watchos7.0.0-simulator"
76 // CHECK-WATCH-SIMULATOR-ARM64: ld
77 // CHECK-WATCH-SIMULATOR-ARM64: "-watchos_simulator_version_min" "7.0.0"
80 // RUN: rm -rf %t/SDKs/AppleTVOS10.0.sdk
81 // RUN: mkdir -p %t/SDKs/AppleTVOS10.0.sdk
82 // RUN: env SDKROOT=%t/SDKs/AppleTVOS10.0.sdk %clang %s -fuse-ld= -mlinker-version=400 -### 2>&1 \
83 // RUN: | FileCheck --check-prefix=CHECK-TV %s
87 // CHECK-TV: -apple-tvos10.0.0"
89 // CHECK-TV: "-tvos_version_min" "10.0.0"
92 // RUN: rm -rf %t/SDKs/AppleTVSimulator10.0.sdk
93 // RUN: mkdir -p %t/SDKs/AppleTVSimulator10.0.sdk
94 // RUN: env SDKROOT=%t/SDKs/AppleTVSimulator10.0.sdk %clang -fuse-ld= -arch x86_64 %s -mlinker-version=400 -### 2>&1 \
95 // RUN: | FileCheck --check-prefix=CHECK-TV-SIMULATOR %s
97 // CHECK-TV-SIMULATOR: clang
98 // CHECK-TV-SIMULATOR: "-cc1"
99 // CHECK-TV-SIMULATOR: -apple-tvos10.0.0-simulator"
100 // CHECK-TV-SIMULATOR: ld
101 // CHECK-TV-SIMULATOR: "-tvos_simulator_version_min" "10.0.0"
104 // RUN: rm -rf %t/SDKs/AppleTVSimulator14.0.sdk
105 // RUN: mkdir -p %t/SDKs/AppleTVSimulator14.0.sdk
106 // RUN: env SDKROOT=%t/SDKs/AppleTVSimulator14.0.sdk %clang -fuse-ld= -arch arm64 %s -mlinker-version=400 -### 2>&1 \
107 // RUN: | FileCheck --check-prefix=CHECK-TV-SIMULATOR-ARM64 %s
109 // CHECK-TV-SIMULATOR-ARM64: clang
110 // CHECK-TV-SIMULATOR-ARM64: "-cc1"
111 // CHECK-TV-SIMULATOR-ARM64: -apple-tvos14.0.0-simulator"
112 // CHECK-TV-SIMULATOR-ARM64: ld
113 // CHECK-TV-SIMULATOR-ARM64: "-tvos_simulator_version_min" "14.0.0"