1*f4a2713aSLionel Sambuc // Check that SDKROOT is used to define the default for -isysroot on Darwin. 2*f4a2713aSLionel Sambuc // 3*f4a2713aSLionel Sambuc // RUN: rm -rf %t.tmpdir 4*f4a2713aSLionel Sambuc // RUN: mkdir -p %t.tmpdir 5*f4a2713aSLionel Sambuc // RUN: env SDKROOT=%t.tmpdir %clang -target x86_64-apple-darwin10 \ 6*f4a2713aSLionel Sambuc // RUN: -c %s -### 2> %t.log 7*f4a2713aSLionel Sambuc // RUN: FileCheck --check-prefix=CHECK-BASIC < %t.log %s 8*f4a2713aSLionel Sambuc // 9*f4a2713aSLionel Sambuc // CHECK-BASIC: clang 10*f4a2713aSLionel Sambuc // CHECK-BASIC: "-cc1" 11*f4a2713aSLionel Sambuc // CHECK-BASIC: "-isysroot" "{{.*tmpdir}}" 12*f4a2713aSLionel Sambuc 13*f4a2713aSLionel Sambuc // Check that we don't use SDKROOT as the default if it is not a valid path. 14*f4a2713aSLionel Sambuc // 15*f4a2713aSLionel Sambuc // RUN: rm -rf %t.nonpath 16*f4a2713aSLionel Sambuc // RUN: env SDKROOT=%t.nonpath %clang -target x86_64-apple-darwin10 \ 17*f4a2713aSLionel Sambuc // RUN: -c %s -### 2> %t.log 18*f4a2713aSLionel Sambuc // RUN: FileCheck --check-prefix=CHECK-NONPATH < %t.log %s 19*f4a2713aSLionel Sambuc // 20*f4a2713aSLionel Sambuc // CHECK-NONPATH: clang 21*f4a2713aSLionel Sambuc // CHECK-NONPATH: "-cc1" 22*f4a2713aSLionel Sambuc // CHECK-NONPATH-NOT: "-isysroot" 23*f4a2713aSLionel Sambuc 24*f4a2713aSLionel Sambuc // Check that we don't use SDKROOT as the default if it is just "/" 25*f4a2713aSLionel Sambuc // 26*f4a2713aSLionel Sambuc // RUN: env SDKROOT=/ %clang -target x86_64-apple-darwin10 \ 27*f4a2713aSLionel Sambuc // RUN: -c %s -### 2> %t.log 28*f4a2713aSLionel Sambuc // RUN: FileCheck --check-prefix=CHECK-NONROOT < %t.log %s 29*f4a2713aSLionel Sambuc // 30*f4a2713aSLionel Sambuc // CHECK-NONROOT: clang 31*f4a2713aSLionel Sambuc // CHECK-NONROOT: "-cc1" 32*f4a2713aSLionel Sambuc // CHECK-NONROOT-NOT: "-isysroot" 33*f4a2713aSLionel Sambuc // 34*f4a2713aSLionel Sambuc // It doesn't make sense on msys bash. 35*f4a2713aSLionel Sambuc // REQUIRES: shell-preserves-root 36