Hans Wennborg | 24ffd63 | 2013-09-10 20:35:58 +0000 | [diff] [blame] | 1 | // Don't attempt slash switches on msys bash. |
| 2 | // REQUIRES: shell-preserves-root |
| 3 | |
| 4 | // Note: %s must be preceded by --, otherwise it may be interpreted as a |
| 5 | // command-line option, e.g. on Mac where %s is commonly under /Users. |
| 6 | |
| 7 | // RUN: %clang_cl /TC -### -- %s 2>&1 | FileCheck -check-prefix=TC %s |
| 8 | // TC: "-x" "c" |
| 9 | // TC-NOT: warning |
| 10 | // TC-NOT: note |
| 11 | |
| 12 | // RUN: %clang_cl /TP -### -- %s 2>&1 | FileCheck -check-prefix=TP %s |
| 13 | // TP: "-x" "c++" |
| 14 | // TP-NOT: warning |
| 15 | // TP-NOT: note |
| 16 | |
| 17 | // RUN: %clang_cl -### /Tc%s /TP -- %s 2>&1 | FileCheck -check-prefix=Tc %s |
| 18 | // RUN: %clang_cl -### /TP /Tc%s -- %s 2>&1 | FileCheck -check-prefix=Tc %s |
| 19 | // Tc: "-x" "c" |
| 20 | // Tc: "-x" "c++" |
| 21 | // Tc-NOT: warning |
| 22 | // Tc-NOT: note |
| 23 | |
| 24 | // RUN: %clang_cl -### /Tp%s /TC -- %s 2>&1 | FileCheck -check-prefix=Tp %s |
| 25 | // RUN: %clang_cl -### /TC /Tp%s -- %s 2>&1 | FileCheck -check-prefix=Tp %s |
| 26 | // Tp: "-x" "c++" |
| 27 | // Tp: "-x" "c" |
| 28 | // Tp-NOT: warning |
| 29 | // Tp-NOT: note |
| 30 | |
| 31 | // RUN: %clang_cl /TP /TC /TP -### -- %s 2>&1 | FileCheck -check-prefix=WARN %s |
| 32 | // WARN: warning: overriding '/TP' option with '/TC' |
| 33 | // WARN: warning: overriding '/TC' option with '/TP' |
| 34 | // WARN: note: The last /TC or /TP option takes precedence over earlier instances |
| 35 | // WARN-NOT: note |
Hans Wennborg | cfdd8b5 | 2014-01-29 01:04:40 +0000 | [diff] [blame^] | 36 | |
| 37 | // RUN: not %clang_cl - 2>&1 | FileCheck -check-prefix=STDIN %s |
| 38 | // STDIN: error: use /Tc or /Tp |
| 39 | |
| 40 | // RUN: %clang_cl -### /Tc - 2>&1 | FileCheck -check-prefix=STDINTc %s |
| 41 | // STDINTc: "-x" "c" |
| 42 | |
| 43 | void f(); |