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 // First check that regular clang doesn't do any of this stuff. 8 // RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-CLANG %s 9 // CHECK-CLANG-NOT: "-D_DEBUG" 10 // CHECK-CLANG-NOT: "-D_MT" 11 // CHECK-CLANG-NOT: "-D_DLL" 12 // CHECK-CLANG-NOT: --dependent-lib 13 14 // RUN: %clang_cl -### -- %s 2>&1 | FileCheck -check-prefix=CHECK-MT %s 15 // RUN: %clang_cl -### /MT -- %s 2>&1 | FileCheck -check-prefix=CHECK-MT %s 16 // CHECK-MT-NOT: "-D_DEBUG" 17 // CHECK-MT: "-D_MT" 18 // CHECK-MT-NOT: "-D_DLL" 19 // CHECK-MT: "--dependent-lib=libcmt" 20 // CHECK-MT: "--dependent-lib=oldnames" 21 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 // CHECK-MTd: "-D_DEBUG" 25 // CHECK-MTd: "-D_MT" 26 // CHECK-MTd-NOT: "-D_DLL" 27 // CHECK-MTd: "--dependent-lib=libcmtd" 28 // CHECK-MTd: "--dependent-lib=oldnames" 29 30 // RUN: %clang_cl -### /MD -- %s 2>&1 | FileCheck -check-prefix=CHECK-MD %s 31 // CHECK-MD-NOT: "-D_DEBUG" 32 // CHECK-MD: "-D_MT" 33 // CHECK-MD: "-D_DLL" 34 // CHECK-MD: "--dependent-lib=msvcrt" 35 // CHECK-MD: "--dependent-lib=oldnames" 36 37 // RUN: %clang_cl -### /MDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-MDd %s 38 // CHECK-MDd: "-D_DEBUG" 39 // CHECK-MDd: "-D_MT" 40 // CHECK-MDd: "-D_DLL" 41 // CHECK-MDd: "--dependent-lib=msvcrtd" 42 // CHECK-MDd: "--dependent-lib=oldnames" 43 44 // RUN: %clang_cl -### /LD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LD %s 45 // RUN: %clang_cl -### /LD /MT -- %s 2>&1 | FileCheck -check-prefix=CHECK-LD %s 46 // CHECK-LD-NOT: "-D_DEBUG" 47 // CHECK-LD: "-D_MT" 48 // CHECK-LD-NOT: "-D_DLL" 49 // CHECK-LD: "--dependent-lib=libcmt" 50 51 // RUN: %clang_cl -### /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDd %s 52 // RUN: %clang_cl -### /LDd /MTd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDd %s 53 // CHECK-LDd: "-D_DEBUG" 54 // CHECK-LDd: "-D_MT" 55 // CHECK-LDd-NOT: "-D_DLL" 56 // CHECK-LDd: "--dependent-lib=libcmtd" 57 58 // RUN: %clang_cl -### /LDd /MT -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMT %s 59 // RUN: %clang_cl -### /MT /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMT %s 60 // CHECK-LDdMT: "-D_DEBUG" 61 // CHECK-LDdMT: "-D_MT" 62 // CHECK-LDdMT-NOT: "-D_DLL" 63 // CHECK-LDdMT: "--dependent-lib=libcmt" 64 65 // RUN: %clang_cl -### /LD /MD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMD %s 66 // RUN: %clang_cl -### /MD /LD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMD %s 67 // CHECK-LDMD-NOT: "-D_DEBUG" 68 // CHECK-LDMD: "-D_MT" 69 // CHECK-LDMD: "-D_DLL" 70 // CHECK-LDMD: "--dependent-lib=msvcrt" 71 72 // RUN: %clang_cl -### /LDd /MD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMD %s 73 // RUN: %clang_cl -### /MD /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDdMD %s 74 // CHECK-LDdMD: "-D_DEBUG" 75 // CHECK-LDdMD: "-D_MT" 76 // CHECK-LDdMD: "-D_DLL" 77 // CHECK-LDdMD: "--dependent-lib=msvcrt" 78 79 // RUN: %clang_cl -### /LD /MDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s 80 // RUN: %clang_cl -### /MDd /LD -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s 81 // RUN: %clang_cl -### /LDd /MDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s 82 // RUN: %clang_cl -### /MDd /LDd -- %s 2>&1 | FileCheck -check-prefix=CHECK-LDMDd %s 83 // CHECK-LDMDd: "-D_DEBUG" 84 // CHECK-LDMDd: "-D_MT" 85 // CHECK-LDMDd: "-D_DLL" 86 // CHECK-LDMDd: "--dependent-lib=msvcrtd" 87 88 // RUN: %clang_cl /MD /MT -### -- %s 2>&1 | FileCheck -check-prefix=MTOVERRIDE %s 89 // MTOVERRIDE: "--dependent-lib=libcmt" 90