Split test/Driver/darwin-sdkroot.c into two tests

The test additions in r329110 are Darwin-specific, as they rely
on a code path that is reachabled when driver is invoked without
-target. Instead of making the old test checks Darwin-specific too,
let's simply split it into two files to ensure that the old
checks are still platform-agnostic. Thanks Chandler for
suggesting this!

llvm-svn: 329141
This commit is contained in:
Alex Lorenz 2018-04-04 02:11:20 +00:00
parent b324733169
commit 8427e94b54
2 changed files with 73 additions and 56 deletions

View File

@ -0,0 +1,73 @@
// Check that SDKROOT does not infer simulator on when it points to a regular
// SDK.
// REQUIRES: system-darwin
//
// RUN: rm -rf %t/SDKs/iPhoneOS8.0.0.sdk
// RUN: mkdir -p %t/SDKs/iPhoneOS8.0.0.sdk
// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-IPHONE %s
// CHECK-IPHONE: clang
// CHECK-IPHONE: "-cc1"
// CHECK-IPHONE: -apple-ios8.0.0"
// CHECK-IPHONE: ld
// CHECK-IPHONE: "-iphoneos_version_min" "8.0.0"
//
//
// RUN: rm -rf %t/SDKs/iPhoneSimulator8.0.sdk
// RUN: mkdir -p %t/SDKs/iPhoneSimulator8.0.sdk
// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SIMULATOR %s
//
// CHECK-SIMULATOR: clang
// CHECK-SIMULATOR: "-cc1"
// CHECK-SIMULATOR: -apple-ios8.0.0-simulator"
// CHECK-SIMULATOR: ld
// CHECK-SIMULATOR: "-ios_simulator_version_min" "8.0.0"
//
//
// RUN: rm -rf %t/SDKs/WatchOS3.0.sdk
// RUN: mkdir -p %t/SDKs/WatchOS3.0.sdk
// RUN: env SDKROOT=%t/SDKs/WatchOS3.0.sdk %clang %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WATCH %s
//
// CHECK-WATCH: clang
// CHECK-WATCH: "-cc1"
// CHECK-WATCH: -apple-watchos3.0.0"
// CHECK-WATCH: ld
// CHECK-WATCH: "-watchos_version_min" "3.0.0"
//
//
// RUN: rm -rf %t/SDKs/WatchSimulator3.0.sdk
// RUN: mkdir -p %t/SDKs/WatchSimulator3.0.sdk
// RUN: env SDKROOT=%t/SDKs/WatchSimulator3.0.sdk %clang %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WATCH-SIMULATOR %s
//
// CHECK-WATCH-SIMULATOR: clang
// CHECK-WATCH-SIMULATOR: "-cc1"
// CHECK-WATCH-SIMULATOR: -apple-watchos3.0.0-simulator"
// CHECK-WATCH-SIMULATOR: ld
// CHECK-WATCH-SIMULATOR: "-watchos_simulator_version_min" "3.0.0"
//
//
// RUN: rm -rf %t/SDKs/AppleTVOS10.0.sdk
// RUN: mkdir -p %t/SDKs/AppleTVOS10.0.sdk
// RUN: env SDKROOT=%t/SDKs/AppleTVOS10.0.sdk %clang %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-TV %s
//
// CHECK-TV: clang
// CHECK-TV: "-cc1"
// CHECK-TV: -apple-tvos10.0.0"
// CHECK-TV: ld
// CHECK-TV: "-tvos_version_min" "10.0.0"
//
//
// RUN: rm -rf %t/SDKs/AppleTVSimulator10.0.sdk
// RUN: mkdir -p %t/SDKs/AppleTVSimulator10.0.sdk
// RUN: env SDKROOT=%t/SDKs/AppleTVSimulator10.0.sdk %clang %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-TV-SIMULATOR %s
//
// CHECK-TV-SIMULATOR: clang
// CHECK-TV-SIMULATOR: "-cc1"
// CHECK-TV-SIMULATOR: -apple-tvos10.0.0-simulator"
// CHECK-TV-SIMULATOR: ld
// CHECK-TV-SIMULATOR: "-tvos_simulator_version_min" "10.0.0"

View File

@ -1,5 +1,4 @@
// Check that SDKROOT is used to define the default for -isysroot on Darwin.
// REQUIRES: system-darwin
//
// RUN: rm -rf %t.tmpdir
// RUN: mkdir -p %t.tmpdir
@ -52,21 +51,12 @@
// CHECK-IPHONE: "-triple" "arm64-apple-ios8.0.0"
// CHECK-IPHONE: ld
// CHECK-IPHONE: "-iphoneos_version_min" "8.0.0"
// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-IPHONE-X86 %s
// CHECK-IPHONE-X86: clang
// CHECK-IPHONE-X86: "-cc1"
// CHECK-IPHONE-X86: -apple-ios8.0.0"
// CHECK-IPHONE-X86: ld
// CHECK-IPHONE-X86: "-iphoneos_version_min" "8.0.0"
//
//
// RUN: rm -rf %t/SDKs/iPhoneSimulator8.0.sdk
// RUN: mkdir -p %t/SDKs/iPhoneSimulator8.0.sdk
// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -target x86_64-apple-darwin %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SIMULATOR %s
// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -arch x86_64 %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-SIMULATOR %s
//
// CHECK-SIMULATOR: clang
// CHECK-SIMULATOR: "-cc1"
@ -84,49 +74,3 @@
// CHECK-MACOSX: "-triple" "x86_64-apple-macosx10.10.0"
// CHECK-MACOSX: ld
// CHECK-MACOSX: "-macosx_version_min" "10.10.0"
// RUN: rm -rf %t/SDKs/WatchOS3.0.sdk
// RUN: mkdir -p %t/SDKs/WatchOS3.0.sdk
// RUN: env SDKROOT=%t/SDKs/WatchOS3.0.sdk %clang %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WATCH %s
//
// CHECK-WATCH: clang
// CHECK-WATCH: "-cc1"
// CHECK-WATCH: -apple-watchos3.0.0"
// CHECK-WATCH: ld
// CHECK-WATCH: "-watchos_version_min" "3.0.0"
//
//
// RUN: rm -rf %t/SDKs/WatchSimulator3.0.sdk
// RUN: mkdir -p %t/SDKs/WatchSimulator3.0.sdk
// RUN: env SDKROOT=%t/SDKs/WatchSimulator3.0.sdk %clang %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-WATCH-SIMULATOR %s
//
// CHECK-WATCH-SIMULATOR: clang
// CHECK-WATCH-SIMULATOR: "-cc1"
// CHECK-WATCH-SIMULATOR: -apple-watchos3.0.0-simulator"
// CHECK-WATCH-SIMULATOR: ld
// CHECK-WATCH-SIMULATOR: "-watchos_simulator_version_min" "3.0.0"
// RUN: rm -rf %t/SDKs/AppleTVOS10.0.sdk
// RUN: mkdir -p %t/SDKs/AppleTVOS10.0.sdk
// RUN: env SDKROOT=%t/SDKs/AppleTVOS10.0.sdk %clang %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-TV %s
//
// CHECK-TV: clang
// CHECK-TV: "-cc1"
// CHECK-TV: -apple-tvos10.0.0"
// CHECK-TV: ld
// CHECK-TV: "-tvos_version_min" "10.0.0"
//
//
// RUN: rm -rf %t/SDKs/AppleTVSimulator10.0.sdk
// RUN: mkdir -p %t/SDKs/AppleTVSimulator10.0.sdk
// RUN: env SDKROOT=%t/SDKs/AppleTVSimulator10.0.sdk %clang %s -### 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-TV-SIMULATOR %s
//
// CHECK-TV-SIMULATOR: clang
// CHECK-TV-SIMULATOR: "-cc1"
// CHECK-TV-SIMULATOR: -apple-tvos10.0.0-simulator"
// CHECK-TV-SIMULATOR: ld
// CHECK-TV-SIMULATOR: "-tvos_simulator_version_min" "10.0.0"