1*f4a2713aSLionel Sambuc // Don't attempt slash switches on msys bash. 2*f4a2713aSLionel Sambuc // REQUIRES: shell-preserves-root 3*f4a2713aSLionel Sambuc 4*f4a2713aSLionel Sambuc // Note: %s must be preceded by --, otherwise it may be interpreted as a 5*f4a2713aSLionel Sambuc // command-line option, e.g. on Mac where %s is commonly under /Users. 6*f4a2713aSLionel Sambuc 7*f4a2713aSLionel Sambuc // First check that regular clang doesn't do any of this stuff. 8*f4a2713aSLionel Sambuc // RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-CLANG %s 9*f4a2713aSLionel Sambuc // CHECK-CLANG-NOT: "-D_DEBUG" 10*f4a2713aSLionel Sambuc // CHECK-CLANG-NOT: "-D_MT" 11*f4a2713aSLionel Sambuc // CHECK-CLANG-NOT: "-D_DLL" 12*f4a2713aSLionel Sambuc // CHECK-CLANG-NOT: --dependent-lib 13*f4a2713aSLionel Sambuc 14*f4a2713aSLionel Sambuc // RUN: %clang_cl -### -- %s 2>&1 | FileCheck -check-prefix=CHECK-MT %s 15*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /MT -- %s 2>&1 | FileCheck -check-prefix=CHECK-MT %s 16*f4a2713aSLionel Sambuc // CHECK-MT-NOT: "-D_DEBUG" 17*f4a2713aSLionel Sambuc // CHECK-MT: "-D_MT" 18*f4a2713aSLionel Sambuc // CHECK-MT-NOT: "-D_DLL" 19*f4a2713aSLionel Sambuc // CHECK-MT: "--dependent-lib=libcmt" 20*f4a2713aSLionel Sambuc // CHECK-MT: "--dependent-lib=oldnames" 21*f4a2713aSLionel Sambuc 22*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /MTd -- %s 2>&1 | FileCheck -check-prefix=CHECK-MTd %s 23*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /LD /MTd -- %s 2>&1 | FileCheck -check-prefix=CHECK-MTd %s 24*f4a2713aSLionel Sambuc // CHECK-MTd: "-D_DEBUG" 25*f4a2713aSLionel Sambuc // CHECK-MTd: "-D_MT" 26*f4a2713aSLionel Sambuc // CHECK-MTd-NOT: "-D_DLL" 27*f4a2713aSLionel Sambuc // CHECK-MTd: "--dependent-lib=libcmtd" 28*f4a2713aSLionel Sambuc // CHECK-MTd: "--dependent-lib=oldnames" 29*f4a2713aSLionel Sambuc 30*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /MD -- %s 2>&1 | FileCheck -check-prefix=CHECK-MD %s 31*f4a2713aSLionel Sambuc // CHECK-MD-NOT: "-D_DEBUG" 32*f4a2713aSLionel Sambuc // CHECK-MD: "-D_MT" 33*f4a2713aSLionel Sambuc // CHECK-MD: "-D_DLL" 34*f4a2713aSLionel Sambuc // CHECK-MD: "--dependent-lib=msvcrt" 35*f4a2713aSLionel Sambuc // CHECK-MD: "--dependent-lib=oldnames" 36*f4a2713aSLionel Sambuc 37*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /MDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-MDd %s 38*f4a2713aSLionel Sambuc // CHECK-MDd: "-D_DEBUG" 39*f4a2713aSLionel Sambuc // CHECK-MDd: "-D_MT" 40*f4a2713aSLionel Sambuc // CHECK-MDd: "-D_DLL" 41*f4a2713aSLionel Sambuc // CHECK-MDd: "--dependent-lib=msvcrtd" 42*f4a2713aSLionel Sambuc // CHECK-MDd: "--dependent-lib=oldnames" 43*f4a2713aSLionel Sambuc 44*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /LD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LD %s 45*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /LD /MT -- %s 2>&1 | FileCheck -check-prefix=CHECK-LD %s 46*f4a2713aSLionel Sambuc // CHECK-LD-NOT: "-D_DEBUG" 47*f4a2713aSLionel Sambuc // CHECK-LD: "-D_MT" 48*f4a2713aSLionel Sambuc // CHECK-LD-NOT: "-D_DLL" 49*f4a2713aSLionel Sambuc // CHECK-LD: "--dependent-lib=libcmt" 50*f4a2713aSLionel Sambuc 51*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDd %s 52*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /LDd /MTd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDd %s 53*f4a2713aSLionel Sambuc // CHECK-LDd: "-D_DEBUG" 54*f4a2713aSLionel Sambuc // CHECK-LDd: "-D_MT" 55*f4a2713aSLionel Sambuc // CHECK-LDd-NOT: "-D_DLL" 56*f4a2713aSLionel Sambuc // CHECK-LDd: "--dependent-lib=libcmtd" 57*f4a2713aSLionel Sambuc 58*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /LDd /MT -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMT %s 59*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /MT /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMT %s 60*f4a2713aSLionel Sambuc // CHECK-LDdMT: "-D_DEBUG" 61*f4a2713aSLionel Sambuc // CHECK-LDdMT: "-D_MT" 62*f4a2713aSLionel Sambuc // CHECK-LDdMT-NOT: "-D_DLL" 63*f4a2713aSLionel Sambuc // CHECK-LDdMT: "--dependent-lib=libcmt" 64*f4a2713aSLionel Sambuc 65*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /LD /MD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMD %s 66*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /MD /LD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMD %s 67*f4a2713aSLionel Sambuc // CHECK-LDMD-NOT: "-D_DEBUG" 68*f4a2713aSLionel Sambuc // CHECK-LDMD: "-D_MT" 69*f4a2713aSLionel Sambuc // CHECK-LDMD: "-D_DLL" 70*f4a2713aSLionel Sambuc // CHECK-LDMD: "--dependent-lib=msvcrt" 71*f4a2713aSLionel Sambuc 72*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /LDd /MD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMD %s 73*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /MD /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMD %s 74*f4a2713aSLionel Sambuc // CHECK-LDdMD: "-D_DEBUG" 75*f4a2713aSLionel Sambuc // CHECK-LDdMD: "-D_MT" 76*f4a2713aSLionel Sambuc // CHECK-LDdMD: "-D_DLL" 77*f4a2713aSLionel Sambuc // CHECK-LDdMD: "--dependent-lib=msvcrt" 78*f4a2713aSLionel Sambuc 79*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /LD /MDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s 80*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /MDd /LD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s 81*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /LDd /MDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s 82*f4a2713aSLionel Sambuc // RUN: %clang_cl -### /MDd /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s 83*f4a2713aSLionel Sambuc // CHECK-LDMDd: "-D_DEBUG" 84*f4a2713aSLionel Sambuc // CHECK-LDMDd: "-D_MT" 85*f4a2713aSLionel Sambuc // CHECK-LDMDd: "-D_DLL" 86*f4a2713aSLionel Sambuc // CHECK-LDMDd: "--dependent-lib=msvcrtd" 87*f4a2713aSLionel Sambuc 88*f4a2713aSLionel Sambuc // RUN: %clang_cl /MD /MT -### -- %s 2>&1 | FileCheck -check-prefix=MTOVERRIDE %s 89*f4a2713aSLionel Sambuc // MTOVERRIDE: "--dependent-lib=libcmt" 90