Reid Kleckner | 8ea89ea | 2017-05-31 20:42:43 +0000 | [diff] [blame] | 1 | // Note: %s must be preceded by --, otherwise it may be interpreted as a |
| 2 | // command-line option, e.g. on Mac where %s is commonly under /Users. |
| 3 | |
| 4 | // RUN: %clang_cl -### -- %s 2>&1 | FileCheck %s --check-prefix=BUILTIN |
Alexander Kornienko | c7a0b67 | 2017-06-01 11:41:21 +0000 | [diff] [blame] | 5 | // BUILTIN: "-internal-isystem" "{{.*lib.*clang.*include}}" |
Reid Kleckner | 8ea89ea | 2017-05-31 20:42:43 +0000 | [diff] [blame] | 6 | |
| 7 | // RUN: %clang_cl -nobuiltininc -### -- %s 2>&1 | FileCheck %s --check-prefix=NOBUILTIN |
Alexander Kornienko | c7a0b67 | 2017-06-01 11:41:21 +0000 | [diff] [blame] | 8 | // NOBUILTIN-NOT: "-internal-isystem" "{{.*lib.*clang.*include}}" |
Reid Kleckner | 8ea89ea | 2017-05-31 20:42:43 +0000 | [diff] [blame] | 9 | |
| 10 | // RUN: env INCLUDE=/my/system/inc %clang_cl -### -- %s 2>&1 | FileCheck %s --check-prefix=STDINC |
| 11 | // STDINC: "-internal-isystem" "/my/system/inc" |
| 12 | |
Nico Weber | 07f0a52 | 2018-02-28 19:49:07 +0000 | [diff] [blame^] | 13 | // -nostdinc suppresses all of %INCLUDE%, clang resource dirs, and -imsvc dirs. |
| 14 | // RUN: env INCLUDE=/my/system/inc %clang_cl -nostdinc -imsvc /my/other/inc -### -- %s 2>&1 | FileCheck %s --check-prefix=NOSTDINC |
| 15 | // NOSTDINC: argument unused{{.*}}-imsvc |
Reid Kleckner | 8ea89ea | 2017-05-31 20:42:43 +0000 | [diff] [blame] | 16 | // NOSTDINC-NOT: "-internal-isystem" "/my/system/inc" |
Nico Weber | 07f0a52 | 2018-02-28 19:49:07 +0000 | [diff] [blame^] | 17 | // NOSTDINC-NOT: "-internal-isystem" "{{.*}}/lib/clang/{{.*}}/include" |
| 18 | // NOSTDINC-NOT: "-internal-isystem" "/my/other/inc" |
| 19 | |
| 20 | // /X suppresses %INCLUDE% but not clang resource dirs or -imsvc dirs. |
| 21 | // RUN: env INCLUDE=/my/system/inc %clang_cl /X -imsvc /my/other/inc -### -- %s 2>&1 | FileCheck %s --check-prefix=SLASHX |
| 22 | // SLASHX-NOT: "argument unused{{.*}}-imsvc" |
| 23 | // SLASHX-NOT: "-internal-isystem" "/my/system/inc" |
| 24 | // SLASHX: "-internal-isystem" "{{.*}}/lib/clang/{{.*}}/include" |
| 25 | // SLASHX: "-internal-isystem" "/my/other/inc" |