[RISCV][FMV] Support target_clones (#85786)
[llvm-project.git] / clang / test / Driver / cl-runtime-flags.c
blob2a6151e08c046f8c9a805b91def90012f8e11961
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.
4 // First check that regular clang doesn't do any of this stuff.
5 // RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-CLANG %s
6 // CHECK-CLANG-NOT: "-D_DEBUG"
7 // CHECK-CLANG-NOT: "-D_MT"
8 // CHECK-CLANG-NOT: "-D_DLL"
9 // CHECK-CLANG-NOT: --dependent-lib
11 // RUN: %clang_cl -### -- %s 2>&1 | FileCheck -check-prefix=CHECK-MT %s
12 // RUN: %clang_cl -### /MT -- %s 2>&1 | FileCheck -check-prefix=CHECK-MT %s
13 // RUN: %clang -### --target=x86_64-windows-msvc -fms-runtime-lib=static -- %s \
14 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-MT %s
15 // CHECK-MT-NOT: "-D_DEBUG"
16 // CHECK-MT: "-D_MT"
17 // CHECK-MT-NOT: "-D_DLL"
18 // CHECK-MT: "-flto-visibility-public-std"
19 // CHECK-MT: "--dependent-lib=libcmt"
20 // CHECK-MT: "--dependent-lib=oldnames"
22 // RUN: %clang_cl -### /MTd -- %s 2>&1 | FileCheck -check-prefix=CHECK-MTd %s
23 // RUN: %clang_cl -### /LD /MTd -- %s 2>&1 | FileCheck -check-prefix=CHECK-MTd %s
24 // RUN: %clang -### --target=x86_64-windows-msvc -fms-runtime-lib=static_dbg \
25 // RUN: -- %s 2>&1 | FileCheck -check-prefix=CHECK-MTd %s
26 // CHECK-MTd: "-D_DEBUG"
27 // CHECK-MTd: "-D_MT"
28 // CHECK-MTd-NOT: "-D_DLL"
29 // CHECK-MTd: "-flto-visibility-public-std"
30 // CHECK-MTd: "--dependent-lib=libcmtd"
31 // CHECK-MTd: "--dependent-lib=oldnames"
33 // RUN: %clang_cl -### /MD -- %s 2>&1 | FileCheck -check-prefix=CHECK-MD %s
34 // RUN: %clang -### --target=x86_64-windows-msvc -fms-runtime-lib=dll -- %s \
35 // RUN: 2>&1 | FileCheck -check-prefix=CHECK-MD %s
36 // CHECK-MD-NOT: "-D_DEBUG"
37 // CHECK-MD: "-D_MT"
38 // CHECK-MD: "-D_DLL"
39 // CHECK-MD: "--dependent-lib=msvcrt"
40 // CHECK-MD: "--dependent-lib=oldnames"
42 // RUN: %clang_cl -### /MDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-MDd %s
43 // RUN: %clang -### --target=x86_64-windows-msvc -fms-runtime-lib=dll_dbg -- \
44 // RUN: %s 2>&1 | FileCheck -check-prefix=CHECK-MDd %s
45 // CHECK-MDd: "-D_DEBUG"
46 // CHECK-MDd: "-D_MT"
47 // CHECK-MDd: "-D_DLL"
48 // CHECK-MDd: "--dependent-lib=msvcrtd"
49 // CHECK-MDd: "--dependent-lib=oldnames"
51 // RUN: %clang_cl -### /LD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LD %s
52 // RUN: %clang_cl -### /LD /MT -- %s 2>&1 | FileCheck -check-prefix=CHECK-LD %s
53 // CHECK-LD-NOT: "-D_DEBUG"
54 // CHECK-LD: "-D_MT"
55 // CHECK-LD-NOT: "-D_DLL"
56 // CHECK-LD: "--dependent-lib=libcmt"
58 // RUN: %clang_cl -### /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDd %s
59 // RUN: %clang_cl -### /LDd /MTd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDd %s
60 // CHECK-LDd: "-D_DEBUG"
61 // CHECK-LDd: "-D_MT"
62 // CHECK-LDd-NOT: "-D_DLL"
63 // CHECK-LDd: "--dependent-lib=libcmtd"
65 // RUN: %clang_cl -### /LDd /MT -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMT %s
66 // RUN: %clang_cl -### /MT /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMT %s
67 // CHECK-LDdMT: "-D_DEBUG"
68 // CHECK-LDdMT: "-D_MT"
69 // CHECK-LDdMT-NOT: "-D_DLL"
70 // CHECK-LDdMT: "--dependent-lib=libcmt"
72 // RUN: %clang_cl -### /LD /MD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMD %s
73 // RUN: %clang_cl -### /MD /LD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMD %s
74 // CHECK-LDMD-NOT: "-D_DEBUG"
75 // CHECK-LDMD: "-D_MT"
76 // CHECK-LDMD: "-D_DLL"
77 // CHECK-LDMD: "--dependent-lib=msvcrt"
79 // RUN: %clang_cl -### /LDd /MD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMD %s
80 // RUN: %clang_cl -### /MD /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMD %s
81 // CHECK-LDdMD: "-D_DEBUG"
82 // CHECK-LDdMD: "-D_MT"
83 // CHECK-LDdMD: "-D_DLL"
84 // CHECK-LDdMD: "--dependent-lib=msvcrt"
86 // RUN: %clang_cl -### /LD /MDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s
87 // RUN: %clang_cl -### /MDd /LD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s
88 // RUN: %clang_cl -### /LDd /MDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s
89 // RUN: %clang_cl -### /MDd /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s
90 // CHECK-LDMDd: "-D_DEBUG"
91 // CHECK-LDMDd: "-D_MT"
92 // CHECK-LDMDd: "-D_DLL"
93 // CHECK-LDMDd: "--dependent-lib=msvcrtd"
95 // RUN: %clang_cl /MD /MT -### -- %s 2>&1 | FileCheck -check-prefix=MTOVERRIDE %s
96 // MTOVERRIDE: "--dependent-lib=libcmt"
98 // RUN: %clang_cl -### /Zl -- %s 2>&1 | FileCheck -check-prefix=CHECK-MTZl %s
99 // RUN: %clang_cl -### /MT /Zl -- %s 2>&1 | FileCheck -check-prefix=CHECK-MTZl %s
100 // RUN: %clang -### --target=x86_64-windows-msvc -fms-runtime-lib=static \
101 // RUN: -fms-omit-default-lib -- %s 2>&1 | FileCheck \
102 // RUN: -check-prefix=CHECK-MTZl %s
103 // CHECK-MTZl-NOT: "-D_DEBUG"
104 // CHECK-MTZl: "-D_MT"
105 // CHECK-MTZl-NOT: "-D_DLL"
106 // CHECK-MTZl-SAME: "-D_VC_NODEFAULTLIB"
107 // CHECK-MTZl-NOT: "--dependent-lib=libcmt"
108 // CHECK-MTZl-NOT: "--dependent-lib=oldnames"