brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.1 KiB · 5f0cd5e Raw
148 lines · cpp
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 /c -### -- %s 2>&1 | FileCheck -check-prefix=TRIGRAPHS-DEFAULT %s5// cc1 will disable trigraphs for -fms-compatibility as long as -ftrigraphs6// isn't explicitly passed.7// TRIGRAPHS-DEFAULT-NOT: "-ftrigraphs"8 9// RUN: %clang_cl /c -### /Zc:trigraphs -- %s 2>&1 | FileCheck -check-prefix=TRIGRAPHS-ON %s10// TRIGRAPHS-ON: "-ftrigraphs"11 12// RUN: %clang_cl /c -### /Zc:trigraphs- -- %s 2>&1 | FileCheck -check-prefix=TRIGRAPHS-OFF %s13// TRIGRAPHS-OFF: "-fno-trigraphs"14 15// RUN: %clang_cl /c -### /Zc:sizedDealloc -- %s 2>&1 | FileCheck -check-prefix=SIZED-DEALLOC-ON %s16// SIZED-DEALLOC-ON: "-fsized-deallocation"17 18// RUN: %clang_cl /c -### /Zc:sizedDealloc- -- %s 2>&1 | FileCheck -check-prefix=SIZED-DEALLOC-OFF %s19// SIZED-DEALLOC-OFF-NOT: "-fsized-deallocation"20 21// RUN: %clang_cl /c /std:c++17 -### /Zc:alignedNew -- %s 2>&1 | FileCheck -check-prefix=ALIGNED-NEW-ON %s22// ALIGNED-NEW-ON: "-faligned-allocation"23 24// RUN: %clang_cl /c /std:c++17 -### /Zc:alignedNew- -- %s 2>&1 | FileCheck -check-prefix=ALIGNED-NEW-OFF %s25// ALIGNED-NEW-OFF-NOT: "-faligned-allocation"26 27// RUN: %clang_cl /c -### /kernel -- %s 2>&1 | FileCheck -check-prefixes=KERNEL-NO-RTTI,KERNEL-NO-EXCEPTIONS %s28// KERNEL-NO-RTTI: "-fno-rtti"29// KERNEL-NO-EXCEPTIONS-NOT: "-fcxx-exceptions" "-fexceptions"30 31// RUN: not %clang_cl /c -### --target=i686-pc-windows-msvc /kernel /arch:SSE -- %s 2>&1 | FileCheck -check-prefixes=KERNEL-SSE %s32// RUN: not %clang_cl /c -### --target=i686-pc-windows-msvc /kernel /arch:SSE2 -- %s 2>&1 | FileCheck -check-prefixes=KERNEL-SSE2 %s33// RUN: not %clang_cl /c -### --target=i686-pc-windows-msvc /kernel /arch:AVX -- %s 2>&1 | FileCheck -check-prefixes=KERNEL-AVX %s34// RUN: not %clang_cl /c -### --target=i686-pc-windows-msvc /kernel /arch:AVX2 -- %s 2>&1 | FileCheck -check-prefixes=KERNEL-AVX2 %s35// RUN: not %clang_cl /c -### --target=i686-pc-windows-msvc /kernel /arch:AVX512 -- %s 2>&1 | FileCheck -check-prefixes=KERNEL-AVX512 %s36// KERNEL-SSE: error: invalid argument '/arch:SSE' not allowed with '/kernel'37// KERNEL-SSE2: error: invalid argument '/arch:SSE2' not allowed with '/kernel'38// KERNEL-AVX: error: invalid argument '/arch:AVX' not allowed with '/kernel'39// KERNEL-AVX2: error: invalid argument '/arch:AVX2' not allowed with '/kernel'40// KERNEL-AVX512: error: invalid argument '/arch:AVX512' not allowed with '/kernel'41 42// RUN: %clang_cl /c -### /kernel /EHsc -- %s 2>&1 | FileCheck -check-prefixes=KERNEL-EHSC %s43// RUN: not %clang_cl /c -### /kernel /GR -- %s 2>&1 | FileCheck -check-prefixes=KERNEL-GR %s44// KERNEL-EHSC-NOT: "-fcxx-exceptions" "-fexceptions"45// KERNEL-GR: error: invalid argument '/GR' not allowed with '/kernel'46 47// RUN: not %clang_cl /c -### --target=x86_64-pc-windows-msvc /kernel /arch:AVX -- %s 2>&1 | FileCheck -check-prefixes=KERNEL-X64-AVX %s48// RUN: not %clang_cl /c -### --target=x86_64-pc-windows-msvc /kernel /arch:AVX2 -- %s 2>&1 | FileCheck -check-prefixes=KERNEL-X64-AVX2 %s49// RUN: not %clang_cl /c -### --target=x86_64-pc-windows-msvc /kernel /arch:AVX512 -- %s 2>&1 | FileCheck -check-prefixes=KERNEL-X64-AVX512 %s50// KERNEL-X64-AVX: error: invalid argument '/arch:AVX' not allowed with '/kernel'51// KERNEL-X64-AVX2: error: invalid argument '/arch:AVX2' not allowed with '/kernel'52// KERNEL-X64-AVX512: error: invalid argument '/arch:AVX512' not allowed with '/kernel'53 54// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=STRICTSTRINGS-DEFAULT %s55// STRICTSTRINGS-DEFAULT-NOT: -Werror=c++11-compat-deprecated-writable-strings56// RUN: %clang_cl /c -### /Zc:strictStrings -- %s 2>&1 | FileCheck -check-prefix=STRICTSTRINGS-ON %s57// STRICTSTRINGS-ON: -Werror=c++11-compat-deprecated-writable-strings58// RUN: %clang_cl /c -### /Zc:strictStrings- -- %s 2>&1 | FileCheck -check-prefix=STRICTSTRINGS-OFF %s59// STRICTSTRINGS-OFF: argument unused during compilation60 61 62// RUN: %clang_cl /c -### /Zc:foobar -- %s 2>&1 | FileCheck -check-prefix=FOOBAR-ON %s63// FOOBAR-ON: argument unused during compilation64// RUN: %clang_cl /c -### /Zc:foobar- -- %s 2>&1 | FileCheck -check-prefix=FOOBAR-ON %s65// FOOBAR-OFF: argument unused during compilation66 67// These are ignored if enabled, and warn if disabled.68 69// RUN: %clang_cl /c -### /Zc:forScope -- %s 2>&1 | FileCheck -check-prefix=FORSCOPE-ON %s70// FORSCOPE-ON-NOT: argument unused during compilation71// RUN: %clang_cl /c -### /Zc:forScope- -- %s 2>&1 | FileCheck -check-prefix=FORSCOPE-OFF %s72// FORSCOPE-OFF: argument unused during compilation73 74// RUN: %clang_cl /c -### /Zc:wchar_t -- %s 2>&1 | FileCheck -check-prefix=WCHAR_T-ON %s75// WCHAR_T-ON-NOT: argument unused during compilation76// RUN: %clang_cl /c -### /Zc:wchar_t- -- %s 2>&1 | FileCheck -check-prefix=WCHAR_T-OFF %s77// WCHAR_T-OFF: "-fno-wchar"78 79// RUN: %clang_cl /c -### /Zc:auto -- %s 2>&1 | FileCheck -check-prefix=AUTO-ON %s80// AUTO-ON-NOT: argument unused during compilation81// RUN: %clang_cl /c -### /Zc:auto- -- %s 2>&1 | FileCheck -check-prefix=AUTO-OFF %s82// AUTO-OFF: argument unused during compilation83 84// RUN: %clang_cl /c -### /Zc:inline -- %s 2>&1 | FileCheck -check-prefix=INLINE-ON %s85// INLINE-ON-NOT: argument unused during compilation86// RUN: %clang_cl /c -### /Zc:inline- -- %s 2>&1 | FileCheck -check-prefix=INLINE-OFF %s87// INLINE-OFF: argument unused during compilation88 89// RUN: %clang_cl /c -### /Zc:ternary -- %s 2>&1 | FileCheck -check-prefix=TERNARY-ON %s90// TERNARY-ON-NOT: argument unused during compilation91// RUN: %clang_cl /c -### /Zc:ternary- -- %s 2>&1 | FileCheck -check-prefix=TERNARY-OFF %s92// TERNARY-OFF: argument unused during compilation93 94// thread safe statics are off for versions < 19.95// RUN: %clang_cl /c -### -fms-compatibility-version=18 -- %s 2>&1 | FileCheck -check-prefix=NoThreadSafeStatics %s96// RUN: %clang_cl /Zc:threadSafeInit /Zc:threadSafeInit- /c -### -- %s 2>&1 | FileCheck -check-prefix=NoThreadSafeStatics %s97// NoThreadSafeStatics: "-fno-threadsafe-statics"98 99// RUN: %clang_cl /Zc:threadSafeInit /c -### -- %s 2>&1 | FileCheck -check-prefix=ThreadSafeStatics %s100// ThreadSafeStatics-NOT: "-fno-threadsafe-statics"101 102// RUN: %clang_cl /Zc:tlsGuards- /c -### -- %s 2>&1 | FileCheck -check-prefix=NoTlsGuards %s103// NoTlsGuards: "-fno-ms-tls-guards"104 105// RUN: %clang_cl /Zc:dllexportInlines- /c -### -- %s 2>&1 | FileCheck -check-prefix=NoDllExportInlines %s106// NoDllExportInlines: "-fno-dllexport-inlines"107// RUN: %clang_cl /Zc:dllexportInlines /c -### -- %s 2>&1 | FileCheck -check-prefix=DllExportInlines %s108// DllExportInlines-NOT: "-fno-dllexport-inlines"109 110// We recognize -f[no-]delayed-template-parsing.111// /Zc:twoPhase[-] has the opposite meaning.112// RUN: %clang_cl -c -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDDEFAULT %s113// DELAYEDDEFAULT: "-fdelayed-template-parsing"114// RUN: %clang_cl -c -fdelayed-template-parsing -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDON %s115// RUN: %clang_cl -c /Zc:twoPhase- -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDON %s116// DELAYEDON: "-fdelayed-template-parsing"117// RUN: %clang_cl -c -fno-delayed-template-parsing -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDOFF %s118// RUN: %clang_cl -c /Zc:twoPhase -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDOFF %s119// DELAYEDOFF-NOT: "-fdelayed-template-parsing"120 121// RUN: %clang_cl -c -### /std:c++latest -- %s 2>&1 | FileCheck -check-prefix CHECK-LATEST-CHAR8_T %s122// CHECK-LATEST-CHAR8_T-NOT: "-fchar8_t"123// RUN: %clang_cl -c -### /Zc:char8_t -- %s 2>&1 | FileCheck -check-prefix CHECK-CHAR8_T %s124// CHECK-CHAR8_T: "-fchar8_t"125// RUN: %clang_cl -c -### /Zc:char8_t- -- %s 2>&1 | FileCheck -check-prefix CHECK-CHAR8_T_ %s126// CHECK-CHAR8_T_: "-fno-char8_t"127 128 129 130// These never warn, but don't have an effect yet.131 132// RUN: %clang_cl /c \133// RUN:   /Zc:__cplusplus \134// RUN:   /Zc:auto \135// RUN:   /Zc:forScope \136// RUN:   /Zc:inline \137// RUN:   /Zc:rvalueCast \138// RUN:   /Zc:ternary \139// RUN:   -### -- %s 2>&1 | FileCheck -DMSG=%errc_ENOENT -check-prefix=IGNORED %s140// IGNORED-NOT: argument unused during compilation141// IGNORED-NOT: [[MSG]]142 143// Negated form warns:144// RUN: %clang_cl /c \145// RUN:   /Zc:rvalueCast- \146// RUN:   -### -- %s 2>&1 | FileCheck -check-prefix=NOTIGNORED %s147// NOTIGNORED: argument unused during compilation148