2012-08-18 02:43:50 +08:00
|
|
|
// Check that SDKROOT is used to define the default for -isysroot on Darwin.
|
|
|
|
//
|
|
|
|
// RUN: rm -rf %t.tmpdir
|
|
|
|
// RUN: mkdir -p %t.tmpdir
|
2019-09-28 20:21:06 +08:00
|
|
|
// RUN: env SDKROOT=%t.tmpdir %clang -target x86_64-apple-darwin10 --sysroot="" \
|
2012-08-18 02:43:50 +08:00
|
|
|
// RUN: -c %s -### 2> %t.log
|
|
|
|
// RUN: FileCheck --check-prefix=CHECK-BASIC < %t.log %s
|
|
|
|
//
|
|
|
|
// CHECK-BASIC: clang
|
|
|
|
// CHECK-BASIC: "-cc1"
|
|
|
|
// CHECK-BASIC: "-isysroot" "{{.*tmpdir}}"
|
|
|
|
|
|
|
|
// Check that we don't use SDKROOT as the default if it is not a valid path.
|
2013-01-16 04:33:56 +08:00
|
|
|
//
|
2012-08-18 02:43:50 +08:00
|
|
|
// RUN: rm -rf %t.nonpath
|
2019-09-28 20:21:06 +08:00
|
|
|
// RUN: env SDKROOT=%t.nonpath %clang -target x86_64-apple-darwin10 --sysroot="" \
|
2012-08-18 02:43:50 +08:00
|
|
|
// RUN: -c %s -### 2> %t.log
|
|
|
|
// RUN: FileCheck --check-prefix=CHECK-NONPATH < %t.log %s
|
|
|
|
//
|
|
|
|
// CHECK-NONPATH: clang
|
|
|
|
// CHECK-NONPATH: "-cc1"
|
|
|
|
// CHECK-NONPATH-NOT: "-isysroot"
|
2013-01-16 04:33:56 +08:00
|
|
|
|
|
|
|
// Check that we don't use SDKROOT as the default if it is just "/"
|
|
|
|
//
|
2019-09-28 20:21:06 +08:00
|
|
|
// RUN: env SDKROOT=/ %clang -target x86_64-apple-darwin10 --sysroot="" \
|
2013-01-16 04:33:56 +08:00
|
|
|
// RUN: -c %s -### 2> %t.log
|
|
|
|
// RUN: FileCheck --check-prefix=CHECK-NONROOT < %t.log %s
|
|
|
|
//
|
|
|
|
// CHECK-NONROOT: clang
|
|
|
|
// CHECK-NONROOT: "-cc1"
|
|
|
|
// CHECK-NONROOT-NOT: "-isysroot"
|
2013-01-16 14:10:16 +08:00
|
|
|
//
|
2015-07-15 17:41:04 +08:00
|
|
|
// This test fails with MSYS or MSYS2 env.exe, since it does not preserve
|
|
|
|
// root, expanding / into C:/MINGW/MSYS/1.0 or c:/msys64. To reproduce the
|
|
|
|
// problem, run:
|
2014-11-04 22:54:37 +08:00
|
|
|
//
|
2014-08-10 05:24:04 +08:00
|
|
|
// env SDKROOT=/ cmd //c echo %SDKROOT%
|
2014-11-04 22:54:37 +08:00
|
|
|
//
|
2015-07-15 17:41:04 +08:00
|
|
|
// This test do pass using GnuWin32 env.exe.
|
2015-06-25 09:59:35 +08:00
|
|
|
|
|
|
|
// Check if clang set the correct deployment target from -sysroot
|
|
|
|
//
|
|
|
|
// RUN: rm -rf %t/SDKs/iPhoneOS8.0.0.sdk
|
|
|
|
// RUN: mkdir -p %t/SDKs/iPhoneOS8.0.0.sdk
|
2019-09-28 20:21:06 +08:00
|
|
|
// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang -target arm64-apple-darwin --sysroot="" %s -### 2>&1 \
|
2015-06-25 09:59:35 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-IPHONE %s
|
|
|
|
//
|
|
|
|
// CHECK-IPHONE: clang
|
|
|
|
// CHECK-IPHONE: "-cc1"
|
|
|
|
// CHECK-IPHONE: "-triple" "arm64-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
|
2019-09-28 20:21:06 +08:00
|
|
|
// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -target x86_64-apple-darwin --sysroot="" %s -### 2>&1 \
|
2015-06-25 09:59:35 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-SIMULATOR %s
|
|
|
|
//
|
|
|
|
// CHECK-SIMULATOR: clang
|
|
|
|
// CHECK-SIMULATOR: "-cc1"
|
2017-12-08 03:04:10 +08:00
|
|
|
// CHECK-SIMULATOR: "-triple" "x86_64-apple-ios8.0.0-simulator"
|
2015-06-25 09:59:35 +08:00
|
|
|
// CHECK-SIMULATOR: ld
|
|
|
|
// CHECK-SIMULATOR: "-ios_simulator_version_min" "8.0.0"
|
|
|
|
//
|
|
|
|
// RUN: rm -rf %t/SDKs/MacOSX10.10.0.sdk
|
|
|
|
// RUN: mkdir -p %t/SDKs/MacOSX10.10.0.sdk
|
2019-09-28 20:21:06 +08:00
|
|
|
// RUN: env SDKROOT=%t/SDKs/MacOSX10.10.0.sdk %clang -target x86_64-apple-darwin --sysroot="" %s -### 2>&1 \
|
2015-06-25 09:59:35 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MACOSX %s
|
|
|
|
//
|
|
|
|
// CHECK-MACOSX: clang
|
|
|
|
// CHECK-MACOSX: "-cc1"
|
|
|
|
// CHECK-MACOSX: "-triple" "x86_64-apple-macosx10.10.0"
|
|
|
|
// CHECK-MACOSX: ld
|
|
|
|
// CHECK-MACOSX: "-macosx_version_min" "10.10.0"
|