68 lines · c
1// Note: %s must be preceded by --, otherwise it may be interpreted as a2// command-line option, e.g. on Mac where %s is commonly under /Users.3 4// RUN: %clang_cl /TC -### -- %s 2>&1 | FileCheck -check-prefix=TC %s5// TC: "-x" "c"6// TC-NOT: warning7// TC-NOT: note8 9// RUN: %clang_cl /TP -### -- %s 2>&1 | FileCheck -check-prefix=TP %s10// TP: "-x" "c++"11// TP-NOT: warning12// TP-NOT: note13 14// RUN: %clang_cl -### /Tc%s /TP -- %s 2>&1 | FileCheck -check-prefix=Tc %s15// RUN: %clang_cl -### /TP /Tc%s -- %s 2>&1 | FileCheck -check-prefix=Tc %s16// Tc: "-x" "c"17// Tc: "-x" "c++"18// Tc-NOT: warning19// Tc-NOT: note20 21// RUN: %clang_cl -### /Tp%s /TC -- %s 2>&1 | FileCheck -check-prefix=Tp %s22// RUN: %clang_cl -### /TC /Tp%s -- %s 2>&1 | FileCheck -check-prefix=Tp %s23// Tp: "-x" "c++"24// Tp: "-x" "c"25// Tp-NOT: warning26// Tp-NOT: note27 28// RUN: %clang_cl /TP /TC /TP -### -- %s 2>&1 | FileCheck -check-prefix=WARN %s29// WARN: warning: overriding '/TP' option with '/TC'30// WARN: warning: overriding '/TC' option with '/TP'31// WARN: note: the last '/TC' or '/TP' option takes precedence over earlier instances32// WARN-NOT: note33 34// MSYS2_ARG_CONV_EXCL tells MSYS2 to skip conversion of the specified argument.35// Add a dummy "other" entry to the path as well, to check that it's split36// around semicolons even on unix.37// RUN: env LIB="other;%S/Inputs/cl-libs" MSYS2_ARG_CONV_EXCL="/TP;/c" %clang_cl /c /TP cl-test.lib -### 2>&1 | FileCheck -check-prefix=TPlib %s38// TPlib: warning: cl-test.lib: 'linker' input unused39// TPlib: warning: argument unused during compilation: '/TP'40// TPlib-NOT: cl-test.lib41 42// RUN: env LIB=%S/Inputs/cl-libs MSYS2_ARG_CONV_EXCL="/TC;/c" %clang_cl /c /TC cl-test.lib -### 2>&1 | FileCheck -check-prefix=TClib %s43// TClib: warning: cl-test.lib: 'linker' input unused44// TClib: warning: argument unused during compilation: '/TC'45// TClib-NOT: cl-test.lib46 47// RUN: not %clang_cl - 2>&1 | FileCheck -check-prefix=STDIN %s48// STDIN: error: use /Tc or /Tp49 50// RUN: %clang_cl -### /Tc - 2>&1 | FileCheck -check-prefix=STDINTc %s51// STDINTc: "-x" "c"52 53// RUN: env LIB=%S/Inputs/cl-libs %clang_cl -fuse-ld=link -### -- %s cl-test.lib 2>&1 | FileCheck -check-prefix=LIBINPUT %s54// LIBINPUT: link.exe"55// LIBINPUT: "cl-test.lib"56 57// RUN: env LIB=%S/Inputs/cl-libs %clang_cl -fuse-ld=link -### -- %s cl-test2.lib 2>&1 | FileCheck -check-prefix=LIBINPUT2 %s58// LIBINPUT2-NOT: error: no such file or directory: 'cl-test2.lib'59// LIBINPUT2: link.exe"60// LIBINPUT2: "cl-test2.lib"61 62// RUN: not %clang_cl -fuse-ld=link -### -- %s /nonexisting.lib 2>&1 | FileCheck -check-prefix=LIBINPUT3 %s63// LIBINPUT3: error: no such file or directory: '/nonexisting.lib'64// LIBINPUT3: link.exe"65// LIBINPUT3-NOT: "/nonexisting.lib"66 67void f();68