Daniel Dunbar | 455a049 | 2012-08-17 18:43:50 +0000 | [diff] [blame] | 1 | // Check that SDKROOT is used to define the default for -isysroot on Darwin. |
| 2 | // |
| 3 | // RUN: rm -rf %t.tmpdir |
| 4 | // RUN: mkdir -p %t.tmpdir |
| 5 | // RUN: env SDKROOT=%t.tmpdir %clang -target x86_64-apple-darwin10 \ |
| 6 | // RUN: -c %s -### 2> %t.log |
| 7 | // RUN: FileCheck --check-prefix=CHECK-BASIC < %t.log %s |
| 8 | // |
| 9 | // CHECK-BASIC: clang |
| 10 | // CHECK-BASIC: "-cc1" |
| 11 | // CHECK-BASIC: "-isysroot" "{{.*tmpdir}}" |
| 12 | |
| 13 | // Check that we don't use SDKROOT as the default if it is not a valid path. |
Daniel Dunbar | b254304 | 2013-01-15 20:33:56 +0000 | [diff] [blame^] | 14 | // |
Daniel Dunbar | 455a049 | 2012-08-17 18:43:50 +0000 | [diff] [blame] | 15 | // RUN: rm -rf %t.nonpath |
| 16 | // RUN: env SDKROOT=%t.nonpath %clang -target x86_64-apple-darwin10 \ |
| 17 | // RUN: -c %s -### 2> %t.log |
| 18 | // RUN: FileCheck --check-prefix=CHECK-NONPATH < %t.log %s |
| 19 | // |
| 20 | // CHECK-NONPATH: clang |
| 21 | // CHECK-NONPATH: "-cc1" |
| 22 | // CHECK-NONPATH-NOT: "-isysroot" |
Daniel Dunbar | b254304 | 2013-01-15 20:33:56 +0000 | [diff] [blame^] | 23 | |
| 24 | // Check that we don't use SDKROOT as the default if it is just "/" |
| 25 | // |
| 26 | // RUN: env SDKROOT=/ %clang -target x86_64-apple-darwin10 \ |
| 27 | // RUN: -c %s -### 2> %t.log |
| 28 | // RUN: FileCheck --check-prefix=CHECK-NONROOT < %t.log %s |
| 29 | // |
| 30 | // CHECK-NONROOT: clang |
| 31 | // CHECK-NONROOT: "-cc1" |
| 32 | // CHECK-NONROOT-NOT: "-isysroot" |