xref: /aosp_15_r20/external/clang/test/Driver/cl.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // Note: we have to quote the /? option, otherwise some shells will try to
2*67e74705SXin Li // expand the ? into a one-letter filename in the root directory, and make
3*67e74705SXin Li // the test fail is such a file or directory exists.
4*67e74705SXin Li 
5*67e74705SXin Li // Note: %s must be preceded by --, otherwise it may be interpreted as a
6*67e74705SXin Li // command-line option, e.g. on Mac where %s is commonly under /Users.
7*67e74705SXin Li 
8*67e74705SXin Li // Check that clang-cl options are not available by default.
9*67e74705SXin Li // RUN: %clang -help | FileCheck %s -check-prefix=DEFAULT
10*67e74705SXin Li // DEFAULT-NOT: CL.EXE COMPATIBILITY OPTIONS
11*67e74705SXin Li // DEFAULT-NOT: {{/[?]}}
12*67e74705SXin Li // DEFAULT-NOT: /help
13*67e74705SXin Li // RUN: not %clang "/?"
14*67e74705SXin Li // RUN: not %clang -?
15*67e74705SXin Li // RUN: not %clang /help
16*67e74705SXin Li 
17*67e74705SXin Li // Check that /? and /help are available as clang-cl options.
18*67e74705SXin Li // RUN: %clang_cl "/?" | FileCheck %s -check-prefix=CL
19*67e74705SXin Li // RUN: %clang_cl /help | FileCheck %s -check-prefix=CL
20*67e74705SXin Li // RUN: %clang_cl -help | FileCheck %s -check-prefix=CL
21*67e74705SXin Li // CL: CL.EXE COMPATIBILITY OPTIONS
22*67e74705SXin Li // CL: {{/[?]}}
23*67e74705SXin Li // CL: /help
24*67e74705SXin Li 
25*67e74705SXin Li // Options which are not "core" clang options nor cl.exe compatible options
26*67e74705SXin Li // are not available in clang-cl.
27*67e74705SXin Li // DEFAULT: -fapple-kext
28*67e74705SXin Li // CL-NOT: -fapple-kext
29*67e74705SXin Li 
30*67e74705SXin Li // RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=COMPILE %s
31*67e74705SXin Li // COMPILE: "-fdiagnostics-format" "msvc"
32