Index: include/clang/Driver/CC1Options.td =================================================================== --- include/clang/Driver/CC1Options.td +++ include/clang/Driver/CC1Options.td @@ -158,6 +158,8 @@ "on compiler-generated code.">; def mrelocation_model : Separate<["-"], "mrelocation-model">, HelpText<"The relocation model to use">; +def mident_string : Separate<["-"], "mident-string">, + HelpText<"Specify an identifier string to add to the output.">; def fno_math_builtin : Flag<["-"], "fno-math-builtin">, HelpText<"Disable implicit builtin knowledge of math functions">; } Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -1631,6 +1631,8 @@ def masm_EQ : Joined<["-"], "masm=">, Group, Flags<[DriverOption]>; def mcmodel_EQ : Joined<["-"], "mcmodel=">, Group; def mimplicit_it_EQ : Joined<["-"], "mimplicit-it=">, Group; +def mcomment_section : Flag<["-"], "mcomment-section">, Group, Flags<[DriverOption, CoreOption]>; +def mno_comment_section : Flag<["-"], "mno-comment-section">, Group, Flags<[DriverOption, CoreOption]>; def mconstant_cfstrings : Flag<["-"], "mconstant-cfstrings">, Group; def mconsole : Joined<["-"], "mconsole">, Group, Flags<[DriverOption]>; def mwindows : Joined<["-"], "mwindows">, Group, Flags<[DriverOption]>; Index: include/clang/Frontend/CodeGenOptions.h =================================================================== --- include/clang/Frontend/CodeGenOptions.h +++ include/clang/Frontend/CodeGenOptions.h @@ -103,6 +103,9 @@ /// The version string to put into coverage files. char CoverageVersion[4]; + /// The ident string to add to the output file. + std::string IdentString; + /// Enable additional debugging information. std::string DebugPass; Index: lib/CodeGen/CodeGenModule.h =================================================================== --- lib/CodeGen/CodeGenModule.h +++ lib/CodeGen/CodeGenModule.h @@ -1309,8 +1309,8 @@ void EmitDeclMetadata(); - /// \brief Emit the Clang version as llvm.ident metadata. - void EmitVersionIdentMetadata(); + /// \brief Emit the specified string as llvm.ident metadata. + void EmitIdentStringMetadata(); /// Emits target specific Metadata for global declarations. void EmitTargetMetadata(); Index: lib/CodeGen/CodeGenModule.cpp =================================================================== --- lib/CodeGen/CodeGenModule.cpp +++ lib/CodeGen/CodeGenModule.cpp @@ -11,6 +11,8 @@ // //===----------------------------------------------------------------------===// +#include + #include "CodeGenModule.h" #include "CGBlocks.h" #include "CGCUDARuntime.h" @@ -504,7 +506,9 @@ if (DebugInfo) DebugInfo->finalize(); - EmitVersionIdentMetadata(); + if (!CodeGenOpts.IdentString.empty()) { + EmitIdentStringMetadata(); + } EmitTargetMetadata(); } @@ -4206,14 +4210,36 @@ } } -void CodeGenModule::EmitVersionIdentMetadata() { +void CodeGenModule::EmitIdentStringMetadata() { llvm::NamedMDNode *IdentMetadata = TheModule.getOrInsertNamedMetadata("llvm.ident"); - std::string Version = getClangFullVersion(); llvm::LLVMContext &Ctx = TheModule.getContext(); - llvm::Metadata *IdentNode[] = {llvm::MDString::get(Ctx, Version)}; - IdentMetadata->addOperand(llvm::MDNode::get(Ctx, IdentNode)); + std::istringstream iss(CodeGenOpts.IdentString.substr(1, + CodeGenOpts.IdentString.length()-2)); + std::string s; + std::string line; + while (std::getline(iss, s, ';')) { + if ((s.length() + line.length()) < 80) { + if (!line.empty()) { + line += " " + s; + } + else { + line = "" + s; + } + } + else { + if (!line.empty()) { + llvm::Metadata *IdentNode[] = {llvm::MDString::get(Ctx, line)}; + IdentMetadata->addOperand(llvm::MDNode::get(Ctx, IdentNode)); + } + line = "" + s; + } + } + if (!line.empty()) { + llvm::Metadata *IdentNode[] = {llvm::MDString::get(Ctx, line)}; + IdentMetadata->addOperand(llvm::MDNode::get(Ctx, IdentNode)); + } } void CodeGenModule::EmitTargetMetadata() { Index: lib/Driver/ToolChains/Clang.cpp =================================================================== --- lib/Driver/ToolChains/Clang.cpp +++ lib/Driver/ToolChains/Clang.cpp @@ -624,6 +624,47 @@ } } +/// Escapes spaces and backslashes used in argument values +static std::string getFormattedArg(const Arg *A, const ArgList &Args) { + std::string Formatted; + ArgStringList ASL; + A->render(Args, ASL); + for (StringRef S : ASL) { + for (char &c : S.str()) { + if (c == ' ') { + Formatted += "\\ "; + } + else if (c == '\\') { + Formatted += "\\\\"; + } + else { + Formatted += c; + } + } + } + return Formatted; +} + +/// Add a CC1 option to specify an ident string to add to the output. +static void addIdentString(const ArgList &Args, ArgStringList &CmdArgs) { + if (Args.hasFlag(options::OPT_mcomment_section, options::OPT_mno_comment_section, + true)) { + CmdArgs.push_back("-mident-string"); + std::string IdentString = "'" + clang::getClangFullVersion() + ";" + + "Command-line options:;"; + for (ArgList::const_iterator it=Args.begin(), ie=Args.end(); it != ie; ++it) { + if (std::next(it) != ie) { + IdentString += getFormattedArg(*it, Args) + ";"; + } + else { + IdentString += getFormattedArg(*it, Args); + } + } + IdentString += "'"; + CmdArgs.push_back(Args.MakeArgString(IdentString)); + } +} + /// \brief Vectorize at all optimization levels greater than 1 except for -Oz. /// For -Oz the loop vectorizer is disable, while the slp vectorizer is enabled. static bool shouldEnableVectorizerAtOLevel(const ArgList &Args, bool isSlpVec) { @@ -1761,6 +1802,9 @@ } } + // Add in -mident-string if necessary. + addIdentString(Args, CmdArgs); + // When using an integrated assembler, translate -Wa, and -Xassembler // options. bool CompressDebugSections = false; @@ -3058,6 +3102,9 @@ // Add in -fdebug-compilation-dir if necessary. addDebugCompDirArg(Args, CmdArgs); + // Add in -mident-string if necessary. + addIdentString(Args, CmdArgs); + for (const Arg *A : Args.filtered(options::OPT_fdebug_prefix_map_EQ)) { StringRef Map = A->getValue(); if (Map.find('=') == StringRef::npos) Index: lib/Frontend/CompilerInvocation.cpp =================================================================== --- lib/Frontend/CompilerInvocation.cpp +++ lib/Frontend/CompilerInvocation.cpp @@ -728,6 +728,7 @@ } } } + Opts.IdentString = Args.getLastArgValue(OPT_mident_string); Opts.InstrumentFunctions = Args.hasArg(OPT_finstrument_functions); Opts.XRayInstrumentFunctions = Args.hasArg(OPT_fxray_instrument); Index: test/CodeGen/mcomment-section-helper.py =================================================================== --- /dev/null +++ test/CodeGen/mcomment-section-helper.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +import re +import argparse + +parser = argparse.ArgumentParser() + +parser.add_argument('--input', required=True) +parser.add_argument('--file_path', required=True) + +args = parser.parse_args() + +content = [] +with open(args.input, 'r') as f: + content = f.readlines() + +version_key = None +version_string = '' +ident_keys = [] +ident_string = '' +help_version_string = '' +for line in content: + ident_key_string = re.match('!llvm\.ident = !{(.*?)}', line.strip()) + if ident_key_string is not None: + all_keys = ident_key_string.group(1).split(',') + version_key = all_keys[0].strip() + ident_keys = [ident_key.strip() for ident_key in all_keys[1:]] + if version_key is not None: + version_value_string = re.match(version_key + ' = !{!"(.*?)"}', line.strip()) + if version_value_string is not None: + version_string = version_value_string.group(1) + if len(ident_keys) != 0: + for key in ident_keys: + ident_value_string = re.match(key + ' = !{!"(.*?)"}', line.strip()) + if ident_value_string is not None: + ident_string = ident_string + ' ' + ident_value_string.group(1) + if line.strip().startswith('Component: ') or line.strip().startswith('clang version'): + help_version_string = line.strip() + elif line.strip().startswith('Tool: '): + help_version_string = help_version_string + ' ' + line.strip() +ident_string = ident_string[1:] +ident_string = ident_string.replace(args.file_path, '%s') +print('Version match' if version_string == help_version_string else 'Version mismatch') +print(ident_string) \ No newline at end of file Index: test/CodeGen/mcomment-section.c =================================================================== --- /dev/null +++ test/CodeGen/mcomment-section.c @@ -0,0 +1,30 @@ +// REQUIRES: arm-registered-target +// Test that version and command-line information is added to the output + +// -mcomment-section is set by default +// RUN: %clang --target=arm-arm-none-eabi -march=armv7-a -c %s -emit-llvm -o - | llvm-dis -o %t +// RUN: %clang --target=arm-arm-none-eabi --version >> %t +// RUN: %python %S/mcomment-section-helper.py --input %t --file_path %s | FileCheck %s -check-prefix=DEFAULT + +// DEFAULT: Version match +// DEFAULT-NEXT: Command-line options: {{.*}}--target=arm-arm-none-eabi -march=armv7-a -c %s -emit-llvm -o- + +// -mcomment-section set manually +// RUN: %clang --target=arm-arm-none-eabi -march=armv7-a -c %s -emit-llvm -o - -mcomment-section | llvm-dis -o %t +// RUN: %clang --target=arm-arm-none-eabi --version >> %t +// RUN: %python %S/mcomment-section-helper.py --input %t --file_path %s | FileCheck %s -check-prefix=COMMENT + +// COMMENT: Version match +// COMMENT-NEXT: Command-line options: {{.*}}--target=arm-arm-none-eabi -march=armv7-a -c %s -emit-llvm -o- -mcomment-section + +// -mno-comment-section can be used to disable the feature +// RUN: %clang --target=arm-arm-none-eabi -march=armv7-a -c %s -emit-llvm -o - -mno-comment-section | llvm-dis -o %t +// RUN: %clang --target=arm-arm-none-eabi --version >> %t +// RUN: %python %S/mcomment-section-helper.py --input %t --file_path %s | FileCheck %s -check-prefix=NOCOMMENT + +// NOCOMMENT: Version mismatch +// NOCOMMENT-NOT: Command-line options: {{.*}}--target=arm-arm-none-eabi -march=armv7-a -c %s -emit-llvm -o- -mno-comment-section + +int foo(void) { + return 0; +} Index: test/Driver/Ofast.c =================================================================== --- test/Driver/Ofast.c +++ test/Driver/Ofast.c @@ -1,12 +1,12 @@ -// RUN: %clang -Ofast -### %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST %s -// RUN: %clang -O2 -Ofast -### %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST %s -// RUN: %clang -fno-fast-math -Ofast -### %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST %s -// RUN: %clang -fno-strict-aliasing -Ofast -### %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST %s -// RUN: %clang -fno-vectorize -Ofast -### %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST %s -// RUN: %clang -Ofast -O2 -### %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST-O2 %s -// RUN: %clang -Ofast -fno-fast-math -### %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST-NO-FAST-MATH %s -// RUN: %clang -Ofast -fno-strict-aliasing -### %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST-NO-STRICT-ALIASING %s -// RUN: %clang -Ofast -fno-vectorize -### %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST-NO-VECTORIZE %s +// RUN: %clang -Ofast -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST %s +// RUN: %clang -O2 -Ofast -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST %s +// RUN: %clang -fno-fast-math -Ofast -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST %s +// RUN: %clang -fno-strict-aliasing -Ofast -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST %s +// RUN: %clang -fno-vectorize -Ofast -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST %s +// RUN: %clang -Ofast -O2 -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST-O2 %s +// RUN: %clang -Ofast -fno-fast-math -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST-NO-FAST-MATH %s +// RUN: %clang -Ofast -fno-strict-aliasing -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST-NO-STRICT-ALIASING %s +// RUN: %clang -Ofast -fno-vectorize -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-OFAST-NO-VECTORIZE %s // CHECK-OFAST: -cc1 // CHECK-OFAST-NOT: -relaxed-aliasing Index: test/Driver/cl-options.c =================================================================== --- test/Driver/cl-options.c +++ test/Driver/cl-options.c @@ -4,18 +4,18 @@ // Alias options: -// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=c %s +// RUN: %clang_cl /c -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=c %s // c: -c -// RUN: %clang_cl /C -### -- %s 2>&1 | FileCheck -check-prefix=C %s +// RUN: %clang_cl /C -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=C %s // C: error: invalid argument '-C' only allowed with '/E, /P or /EP' -// RUN: %clang_cl /C /P -### -- %s 2>&1 | FileCheck -check-prefix=C_P %s +// RUN: %clang_cl /C /P -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=C_P %s // C_P: "-E" // C_P: "-C" // RUN: %clang_cl /Dfoo=bar /D bar=baz /DMYDEF#value /DMYDEF2=foo#bar /DMYDEF3#a=b /DMYDEF4# \ -// RUN: -### -- %s 2>&1 | FileCheck -check-prefix=D %s +// RUN: -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=D %s // D: "-D" "foo=bar" // D: "-D" "bar=baz" // D: "-D" "MYDEF=value" @@ -23,288 +23,288 @@ // D: "-D" "MYDEF3=a=b" // D: "-D" "MYDEF4=" -// RUN: %clang_cl /E -### -- %s 2>&1 | FileCheck -check-prefix=E %s +// RUN: %clang_cl /E -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=E %s // E: "-E" // E: "-o" "-" -// RUN: %clang_cl /EP -### -- %s 2>&1 | FileCheck -check-prefix=EP %s +// RUN: %clang_cl /EP -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=EP %s // EP: "-E" // EP: "-P" // EP: "-o" "-" -// RUN: %clang_cl /fp:fast /fp:except -### -- %s 2>&1 | FileCheck -check-prefix=fpexcept %s +// RUN: %clang_cl /fp:fast /fp:except -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=fpexcept %s // fpexcept-NOT: -menable-unsafe-fp-math -// RUN: %clang_cl /fp:fast /fp:except /fp:except- -### -- %s 2>&1 | FileCheck -check-prefix=fpexcept_ %s +// RUN: %clang_cl /fp:fast /fp:except /fp:except- -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=fpexcept_ %s // fpexcept_: -menable-unsafe-fp-math -// RUN: %clang_cl /fp:precise /fp:fast -### -- %s 2>&1 | FileCheck -check-prefix=fpfast %s +// RUN: %clang_cl /fp:precise /fp:fast -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=fpfast %s // fpfast: -menable-unsafe-fp-math // fpfast: -ffast-math -// RUN: %clang_cl /fp:fast /fp:precise -### -- %s 2>&1 | FileCheck -check-prefix=fpprecise %s +// RUN: %clang_cl /fp:fast /fp:precise -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=fpprecise %s // fpprecise-NOT: -menable-unsafe-fp-math // fpprecise-NOT: -ffast-math -// RUN: %clang_cl /fp:fast /fp:strict -### -- %s 2>&1 | FileCheck -check-prefix=fpstrict %s +// RUN: %clang_cl /fp:fast /fp:strict -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=fpstrict %s // fpstrict-NOT: -menable-unsafe-fp-math // fpstrict-NOT: -ffast-math -// RUN: %clang_cl /Z7 -gcolumn-info -### -- %s 2>&1 | FileCheck -check-prefix=gcolumn %s +// RUN: %clang_cl /Z7 -gcolumn-info -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=gcolumn %s // gcolumn: -dwarf-column-info -// RUN: %clang_cl /Z7 -gno-column-info -### -- %s 2>&1 | FileCheck -check-prefix=gnocolumn %s +// RUN: %clang_cl /Z7 -gno-column-info -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=gnocolumn %s // gnocolumn-NOT: -dwarf-column-info -// RUN: %clang_cl /Z7 -### -- %s 2>&1 | FileCheck -check-prefix=gdefcolumn %s +// RUN: %clang_cl /Z7 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=gdefcolumn %s // gdefcolumn-NOT: -dwarf-column-info -// RUN: %clang_cl -### /FA -fprofile-instr-generate -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE %s -// RUN: %clang_cl -### /FA -fprofile-instr-generate=/tmp/somefile.profraw -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-FILE %s -// RUN: %clang_cl -### /FA -fprofile-instr-generate -fprofile-instr-use -- %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang_cl -### /FA -fprofile-instr-generate -fprofile-instr-use=file -- %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang_cl -### -mno-comment-section /FA -fprofile-instr-generate -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE %s +// RUN: %clang_cl -### -mno-comment-section /FA -fprofile-instr-generate=/tmp/somefile.profraw -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-FILE %s +// RUN: %clang_cl -### -mno-comment-section /FA -fprofile-instr-generate -fprofile-instr-use -- %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang_cl -### -mno-comment-section /FA -fprofile-instr-generate -fprofile-instr-use=file -- %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s // CHECK-PROFILE-GENERATE: "-fprofile-instrument=clang" // CHECK-PROFILE-GENERATE-FILE: "-fprofile-instrument-path=/tmp/somefile.profraw" // CHECK-NO-MIX-GEN-USE: '{{[a-z=-]*}}' not allowed with '{{[a-z=-]*}}' -// RUN: %clang_cl -### /FA -fprofile-instr-use -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s -// RUN: %clang_cl -### /FA -fprofile-instr-use=/tmp/somefile.prof -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-FILE %s +// RUN: %clang_cl -### -mno-comment-section /FA -fprofile-instr-use -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s +// RUN: %clang_cl -### -mno-comment-section /FA -fprofile-instr-use=/tmp/somefile.prof -- %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-FILE %s // CHECK-PROFILE-USE: "-fprofile-instrument-use-path=default.profdata" // CHECK-PROFILE-USE-FILE: "-fprofile-instrument-use-path=/tmp/somefile.prof" -// RUN: %clang_cl /GA -### -- %s 2>&1 | FileCheck -check-prefix=GA %s +// RUN: %clang_cl /GA -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=GA %s // GA: -ftls-model=local-exec // RTTI is on by default; just check that we don't error. // RUN: %clang_cl /Zs /GR -- %s 2>&1 -// RUN: %clang_cl /GR- -### -- %s 2>&1 | FileCheck -check-prefix=GR_ %s +// RUN: %clang_cl /GR- -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=GR_ %s // GR_: -fno-rtti // Security Buffer Check is on by default. -// RUN: %clang_cl -### -- %s 2>&1 | FileCheck -check-prefix=GS-default %s +// RUN: %clang_cl -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=GS-default %s // GS-default: "-stack-protector" "2" -// RUN: %clang_cl /GS -### -- %s 2>&1 | FileCheck -check-prefix=GS %s +// RUN: %clang_cl /GS -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=GS %s // GS: "-stack-protector" "2" -// RUN: %clang_cl /GS- -### -- %s 2>&1 | FileCheck -check-prefix=GS_ %s +// RUN: %clang_cl /GS- -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=GS_ %s // GS_-NOT: -stack-protector -// RUN: %clang_cl /Gy -### -- %s 2>&1 | FileCheck -check-prefix=Gy %s +// RUN: %clang_cl /Gy -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Gy %s // Gy: -ffunction-sections -// RUN: %clang_cl /Gy /Gy- -### -- %s 2>&1 | FileCheck -check-prefix=Gy_ %s +// RUN: %clang_cl /Gy /Gy- -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Gy_ %s // Gy_-NOT: -ffunction-sections -// RUN: %clang_cl /Gs -### -- %s 2>&1 | FileCheck -check-prefix=Gs %s +// RUN: %clang_cl /Gs -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Gs %s // Gs: "-mstack-probe-size=0" -// RUN: %clang_cl /Gs0 -### -- %s 2>&1 | FileCheck -check-prefix=Gs0 %s +// RUN: %clang_cl /Gs0 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Gs0 %s // Gs0: "-mstack-probe-size=0" -// RUN: %clang_cl /Gs4096 -### -- %s 2>&1 | FileCheck -check-prefix=Gs4096 %s +// RUN: %clang_cl /Gs4096 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Gs4096 %s // Gs4096: "-mstack-probe-size=4096" -// RUN: %clang_cl /Gw -### -- %s 2>&1 | FileCheck -check-prefix=Gw %s +// RUN: %clang_cl /Gw -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Gw %s // Gw: -fdata-sections -// RUN: %clang_cl /Gw /Gw- -### -- %s 2>&1 | FileCheck -check-prefix=Gw_ %s +// RUN: %clang_cl /Gw /Gw- -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Gw_ %s // Gw_-NOT: -fdata-sections -// RUN: %clang_cl /Imyincludedir -### -- %s 2>&1 | FileCheck -check-prefix=SLASH_I %s -// RUN: %clang_cl /I myincludedir -### -- %s 2>&1 | FileCheck -check-prefix=SLASH_I %s +// RUN: %clang_cl /Imyincludedir -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=SLASH_I %s +// RUN: %clang_cl /I myincludedir -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=SLASH_I %s // SLASH_I: "-I" "myincludedir" -// RUN: %clang_cl /imsvcmyincludedir -### -- %s 2>&1 | FileCheck -check-prefix=SLASH_imsvc %s -// RUN: %clang_cl /imsvc myincludedir -### -- %s 2>&1 | FileCheck -check-prefix=SLASH_imsvc %s +// RUN: %clang_cl /imsvcmyincludedir -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=SLASH_imsvc %s +// RUN: %clang_cl /imsvc myincludedir -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=SLASH_imsvc %s // Clang's resource header directory should be first: // SLASH_imsvc: "-internal-isystem" "{{[^"]*}}lib{{(64)?/|\\\\}}clang{{[^"]*}}include" // SLASH_imsvc: "-internal-isystem" "myincludedir" -// RUN: %clang_cl /J -### -- %s 2>&1 | FileCheck -check-prefix=J %s +// RUN: %clang_cl /J -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=J %s // J: -fno-signed-char -// RUN: %clang_cl /Ofoo -### -- %s 2>&1 | FileCheck -check-prefix=O %s +// RUN: %clang_cl /Ofoo -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=O %s // O: /Ofoo -// RUN: %clang_cl /Ob0 -### -- %s 2>&1 | FileCheck -check-prefix=Ob0 %s +// RUN: %clang_cl /Ob0 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Ob0 %s // Ob0: -fno-inline -// RUN: %clang_cl /Ob2 -### -- %s 2>&1 | FileCheck -check-prefix=Ob2 %s -// RUN: %clang_cl /Odb2 -### -- %s 2>&1 | FileCheck -check-prefix=Ob2 %s -// RUN: %clang_cl /O2 /Ob2 -### -- %s 2>&1 | FileCheck -check-prefix=Ob2 %s +// RUN: %clang_cl /Ob2 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Ob2 %s +// RUN: %clang_cl /Odb2 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Ob2 %s +// RUN: %clang_cl /O2 /Ob2 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Ob2 %s // Ob2-NOT: warning: argument unused during compilation: '/O2' // Ob2: -finline-functions -// RUN: %clang_cl /Ob1 -### -- %s 2>&1 | FileCheck -check-prefix=Ob1 %s -// RUN: %clang_cl /Odb1 -### -- %s 2>&1 | FileCheck -check-prefix=Ob1 %s +// RUN: %clang_cl /Ob1 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Ob1 %s +// RUN: %clang_cl /Odb1 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Ob1 %s // Ob1: -finline-hint-functions -// RUN: %clang_cl /Od -### -- %s 2>&1 | FileCheck -check-prefix=Od %s +// RUN: %clang_cl /Od -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Od %s // Od: -O0 -// RUN: %clang_cl /Oi- /Oi -### -- %s 2>&1 | FileCheck -check-prefix=Oi %s +// RUN: %clang_cl /Oi- /Oi -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Oi %s // Oi-NOT: -fno-builtin -// RUN: %clang_cl /Oi- -### -- %s 2>&1 | FileCheck -check-prefix=Oi_ %s +// RUN: %clang_cl /Oi- -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Oi_ %s // Oi_: -fno-builtin -// RUN: %clang_cl /Os --target=i686-pc-windows-msvc -### -- %s 2>&1 | FileCheck -check-prefix=Os %s -// RUN: %clang_cl /Os --target=x86_64-pc-windows-msvc -### -- %s 2>&1 | FileCheck -check-prefix=Os %s +// RUN: %clang_cl /Os --target=i686-pc-windows-msvc -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Os %s +// RUN: %clang_cl /Os --target=x86_64-pc-windows-msvc -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Os %s // Os-NOT: -mdisable-fp-elim // Os: -momit-leaf-frame-pointer // Os: -Os -// RUN: %clang_cl /Ot --target=i686-pc-windows-msvc -### -- %s 2>&1 | FileCheck -check-prefix=Ot %s -// RUN: %clang_cl /Ot --target=x86_64-pc-windows-msvc -### -- %s 2>&1 | FileCheck -check-prefix=Ot %s +// RUN: %clang_cl /Ot --target=i686-pc-windows-msvc -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Ot %s +// RUN: %clang_cl /Ot --target=x86_64-pc-windows-msvc -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Ot %s // Ot-NOT: -mdisable-fp-elim // Ot: -momit-leaf-frame-pointer // Ot: -O2 -// RUN: %clang_cl /Ox --target=i686-pc-windows-msvc -### -- %s 2>&1 | FileCheck -check-prefix=Ox %s -// RUN: %clang_cl /Ox --target=x86_64-pc-windows-msvc -### -- %s 2>&1 | FileCheck -check-prefix=Ox %s +// RUN: %clang_cl /Ox --target=i686-pc-windows-msvc -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Ox %s +// RUN: %clang_cl /Ox --target=x86_64-pc-windows-msvc -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Ox %s // Ox-NOT: -mdisable-fp-elim // Ox: -momit-leaf-frame-pointer // Ox: -O2 -// RUN: %clang_cl --target=i686-pc-win32 /O2sy- -### -- %s 2>&1 | FileCheck -check-prefix=PR24003 %s +// RUN: %clang_cl --target=i686-pc-win32 /O2sy- -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=PR24003 %s // PR24003: -mdisable-fp-elim // PR24003: -momit-leaf-frame-pointer // PR24003: -Os -// RUN: %clang_cl --target=i686-pc-win32 -Werror /Oy- /O2 -### -- %s 2>&1 | FileCheck -check-prefix=Oy_2 %s +// RUN: %clang_cl --target=i686-pc-win32 -Werror /Oy- /O2 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Oy_2 %s // Oy_2: -momit-leaf-frame-pointer // Oy_2: -O2 // RUN: %clang_cl /Zs -Werror /Oy -- %s 2>&1 -// RUN: %clang_cl --target=i686-pc-win32 -Werror /Oy- -### -- %s 2>&1 | FileCheck -check-prefix=Oy_ %s +// RUN: %clang_cl --target=i686-pc-win32 -Werror /Oy- -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Oy_ %s // Oy_: -mdisable-fp-elim -// RUN: %clang_cl /Qvec -### -- %s 2>&1 | FileCheck -check-prefix=Qvec %s +// RUN: %clang_cl /Qvec -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Qvec %s // Qvec: -vectorize-loops -// RUN: %clang_cl /Qvec /Qvec- -### -- %s 2>&1 | FileCheck -check-prefix=Qvec_ %s +// RUN: %clang_cl /Qvec /Qvec- -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Qvec_ %s // Qvec_-NOT: -vectorize-loops -// RUN: %clang_cl /showIncludes -### -- %s 2>&1 | FileCheck -check-prefix=showIncludes %s +// RUN: %clang_cl /showIncludes -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=showIncludes %s // showIncludes: --show-includes -// RUN: %clang_cl /E /showIncludes -### -- %s 2>&1 | FileCheck -check-prefix=showIncludes_E %s -// RUN: %clang_cl /EP /showIncludes -### -- %s 2>&1 | FileCheck -check-prefix=showIncludes_E %s +// RUN: %clang_cl /E /showIncludes -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=showIncludes_E %s +// RUN: %clang_cl /EP /showIncludes -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=showIncludes_E %s // showIncludes_E: warning: argument unused during compilation: '--show-includes' // /source-charset: should warn on everything except UTF-8. -// RUN: %clang_cl /source-charset:utf-16 -### -- %s 2>&1 | FileCheck -check-prefix=source-charset-utf-16 %s +// RUN: %clang_cl /source-charset:utf-16 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=source-charset-utf-16 %s // source-charset-utf-16: invalid value 'utf-16' // /execution-charset: should warn on everything except UTF-8. -// RUN: %clang_cl /execution-charset:utf-16 -### -- %s 2>&1 | FileCheck -check-prefix=execution-charset-utf-16 %s +// RUN: %clang_cl /execution-charset:utf-16 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=execution-charset-utf-16 %s // execution-charset-utf-16: invalid value 'utf-16' // -// RUN: %clang_cl /Umymacro -### -- %s 2>&1 | FileCheck -check-prefix=U %s -// RUN: %clang_cl /U mymacro -### -- %s 2>&1 | FileCheck -check-prefix=U %s +// RUN: %clang_cl /Umymacro -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=U %s +// RUN: %clang_cl /U mymacro -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=U %s // U: "-U" "mymacro" -// RUN: %clang_cl /validate-charset -### -- %s 2>&1 | FileCheck -check-prefix=validate-charset %s +// RUN: %clang_cl /validate-charset -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=validate-charset %s // validate-charset: -Winvalid-source-encoding -// RUN: %clang_cl /validate-charset- -### -- %s 2>&1 | FileCheck -check-prefix=validate-charset_ %s +// RUN: %clang_cl /validate-charset- -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=validate-charset_ %s // validate-charset_: -Wno-invalid-source-encoding -// RUN: %clang_cl /vd2 -### -- %s 2>&1 | FileCheck -check-prefix=VD2 %s +// RUN: %clang_cl /vd2 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=VD2 %s // VD2: -vtordisp-mode=2 -// RUN: %clang_cl /vmg -### -- %s 2>&1 | FileCheck -check-prefix=VMG %s +// RUN: %clang_cl /vmg -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=VMG %s // VMG: "-fms-memptr-rep=virtual" -// RUN: %clang_cl /vmg /vms -### -- %s 2>&1 | FileCheck -check-prefix=VMS %s +// RUN: %clang_cl /vmg /vms -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=VMS %s // VMS: "-fms-memptr-rep=single" -// RUN: %clang_cl /vmg /vmm -### -- %s 2>&1 | FileCheck -check-prefix=VMM %s +// RUN: %clang_cl /vmg /vmm -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=VMM %s // VMM: "-fms-memptr-rep=multiple" -// RUN: %clang_cl /vmg /vmv -### -- %s 2>&1 | FileCheck -check-prefix=VMV %s +// RUN: %clang_cl /vmg /vmv -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=VMV %s // VMV: "-fms-memptr-rep=virtual" -// RUN: %clang_cl /vmg /vmb -### -- %s 2>&1 | FileCheck -check-prefix=VMB %s +// RUN: %clang_cl /vmg /vmb -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=VMB %s // VMB: '/vmg' not allowed with '/vmb' -// RUN: %clang_cl /vmg /vmm /vms -### -- %s 2>&1 | FileCheck -check-prefix=VMX %s +// RUN: %clang_cl /vmg /vmm /vms -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=VMX %s // VMX: '/vms' not allowed with '/vmm' -// RUN: %clang_cl /volatile:iso -### -- %s 2>&1 | FileCheck -check-prefix=VOLATILE-ISO %s +// RUN: %clang_cl /volatile:iso -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=VOLATILE-ISO %s // VOLATILE-ISO-NOT: "-fms-volatile" -// RUN: %clang_cl /volatile:ms -### -- %s 2>&1 | FileCheck -check-prefix=VOLATILE-MS %s +// RUN: %clang_cl /volatile:ms -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=VOLATILE-MS %s // VOLATILE-MS: "-fms-volatile" -// RUN: %clang_cl /W0 -### -- %s 2>&1 | FileCheck -check-prefix=W0 %s +// RUN: %clang_cl /W0 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=W0 %s // W0: -w -// RUN: %clang_cl /W1 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s -// RUN: %clang_cl /W2 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s -// RUN: %clang_cl /W3 -### -- %s 2>&1 | FileCheck -check-prefix=W1 %s -// RUN: %clang_cl /W4 -### -- %s 2>&1 | FileCheck -check-prefix=W4 %s -// RUN: %clang_cl /Wall -### -- %s 2>&1 | FileCheck -check-prefix=W4 %s +// RUN: %clang_cl /W1 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=W1 %s +// RUN: %clang_cl /W2 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=W1 %s +// RUN: %clang_cl /W3 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=W1 %s +// RUN: %clang_cl /W4 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=W4 %s +// RUN: %clang_cl /Wall -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=W4 %s // W1: -Wall // W4: -WCL4 -// RUN: %clang_cl /WX -### -- %s 2>&1 | FileCheck -check-prefix=WX %s +// RUN: %clang_cl /WX -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=WX %s // WX: -Werror -// RUN: %clang_cl /WX- -### -- %s 2>&1 | FileCheck -check-prefix=WX_ %s +// RUN: %clang_cl /WX- -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=WX_ %s // WX_: -Wno-error -// RUN: %clang_cl /w -### -- %s 2>&1 | FileCheck -check-prefix=w %s +// RUN: %clang_cl /w -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=w %s // w: -w -// RUN: %clang_cl /Zp -### -- %s 2>&1 | FileCheck -check-prefix=ZP %s +// RUN: %clang_cl /Zp -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=ZP %s // ZP: -fpack-struct=1 -// RUN: %clang_cl /Zp2 -### -- %s 2>&1 | FileCheck -check-prefix=ZP2 %s +// RUN: %clang_cl /Zp2 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=ZP2 %s // ZP2: -fpack-struct=2 -// RUN: %clang_cl /Zs -### -- %s 2>&1 | FileCheck -check-prefix=Zs %s +// RUN: %clang_cl /Zs -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Zs %s // Zs: -fsyntax-only -// RUN: %clang_cl /FIasdf.h -### -- %s 2>&1 | FileCheck -check-prefix=FI %s +// RUN: %clang_cl /FIasdf.h -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=FI %s // FI: "-include" "asdf.h" -// RUN: %clang_cl /FI asdf.h -### -- %s 2>&1 | FileCheck -check-prefix=FI_ %s +// RUN: %clang_cl /FI asdf.h -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=FI_ %s // FI_: "-include" "asdf.h" -// RUN: %clang_cl /TP /c -### -- %s 2>&1 | FileCheck -check-prefix=NO-GX %s +// RUN: %clang_cl /TP /c -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=NO-GX %s // NO-GX-NOT: "-fcxx-exceptions" "-fexceptions" -// RUN: %clang_cl /TP /c /GX -### -- %s 2>&1 | FileCheck -check-prefix=GX %s +// RUN: %clang_cl /TP /c /GX -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=GX %s // GX: "-fcxx-exceptions" "-fexceptions" -// RUN: %clang_cl /TP /c /GX /GX- -### -- %s 2>&1 | FileCheck -check-prefix=GX_ %s +// RUN: %clang_cl /TP /c /GX /GX- -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=GX_ %s // GX_-NOT: "-fcxx-exceptions" "-fexceptions" // We forward any unrecognized -W diagnostic options to cc1. -// RUN: %clang_cl -Wunused-pragmas -### -- %s 2>&1 | FileCheck -check-prefix=WJoined %s +// RUN: %clang_cl -Wunused-pragmas -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=WJoined %s // WJoined: "-cc1" // WJoined: "-Wunused-pragmas" // We recognize -f[no-]strict-aliasing. -// RUN: %clang_cl -c -### -- %s 2>&1 | FileCheck -check-prefix=DEFAULTSTRICT %s +// RUN: %clang_cl -c -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=DEFAULTSTRICT %s // DEFAULTSTRICT: "-relaxed-aliasing" -// RUN: %clang_cl -c -fstrict-aliasing -### -- %s 2>&1 | FileCheck -check-prefix=STRICT %s +// RUN: %clang_cl -c -fstrict-aliasing -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=STRICT %s // STRICT-NOT: "-relaxed-aliasing" -// RUN: %clang_cl -c -fno-strict-aliasing -### -- %s 2>&1 | FileCheck -check-prefix=NOSTRICT %s +// RUN: %clang_cl -c -fno-strict-aliasing -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=NOSTRICT %s // NOSTRICT: "-relaxed-aliasing" // We recognize -f[no-]delayed-template-parsing. -// RUN: %clang_cl -c -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDDEFAULT %s +// RUN: %clang_cl -c -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=DELAYEDDEFAULT %s // DELAYEDDEFAULT: "-fdelayed-template-parsing" -// RUN: %clang_cl -c -fdelayed-template-parsing -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDON %s +// RUN: %clang_cl -c -fdelayed-template-parsing -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=DELAYEDON %s // DELAYEDON: "-fdelayed-template-parsing" -// RUN: %clang_cl -c -fno-delayed-template-parsing -### -- %s 2>&1 | FileCheck -check-prefix=DELAYEDOFF %s +// RUN: %clang_cl -c -fno-delayed-template-parsing -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=DELAYEDOFF %s // DELAYEDOFF-NOT: "-fdelayed-template-parsing" // For some warning ids, we can map from MSVC warning to Clang warning. -// RUN: %clang_cl -wd4005 -wd4100 -wd4910 -wd4996 -### -- %s 2>&1 | FileCheck -check-prefix=Wno %s +// RUN: %clang_cl -wd4005 -wd4100 -wd4910 -wd4996 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Wno %s // Wno: "-cc1" // Wno: "-Wno-macro-redefined" // Wno: "-Wno-unused-parameter" @@ -341,7 +341,7 @@ // RUN: /wd1234 \ // RUN: /Zo \ // RUN: /Zo- \ -// RUN: -### -- %s 2>&1 | FileCheck -check-prefix=IGNORED %s +// RUN: -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=IGNORED %s // IGNORED-NOT: argument unused during compilation // IGNORED-NOT: no such file or directory // Don't confuse /openmp- with the /o flag: @@ -349,13 +349,13 @@ // Ignored options and compile-only options are ignored for link jobs. // RUN: touch %t.obj -// RUN: %clang_cl /nologo -### -- %t.obj 2>&1 | FileCheck -check-prefix=LINKUNUSED %s -// RUN: %clang_cl /Dfoo -### -- %t.obj 2>&1 | FileCheck -check-prefix=LINKUNUSED %s -// RUN: %clang_cl /MD -### -- %t.obj 2>&1 | FileCheck -check-prefix=LINKUNUSED %s +// RUN: %clang_cl /nologo -### -mno-comment-section -- %t.obj 2>&1 | FileCheck -check-prefix=LINKUNUSED %s +// RUN: %clang_cl /Dfoo -### -mno-comment-section -- %t.obj 2>&1 | FileCheck -check-prefix=LINKUNUSED %s +// RUN: %clang_cl /MD -### -mno-comment-section -- %t.obj 2>&1 | FileCheck -check-prefix=LINKUNUSED %s // LINKUNUSED-NOT: argument unused during compilation // Support ignoring warnings about unused arguments. -// RUN: %clang_cl /Abracadabra -Qunused-arguments -### -- %s 2>&1 | FileCheck -check-prefix=UNUSED %s +// RUN: %clang_cl /Abracadabra -Qunused-arguments -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=UNUSED %s // UNUSED-NOT: argument unused during compilation // Unsupported but parsed options. Check that we don't error on them. @@ -438,49 +438,49 @@ // RUN: -- %s 2>&1 // We support -Xclang for forwarding options to cc1. -// RUN: %clang_cl -Xclang hellocc1 -### -- %s 2>&1 | FileCheck -check-prefix=Xclang %s +// RUN: %clang_cl -Xclang hellocc1 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Xclang %s // Xclang: "-cc1" // Xclang: "hellocc1" // Files under /Users are often confused with the /U flag. (This could happen // for other flags too, but this is the one people run into.) -// RUN: %clang_cl /c /Users/me/myfile.c -### 2>&1 | FileCheck -check-prefix=SlashU %s +// RUN: %clang_cl /c /Users/me/myfile.c -### -mno-comment-section 2>&1 | FileCheck -check-prefix=SlashU %s // SlashU: warning: '/Users/me/myfile.c' treated as the '/U' option // SlashU: note: Use '--' to treat subsequent arguments as filenames // RTTI is on by default. /GR- controls -fno-rtti-data. -// RUN: %clang_cl /c /GR- -### -- %s 2>&1 | FileCheck -check-prefix=NoRTTI %s +// RUN: %clang_cl /c /GR- -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=NoRTTI %s // NoRTTI: "-fno-rtti-data" // NoRTTI-NOT: "-fno-rtti" -// RUN: %clang_cl /c /GR -### -- %s 2>&1 | FileCheck -check-prefix=RTTI %s +// RUN: %clang_cl /c /GR -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=RTTI %s // RTTI-NOT: "-fno-rtti-data" // RTTI-NOT: "-fno-rtti" // thread safe statics are off for versions < 19. -// RUN: %clang_cl /c -### -fms-compatibility-version=18 -- %s 2>&1 | FileCheck -check-prefix=NoThreadSafeStatics %s -// RUN: %clang_cl /Zc:threadSafeInit /Zc:threadSafeInit- /c -### -- %s 2>&1 | FileCheck -check-prefix=NoThreadSafeStatics %s +// RUN: %clang_cl /c -### -mno-comment-section -fms-compatibility-version=18 -- %s 2>&1 | FileCheck -check-prefix=NoThreadSafeStatics %s +// RUN: %clang_cl /Zc:threadSafeInit /Zc:threadSafeInit- /c -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=NoThreadSafeStatics %s // NoThreadSafeStatics: "-fno-threadsafe-statics" -// RUN: %clang_cl /Zc:threadSafeInit /c -### -- %s 2>&1 | FileCheck -check-prefix=ThreadSafeStatics %s +// RUN: %clang_cl /Zc:threadSafeInit /c -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=ThreadSafeStatics %s // ThreadSafeStatics-NOT: "-fno-threadsafe-statics" -// RUN: %clang_cl /Zi /c -### -- %s 2>&1 | FileCheck -check-prefix=Zi %s +// RUN: %clang_cl /Zi /c -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Zi %s // Zi: "-gcodeview" // Zi: "-debug-info-kind=limited" -// RUN: %clang_cl /Z7 /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7 %s +// RUN: %clang_cl /Z7 /c -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Z7 %s // Z7: "-gcodeview" // Z7: "-debug-info-kind=limited" -// RUN: %clang_cl /Zd /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7GMLT %s +// RUN: %clang_cl /Zd /c -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Z7GMLT %s // Z7GMLT: "-gcodeview" // Z7GMLT: "-debug-info-kind=line-tables-only" -// RUN: %clang_cl -gline-tables-only /c -### -- %s 2>&1 | FileCheck -check-prefix=ZGMLT %s +// RUN: %clang_cl -gline-tables-only /c -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=ZGMLT %s // ZGMLT: "-gcodeview" // ZGMLT: "-debug-info-kind=line-tables-only" -// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=BreproDefault %s +// RUN: %clang_cl /c -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=BreproDefault %s // BreproDefault: "-mincremental-linker-compatible" // RUN: %clang_cl /Brepro- /Brepro /c '-###' -- %s 2>&1 | FileCheck -check-prefix=Brepro %s @@ -497,38 +497,38 @@ // Args.hasArg to test whether a boolean flag is present without caring // where it appeared. And for this test, it appeared to the left of -gdwarf // which made it "win". This test could not detect that bug. -// RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s +// RUN: %clang_cl /Z7 -gdwarf /c -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s // Z7_gdwarf: "-gcodeview" // Z7_gdwarf: "-debug-info-kind=limited" // Z7_gdwarf: "-dwarf-version=4" -// RUN: %clang_cl -fmsc-version=1800 -TP -### -- %s 2>&1 | FileCheck -check-prefix=CXX11 %s +// RUN: %clang_cl -fmsc-version=1800 -TP -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=CXX11 %s // CXX11: -std=c++11 -// RUN: %clang_cl -fmsc-version=1900 -TP -### -- %s 2>&1 | FileCheck -check-prefix=CXX14 %s +// RUN: %clang_cl -fmsc-version=1900 -TP -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=CXX14 %s // CXX14: -std=c++14 -// RUN: %clang_cl -fmsc-version=1900 -TP -std:c++14 -### -- %s 2>&1 | FileCheck -check-prefix=STDCXX14 %s +// RUN: %clang_cl -fmsc-version=1900 -TP -std:c++14 -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=STDCXX14 %s // STDCXX14: -std=c++14 -// RUN: %clang_cl -fmsc-version=1900 -TP -std:c++latest -### -- %s 2>&1 | FileCheck -check-prefix=STDCXXLATEST %s +// RUN: %clang_cl -fmsc-version=1900 -TP -std:c++latest -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=STDCXXLATEST %s // STDCXXLATEST: -std=c++1z -// RUN: env CL="/Gy" %clang_cl -### -- %s 2>&1 | FileCheck -check-prefix=ENV-CL %s +// RUN: env CL="/Gy" %clang_cl -### -mno-comment-section -- %s 2>&1 | FileCheck -check-prefix=ENV-CL %s // ENV-CL: "-ffunction-sections" -// RUN: env CL="/Gy" _CL_="/Gy- -- %s" %clang_cl -### 2>&1 | FileCheck -check-prefix=ENV-_CL_ %s +// RUN: env CL="/Gy" _CL_="/Gy- -- %s" %clang_cl -### -mno-comment-section 2>&1 | FileCheck -check-prefix=ENV-_CL_ %s // ENV-_CL_-NOT: "-ffunction-sections" // RUN: env CL="%s" _CL_="%s" not %clang --rsp-quoting=windows -c -// RUN: %clang_cl -### /c -flto -- %s 2>&1 | FileCheck -check-prefix=LTO %s +// RUN: %clang_cl -### -mno-comment-section /c -flto -- %s 2>&1 | FileCheck -check-prefix=LTO %s // LTO: -flto -// RUN: %clang_cl -### /c -flto=thin -- %s 2>&1 | FileCheck -check-prefix=LTO-THIN %s +// RUN: %clang_cl -### -mno-comment-section /c -flto=thin -- %s 2>&1 | FileCheck -check-prefix=LTO-THIN %s // LTO-THIN: -flto=thin -// RUN: %clang_cl -### -Fe%t.exe -entry:main -flto -- %s 2>&1 | FileCheck -check-prefix=LTO-WITHOUT-LLD %s +// RUN: %clang_cl -### -mno-comment-section -Fe%t.exe -entry:main -flto -- %s 2>&1 | FileCheck -check-prefix=LTO-WITHOUT-LLD %s // LTO-WITHOUT-LLD: LTO requires -fuse-ld=lld // Accept "core" clang options. Index: test/Driver/cl-pch.cpp =================================================================== --- test/Driver/cl-pch.cpp +++ test/Driver/cl-pch.cpp @@ -2,7 +2,7 @@ // command-line option, e.g. on Mac where %s is commonly under /Users. // /Yc -// RUN: %clang_cl -Werror /Ycpchfile.h /FIpchfile.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Ycpchfile.h /FIpchfile.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YC %s // 1. Build .pch file. // CHECK-YC: cc1 @@ -19,7 +19,7 @@ // /Yc /Fo // /Fo overrides the .obj output filename, but not the .pch filename -// RUN: %clang_cl -Werror /Fomyobj.obj /Ycpchfile.h /FIpchfile.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Fomyobj.obj /Ycpchfile.h /FIpchfile.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YCO %s // 1. Build .pch file. // CHECK-YCO: cc1 @@ -36,13 +36,13 @@ // /Yc /Y- // /Y- disables pch generation -// RUN: %clang_cl -Werror /Y- /Ycpchfile.h /FIpchfile.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Y- /Ycpchfile.h /FIpchfile.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YC-Y_ %s // CHECK-YC-Y_-NOT: -emit-pch // CHECK-YC-Y_-NOT: -include-pch // /Yu -// RUN: %clang_cl -Werror /Yupchfile.h /FIpchfile.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Yupchfile.h /FIpchfile.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YU %s // Use .pch file, but don't build it. // CHECK-YU-NOT: -emit-pch @@ -52,13 +52,13 @@ // CHECK-YU: pchfile.pch // /Yu /Y- -// RUN: %clang_cl -Werror /Y- /Yupchfile.h /FIpchfile.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Y- /Yupchfile.h /FIpchfile.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YU-Y_ %s // CHECK-YU-Y_-NOT: -emit-pch // CHECK-YU-Y_-NOT: -include-pch // /Yc /Yu -- /Yc overrides /Yc if they both refer to the same file -// RUN: %clang_cl -Werror /Ycpchfile.h /Yupchfile.h /FIpchfile.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Ycpchfile.h /Yupchfile.h /FIpchfile.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YC-YU %s // 1. Build .pch file. // CHECK-YC-YU: cc1 @@ -73,17 +73,17 @@ // If /Yc /Yu refer to different files, semantics are pretty wonky. Since this // doesn't seem like something that's important in practice, just punt for now. -// RUN: %clang_cl -Werror /Ycfoo1.h /Yufoo2.h /FIfoo1.h /FIfoo2.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Ycfoo1.h /Yufoo2.h /FIfoo1.h /FIfoo2.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YC-YU-MISMATCH %s // CHECK-YC-YU-MISMATCH: error: support for '/Yc' and '/Yu' with different filenames not implemented yet; flags ignored // Similarly, punt on /Yc with more than one input file. -// RUN: %clang_cl -Werror /Ycfoo1.h /FIfoo1.h /c -### -- %s %s 2>&1 \ +// RUN: %clang_cl -Werror /Ycfoo1.h /FIfoo1.h /c -### -mno-comment-section -- %s %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YC-MULTIINPUT %s // CHECK-YC-MULTIINPUT: error: support for '/Yc' with more than one source file not implemented yet; flag ignored // /Yc /Yu /Y- -// RUN: %clang_cl -Werror /Ycpchfile.h /Yupchfile.h /FIpchfile.h /Y- /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Ycpchfile.h /Yupchfile.h /FIpchfile.h /Y- /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YC-YU-Y_ %s // CHECK-YC-YU-Y_-NOT: -emit-pch // CHECK-YC-YU-Y_-NOT: -include-pch @@ -91,35 +91,35 @@ // Test computation of pch filename in various cases. // /Yu /Fpout.pch => out.pch is filename -// RUN: %clang_cl -Werror /Yupchfile.h /FIpchfile.h /Fpout.pch /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Yupchfile.h /FIpchfile.h /Fpout.pch /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YUFP1 %s // Use .pch file, but don't build it. // CHECK-YUFP1: -include-pch // CHECK-YUFP1: out.pch // /Yu /Fpout => out.pch is filename (.pch gets added if no extension present) -// RUN: %clang_cl -Werror /Yupchfile.h /FIpchfile.h /Fpout.pch /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Yupchfile.h /FIpchfile.h /Fpout.pch /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YUFP2 %s // Use .pch file, but don't build it. // CHECK-YUFP2: -include-pch // CHECK-YUFP2: out.pch // /Yu /Fpout.bmp => out.bmp is filename (.pch not added when extension present) -// RUN: %clang_cl -Werror /Yupchfile.h /FIpchfile.h /Fpout.bmp /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Yupchfile.h /FIpchfile.h /Fpout.bmp /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YUFP3 %s // Use .pch file, but don't build it. // CHECK-YUFP3: -include-pch // CHECK-YUFP3: out.bmp // /Yusub/dir.h => sub/dir.pch -// RUN: %clang_cl -Werror /Yusub/pchfile.h /FIsub/pchfile.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Yusub/pchfile.h /FIsub/pchfile.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YUFP4 %s // Use .pch file, but don't build it. // CHECK-YUFP4: -include-pch // CHECK-YUFP4: sub/pchfile.pch // /Yudir.h /Isub => dir.pch -// RUN: %clang_cl -Werror /Yupchfile.h /FIpchfile.h /Isub /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Yupchfile.h /FIpchfile.h /Isub /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YUFP5 %s // Use .pch file, but don't build it. // CHECK-YUFP5: -include-pch @@ -130,7 +130,7 @@ // Spot-check one use of /Fp with /Yc too, else trust the /Yu test cases above // also all assume to /Yc. -// RUN: %clang_cl -Werror /Ycpchfile.h /FIpchfile.h /Fpsub/file.pch /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Ycpchfile.h /FIpchfile.h /Fpsub/file.pch /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YCFP %s // 1. Build .pch file. // CHECK-YCFP: cc1 @@ -146,7 +146,7 @@ // /Ycfoo2.h /FIfoo1.h /FIfoo2.h /FIfoo3.h // => foo1 and foo2 go into pch, foo3 into main compilation // /Yc -// RUN: %clang_cl -Werror /Ycfoo2.h /FIfoo1.h /FIfoo2.h /FIfoo3.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Ycfoo2.h /FIfoo1.h /FIfoo2.h /FIfoo3.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YCFIFIFI %s // 1. Build .pch file: Includes foo1.h (but NOT foo3.h) and compiles foo2.h // CHECK-YCFIFIFI: cc1 @@ -172,7 +172,7 @@ // /Yucfoo2.h /FIfoo1.h /FIfoo2.h /FIfoo3.h // => foo1 foo2 filtered out, foo3 into main compilation -// RUN: %clang_cl -Werror /Yufoo2.h /FIfoo1.h /FIfoo2.h /FIfoo3.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Yufoo2.h /FIfoo1.h /FIfoo2.h /FIfoo3.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YUFIFIFI %s // Use .pch file, but don't build it. // CHECK-YUFIFIFI-NOT: -emit-pch @@ -186,10 +186,10 @@ // CHECK-YUFIFIFI: foo3.h // FIXME: Implement support for /Ycfoo.h / /Yufoo.h without /FIfoo.h -// RUN: %clang_cl -Werror /Ycfoo.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Ycfoo.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YC-NOFI %s // CHECK-YC-NOFI: error: support for '/Yc' without a corresponding /FI flag not implemented yet; flag ignored -// RUN: %clang_cl -Werror /Yufoo.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Yufoo.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YU-NOFI %s // CHECK-YU-NOFI: error: support for '/Yu' without a corresponding /FI flag not implemented yet; flag ignored @@ -202,17 +202,17 @@ // these test cases all should stay failures as they fail with cl.exe. // Check that ./ isn't canonicalized away. -// RUN: %clang_cl -Werror /Ycpchfile.h /FI./pchfile.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Ycpchfile.h /FI./pchfile.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YC-I1 %s // CHECK-YC-I1: support for '/Yc' without a corresponding /FI flag not implemented yet; flag ignored // Check that ./ isn't canonicalized away. -// RUN: %clang_cl -Werror /Yc./pchfile.h /FIpchfile.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Yc./pchfile.h /FIpchfile.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YC-I2 %s // CHECK-YC-I2: support for '/Yc' without a corresponding /FI flag not implemented yet; flag ignored // With an actual /I argument. -// RUN: %clang_cl -Werror /Ifoo /Ycpchfile.h /FIpchfile.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Ifoo /Ycpchfile.h /FIpchfile.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YC-I3 %s // 1. This writes pchfile.pch into the root dir, even if this will pick up // foo/pchfile.h @@ -227,17 +227,17 @@ // CHECK-YC-I3: pchfile.pch // Check that ./ isn't canonicalized away for /Yu either. -// RUN: %clang_cl -Werror /Yupchfile.h /FI./pchfile.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Yupchfile.h /FI./pchfile.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YU-I1 %s // CHECK-YU-I1: support for '/Yu' without a corresponding /FI flag not implemented yet; flag ignored // But /FIfoo/bar.h /Ycfoo\bar.h does work, as does /FIfOo.h /Ycfoo.H // FIXME: This part isn't implemented yet. The following two tests should not // show an error but do regular /Yu handling. -// RUN: %clang_cl -Werror /YupchFILE.h /FI./pchfile.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /YupchFILE.h /FI./pchfile.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YU-CASE %s // CHECK-YU-CASE: support for '/Yu' without a corresponding /FI flag not implemented yet; flag ignored -// RUN: %clang_cl -Werror /Yu./pchfile.h /FI.\pchfile.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Yu./pchfile.h /FI.\pchfile.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YU-SLASH %s // CHECK-YU-SLASH: support for '/Yu' without a corresponding /FI flag not implemented yet; flag ignored @@ -248,7 +248,7 @@ // Interaction with /fallback // /Yc /fallback => /Yc not passed on (but /FI is) -// RUN: %clang_cl -Werror /Ycpchfile.h /FIpchfile.h /Fpfoo.pch /fallback /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Ycpchfile.h /FIpchfile.h /Fpfoo.pch /fallback /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YC-FALLBACK %s // Note that in /fallback builds, if creation of the pch fails the main compile // does still run so that /fallback can have an effect (this part is not tested) @@ -264,7 +264,7 @@ // CHECK-YC-FALLBACK-NOT: /Fpfoo.pch // /Yu /fallback => /Yu not passed on (but /FI is) -// RUN: %clang_cl -Werror /Yupchfile.h /FIpchfile.h /Fpfoo.pch /fallback /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /Yupchfile.h /FIpchfile.h /Fpfoo.pch /fallback /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YU-FALLBACK %s // CHECK-YU-FALLBACK-NOT: -emit-pch // CHECK-YU-FALLBACK: cc1 @@ -281,7 +281,7 @@ // /FI without /Yu => pch file not used, even if it exists (different from // -include, which picks up .gch files if they exist). // RUN: touch %t.pch -// RUN: %clang_cl -Werror /FI%t.pch /Fp%t.pch /c -### -- %s 2>&1 \ +// RUN: %clang_cl -Werror /FI%t.pch /Fp%t.pch /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-FI %s // CHECK-FI-NOT: -include-pch // CHECK-FI: -include @@ -289,7 +289,7 @@ // Test interaction of /Yc with language mode flags. // If /TC changes the input language to C, a c pch file should be produced. -// RUN: %clang_cl /TC -Werror /Ycpchfile.h /FIpchfile.h /c -### -- %s 2>&1 \ +// RUN: %clang_cl /TC -Werror /Ycpchfile.h /FIpchfile.h /c -### -mno-comment-section -- %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YCTC %s // CHECK-YCTC: cc1 // CHECK-YCTC: -emit-pch @@ -299,7 +299,7 @@ // CHECK-YCTC: "c" // Also check lower-case /Tc variant. -// RUN: %clang_cl -Werror /Ycpchfile.h /FIpchfile.h /c -### /Tc%s 2>&1 \ +// RUN: %clang_cl -Werror /Ycpchfile.h /FIpchfile.h /c -### -mno-comment-section /Tc%s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-YCTc %s // CHECK-YCTc: cc1 // CHECK-YCTc: -emit-pch @@ -309,12 +309,12 @@ // CHECK-YCTc: "c" // Don't crash when a non-source file is passed. -// RUN: %clang_cl -Werror /Ycpchfile.h /FIpchfile.h /c -### -- %S/Inputs/file.prof 2>&1 \ +// RUN: %clang_cl -Werror /Ycpchfile.h /FIpchfile.h /c -### -mno-comment-section -- %S/Inputs/file.prof 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-NoSource %s // CHECK-NoSource: file.prof:{{.*}}input unused // ...but if an explicit flag turns the file into a source file, handle it: -// RUN: %clang_cl /TP -Werror /Ycpchfile.h /FIpchfile.h /c -### -- %S/Inputs/file.prof 2>&1 \ +// RUN: %clang_cl /TP -Werror /Ycpchfile.h /FIpchfile.h /c -### -mno-comment-section -- %S/Inputs/file.prof 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-NoSourceTP %s // CHECK-NoSourceTP: cc1 // CHECK-NoSourceTP: -emit-pch Index: test/Driver/clang_f_opts.c =================================================================== --- test/Driver/clang_f_opts.c +++ test/Driver/clang_f_opts.c @@ -1,7 +1,7 @@ // REQUIRES: clang-driver -// RUN: %clang -### -S -fasm -fblocks -fbuiltin -fno-math-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fmath-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fsplit-stack %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s -// RUN: %clang -### -S -fasm -fblocks -fbuiltin -fno-math-errno -fcommon -fpascal-strings -fno-asm -fno-blocks -fno-builtin -fmath-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-enums -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s +// RUN: %clang -### -mno-comment-section -S -fasm -fblocks -fbuiltin -fno-math-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fmath-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fsplit-stack %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s +// RUN: %clang -### -mno-comment-section -S -fasm -fblocks -fbuiltin -fno-math-errno -fcommon -fpascal-strings -fno-asm -fno-blocks -fno-builtin -fmath-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-enums -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s // CHECK-OPTIONS1: -split-stacks // CHECK-OPTIONS1: -fgnu-keywords @@ -16,104 +16,104 @@ // CHECK-OPTIONS2: -fno-common // CHECK-OPTIONS2: -fno-show-source-location -// RUN: %clang -### -S -Wwrite-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS1 %s +// RUN: %clang -### -mno-comment-section -S -Wwrite-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS1 %s // WRITE-STRINGS1: -fconst-strings -// RUN: %clang -### -S -Wwrite-strings -Wno-write-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS2 %s +// RUN: %clang -### -mno-comment-section -S -Wwrite-strings -Wno-write-strings %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS2 %s // WRITE-STRINGS2-NOT: -fconst-strings -// RUN: %clang -### -S -Wwrite-strings -w %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS3 %s +// RUN: %clang -### -mno-comment-section -S -Wwrite-strings -w %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS3 %s // WRITE-STRINGS3-NOT: -fconst-strings -// RUN: %clang -### -x c++ -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s -// RUN: %clang -### -x c++ -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s -// RUN: %clang -### -x c++ -c -Wno-deprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s -// RUN: %clang -### -x c++ -c -Wno-deprecated -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s -// RUN: %clang -### -x c++ -c -w %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s -// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s -// RUN: %clang -### -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s +// RUN: %clang -### -mno-comment-section -x c++ -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s +// RUN: %clang -### -mno-comment-section -x c++ -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s +// RUN: %clang -### -mno-comment-section -x c++ -c -Wno-deprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s +// RUN: %clang -### -mno-comment-section -x c++ -c -Wno-deprecated -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s +// RUN: %clang -### -mno-comment-section -x c++ -c -w %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s +// RUN: %clang -### -mno-comment-section -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s +// RUN: %clang -### -mno-comment-section -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s // DEPRECATED-ON-CHECK: -fdeprecated-macro // DEPRECATED-OFF-CHECK-NOT: -fdeprecated-macro -// RUN: %clang -### -S -ffp-contract=fast %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-FAST-CHECK %s -// RUN: %clang -### -S -ffast-math %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-FAST-CHECK %s -// RUN: %clang -### -S -ffp-contract=off %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-OFF-CHECK %s +// RUN: %clang -### -mno-comment-section -S -ffp-contract=fast %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-FAST-CHECK %s +// RUN: %clang -### -mno-comment-section -S -ffast-math %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-FAST-CHECK %s +// RUN: %clang -### -mno-comment-section -S -ffp-contract=off %s 2>&1 | FileCheck -check-prefix=FP-CONTRACT-OFF-CHECK %s // FP-CONTRACT-FAST-CHECK: -ffp-contract=fast // FP-CONTRACT-OFF-CHECK: -ffp-contract=off -// RUN: %clang -### -S -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s -// RUN: %clang -### -S -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s -// RUN: %clang -### -S -fno-unroll-loops -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s -// RUN: %clang -### -S -funroll-loops -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s +// RUN: %clang -### -mno-comment-section -S -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s +// RUN: %clang -### -mno-comment-section -S -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s +// RUN: %clang -### -mno-comment-section -S -fno-unroll-loops -funroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-UNROLL-LOOPS %s +// RUN: %clang -### -mno-comment-section -S -funroll-loops -fno-unroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-UNROLL-LOOPS %s // CHECK-UNROLL-LOOPS: "-funroll-loops" // CHECK-NO-UNROLL-LOOPS: "-fno-unroll-loops" -// RUN: %clang -### -S -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s -// RUN: %clang -### -S -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s -// RUN: %clang -### -S -fno-reroll-loops -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s -// RUN: %clang -### -S -freroll-loops -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s +// RUN: %clang -### -mno-comment-section -S -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s +// RUN: %clang -### -mno-comment-section -S -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s +// RUN: %clang -### -mno-comment-section -S -fno-reroll-loops -freroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-REROLL-LOOPS %s +// RUN: %clang -### -mno-comment-section -S -freroll-loops -fno-reroll-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-REROLL-LOOPS %s // CHECK-REROLL-LOOPS: "-freroll-loops" // CHECK-NO-REROLL-LOOPS-NOT: "-freroll-loops" -// RUN: %clang -### -S -fprofile-sample-use=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-SAMPLE-PROFILE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-sample-use=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-SAMPLE-PROFILE %s // CHECK-SAMPLE-PROFILE: "-fprofile-sample-use={{.*}}/file.prof" -// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s +// RUN: %clang -### -mno-comment-section -S -fauto-profile=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s // CHECK-AUTO-PROFILE: "-fprofile-sample-use={{.*}}/file.prof" -// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof -fno-profile-sample-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-AUTO-PROFILE %s -// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof -fno-auto-profile %s 2>&1 | FileCheck -check-prefix=CHECK-NO-AUTO-PROFILE %s +// RUN: %clang -### -mno-comment-section -S -fauto-profile=%S/Inputs/file.prof -fno-profile-sample-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-AUTO-PROFILE %s +// RUN: %clang -### -mno-comment-section -S -fauto-profile=%S/Inputs/file.prof -fno-auto-profile %s 2>&1 | FileCheck -check-prefix=CHECK-NO-AUTO-PROFILE %s // CHECK-NO-AUTO-PROFILE-NOT: "-fprofile-sample-use={{.*}}/file.prof" -// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof -fno-profile-sample-use -fauto-profile %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s -// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof -fno-auto-profile -fprofile-sample-use %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s +// RUN: %clang -### -mno-comment-section -S -fauto-profile=%S/Inputs/file.prof -fno-profile-sample-use -fauto-profile %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s +// RUN: %clang -### -mno-comment-section -S -fauto-profile=%S/Inputs/file.prof -fno-auto-profile -fprofile-sample-use %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s -// RUN: %clang -### -S -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-ARCS %s -// RUN: %clang -### -S -fno-profile-arcs -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-ARCS %s -// RUN: %clang -### -S -fno-profile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-ARCS %s -// RUN: %clang -### -S -fprofile-arcs -fno-profile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-ARCS %s +// RUN: %clang -### -mno-comment-section -S -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-ARCS %s +// RUN: %clang -### -mno-comment-section -S -fno-profile-arcs -fprofile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-ARCS %s +// RUN: %clang -### -mno-comment-section -S -fno-profile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-ARCS %s +// RUN: %clang -### -mno-comment-section -S -fprofile-arcs -fno-profile-arcs %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-ARCS %s // CHECK-PROFILE-ARCS: "-femit-coverage-data" // CHECK-NO-PROFILE-ARCS-NOT: "-femit-coverage-data" -// RUN: %clang -### -S -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR-UNUSED %s -// RUN: %clang -### -S -ftest-coverage -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR-UNUSED %s -// RUN: %clang -### -S -fprofile-arcs -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR %s -// RUN: %clang -### -S --coverage -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR %s -// RUN: %clang -### -S -fprofile-arcs -fno-profile-arcs -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR-NEITHER %s +// RUN: %clang -### -mno-comment-section -S -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR-UNUSED %s +// RUN: %clang -### -mno-comment-section -S -ftest-coverage -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR-UNUSED %s +// RUN: %clang -### -mno-comment-section -S -fprofile-arcs -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR %s +// RUN: %clang -### -mno-comment-section -S --coverage -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR %s +// RUN: %clang -### -mno-comment-section -S -fprofile-arcs -fno-profile-arcs -fprofile-dir=abc %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DIR-NEITHER %s // CHECK-PROFILE-DIR: "-coverage-data-file" "abc // CHECK-PROFILE-DIR-UNUSED: argument unused // CHECK-PROFILE-DIR-UNUSED-NOT: "-coverage-data-file" "abc // CHECK-PROFILE-DIR-NEITHER-NOT: argument unused -// RUN: %clang -### -S -fprofile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-LLVM %s -// RUN: %clang -### -S -fprofile-instr-generate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE %s -// RUN: %clang -### -S -fprofile-generate=/some/dir %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-DIR %s -// RUN: %clang -### -S -fprofile-instr-generate=/tmp/somefile.profraw %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-FILE %s -// RUN: %clang -### -S -fprofile-generate -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-generate -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-generate -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-generate -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-instr-generate -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-instr-generate -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-instr-generate -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-instr-generate -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-instr-generate=file -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-instr-generate=file -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-instr-generate=file -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-instr-generate=file -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-generate=dir -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-generate=dir -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-generate=dir -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-generate=dir -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s -// RUN: %clang -### -S -fprofile-instr-generate=file -fno-profile-instr-generate %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-GEN %s -// RUN: %clang -### -S -fprofile-instr-generate -fprofile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GENERATE %s -// RUN: %clang -### -S -fprofile-instr-generate -fprofile-generate=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GENERATE %s -// RUN: %clang -### -S -fprofile-generate=dir -fno-profile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-GEN %s -// RUN: %clang -### -S -fprofile-instr-use=file -fno-profile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s -// RUN: %clang -### -S -fprofile-instr-use=file -fno-profile-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s -// RUN: %clang -### -S -fprofile-use=file -fno-profile-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s -// RUN: %clang -### -S -fprofile-use=file -fno-profile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s -// RUN: %clang -### -S -fcoverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-COVERAGE-AND-GEN %s -// RUN: %clang -### -S -fcoverage-mapping -fno-coverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-COVERAGE %s -// RUN: %clang -### -S -fprofile-instr-generate -fcoverage-mapping -fno-coverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-COVERAGE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-LLVM %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-generate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-generate=/some/dir %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-DIR %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-generate=/tmp/somefile.profraw %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-GENERATE-FILE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-generate -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-generate -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-generate -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-generate -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-generate -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-generate -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-generate -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-generate -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-generate=file -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-generate=file -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-generate=file -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-generate=file -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-generate=dir -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-generate=dir -fprofile-use=dir %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-generate=dir -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-generate=dir -fprofile-instr-use=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GEN-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-generate=file -fno-profile-instr-generate %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-GEN %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-generate -fprofile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GENERATE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-generate -fprofile-generate=file %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-GENERATE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-generate=dir -fno-profile-generate %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-GEN %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-use=file -fno-profile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-use=file -fno-profile-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-use=file -fno-profile-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-use=file -fno-profile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-USE %s +// RUN: %clang -### -mno-comment-section -S -fcoverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-COVERAGE-AND-GEN %s +// RUN: %clang -### -mno-comment-section -S -fcoverage-mapping -fno-coverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-COVERAGE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-generate -fcoverage-mapping -fno-coverage-mapping %s 2>&1 | FileCheck -check-prefix=CHECK-DISABLE-COVERAGE %s // CHECK-PROFILE-GENERATE: "-fprofile-instrument=clang" // CHECK-PROFILE-GENERATE-LLVM: "-fprofile-instrument=llvm" // CHECK-PROFILE-GENERATE-DIR: "-fprofile-instrument-path=/some/dir{{/|\\\\}}{{.*}}" @@ -125,93 +125,93 @@ // CHECK-COVERAGE-AND-GEN: '-fcoverage-mapping' only allowed with '-fprofile-instr-generate' // CHECK-DISABLE-COVERAGE-NOT: "-fcoverage-mapping" -// RUN: %clang -### -S -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s -// RUN: %clang -### -S -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-use %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-use %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE %s // RUN: mkdir -p %t.d/some/dir -// RUN: %clang -### -S -fprofile-use=%t.d/some/dir %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-DIR %s -// RUN: %clang -### -S -fprofile-instr-use=/tmp/somefile.prof %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-FILE %s +// RUN: %clang -### -mno-comment-section -S -fprofile-use=%t.d/some/dir %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-DIR %s +// RUN: %clang -### -mno-comment-section -S -fprofile-instr-use=/tmp/somefile.prof %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-USE-FILE %s // CHECK-PROFILE-USE: "-fprofile-instrument-use-path=default.profdata" // CHECK-PROFILE-USE-DIR: "-fprofile-instrument-use-path={{.*}}.d/some/dir{{/|\\\\}}default.profdata" // CHECK-PROFILE-USE-FILE: "-fprofile-instrument-use-path=/tmp/somefile.prof" -// RUN: %clang -### -S -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s -// RUN: %clang -### -S -fno-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s -// RUN: %clang -### -S -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s -// RUN: %clang -### -S -fvectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s -// RUN: %clang -### -S -ftree-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s -// RUN: %clang -### -S -fno-tree-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s -// RUN: %clang -### -S -fno-tree-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s -// RUN: %clang -### -S -ftree-vectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s -// RUN: %clang -### -S -O %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s -// RUN: %clang -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s -// RUN: %clang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s -// RUN: %clang -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s -// RUN: %clang -### -S -fno-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s -// RUN: %clang -### -S -O1 -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s -// RUN: %clang -### -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s -// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s -// RUN: %clang -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s -// RUN: %clang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s -// RUN: %clang -### -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -fno-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -fvectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -ftree-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -fno-tree-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -fno-tree-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -ftree-vectorize -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -O %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -fno-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -O1 -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s // CHECK-VECTORIZE: "-vectorize-loops" // CHECK-NO-VECTORIZE-NOT: "-vectorize-loops" -// RUN: %clang -### -S -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s -// RUN: %clang -### -S -fno-slp-vectorize -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s -// RUN: %clang -### -S -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s -// RUN: %clang -### -S -fslp-vectorize -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s -// RUN: %clang -### -S -ftree-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s -// RUN: %clang -### -S -fno-tree-slp-vectorize -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s -// RUN: %clang -### -S -fno-tree-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s -// RUN: %clang -### -S -ftree-slp-vectorize -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s -// RUN: %clang -### -S -O %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s -// RUN: %clang -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s -// RUN: %clang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s -// RUN: %clang -### -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s -// RUN: %clang -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s -// RUN: %clang -### -S -fno-slp-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s -// RUN: %clang -### -S -O1 -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s -// RUN: %clang -### -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s -// RUN: %clang -### -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s -// RUN: %clang -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s -// RUN: %clang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -fno-slp-vectorize -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -fslp-vectorize -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -ftree-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -fno-tree-slp-vectorize -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -fno-tree-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -ftree-slp-vectorize -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -O %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -fno-slp-vectorize -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -O1 -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -Ofast %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s +// RUN: %clang -### -mno-comment-section -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s // CHECK-SLP-VECTORIZE: "-vectorize-slp" // CHECK-NO-SLP-VECTORIZE-NOT: "-vectorize-slp" -// RUN: %clang -### -S -fslp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE-AGG %s -// RUN: %clang -### -S -fno-slp-vectorize-aggressive -fslp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE-AGG %s -// RUN: %clang -### -S -fno-slp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE-AGG %s -// RUN: %clang -### -S -fslp-vectorize-aggressive -fno-slp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE-AGG %s +// RUN: %clang -### -mno-comment-section -S -fslp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE-AGG %s +// RUN: %clang -### -mno-comment-section -S -fno-slp-vectorize-aggressive -fslp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE-AGG %s +// RUN: %clang -### -mno-comment-section -S -fno-slp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE-AGG %s +// RUN: %clang -### -mno-comment-section -S -fslp-vectorize-aggressive -fno-slp-vectorize-aggressive %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE-AGG %s // CHECK-SLP-VECTORIZE-AGG: "-vectorize-slp-aggressive" // CHECK-NO-SLP-VECTORIZE-AGG-NOT: "-vectorize-slp-aggressive" -// RUN: %clang -### -S -fextended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-EXTENDED-IDENTIFIERS %s -// RUN: %clang -### -S -fno-extended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-NO-EXTENDED-IDENTIFIERS %s +// RUN: %clang -### -mno-comment-section -S -fextended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-EXTENDED-IDENTIFIERS %s +// RUN: %clang -### -mno-comment-section -S -fno-extended-identifiers %s 2>&1 | FileCheck -check-prefix=CHECK-NO-EXTENDED-IDENTIFIERS %s // CHECK-EXTENDED-IDENTIFIERS: "-cc1" // CHECK-EXTENDED-IDENTIFIERS-NOT: "-fextended-identifiers" // CHECK-NO-EXTENDED-IDENTIFIERS: error: unsupported option '-fno-extended-identifiers' -// RUN: %clang -### -S -fno-pascal-strings -mpascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-M-PASCAL-STRINGS %s +// RUN: %clang -### -mno-comment-section -S -fno-pascal-strings -mpascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-M-PASCAL-STRINGS %s // CHECK-M-PASCAL-STRINGS: "-fpascal-strings" -// RUN: %clang -### -S -fpascal-strings -mno-pascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-NO-M-PASCAL-STRINGS %s +// RUN: %clang -### -mno-comment-section -S -fpascal-strings -mno-pascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-NO-M-PASCAL-STRINGS %s // CHECK-NO-M-PASCAL-STRINGS-NOT: "-fpascal-strings" -// RUN: %clang -### -S -O4 %s 2>&1 | FileCheck -check-prefix=CHECK-MAX-O %s +// RUN: %clang -### -mno-comment-section -S -O4 %s 2>&1 | FileCheck -check-prefix=CHECK-MAX-O %s // CHECK-MAX-O: warning: -O4 is equivalent to -O3 // CHECK-MAX-O: -O3 // RUN: %clang -S -O20 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-O %s // CHECK-INVALID-O: warning: optimization level '-O20' is not supported; using '-O3' instead -// RUN: %clang -### -S -finput-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-CHARSET %s +// RUN: %clang -### -mno-comment-section -S -finput-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-CHARSET %s // CHECK-INVALID-CHARSET: error: invalid value 'iso-8859-1' in '-finput-charset=iso-8859-1' -// RUN: %clang -### -S -fexec-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-INPUT-CHARSET %s +// RUN: %clang -### -mno-comment-section -S -fexec-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-INPUT-CHARSET %s // CHECK-INVALID-INPUT-CHARSET: error: invalid value 'iso-8859-1' in '-fexec-charset=iso-8859-1' // Test that we don't error on these. -// RUN: %clang -### -S -Werror \ +// RUN: %clang -### -mno-comment-section -S -Werror \ // RUN: -falign-functions -falign-functions=2 -fno-align-functions \ // RUN: -fasynchronous-unwind-tables -fno-asynchronous-unwind-tables \ // RUN: -fbuiltin -fno-builtin \ @@ -297,7 +297,7 @@ // IGNORE-NOT: error: unknown argument // Test that the warning is displayed on these. -// RUN: %clang -### \ +// RUN: %clang -### -mno-comment-section \ // RUN: -finline-limit=1000 \ // RUN: -finline-limit \ // RUN: -fexpensive-optimizations \ @@ -431,11 +431,11 @@ // CHECK-WARNING-DAG: optimization flag '-fno-devirtualize-speculatively' is not supported // Test that we mute the warning on these -// RUN: %clang -### -finline-limit=1000 -Wno-invalid-command-line-argument \ +// RUN: %clang -### -mno-comment-section -finline-limit=1000 -Wno-invalid-command-line-argument \ // RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING1 %s -// RUN: %clang -### -finline-limit -Wno-invalid-command-line-argument \ +// RUN: %clang -### -mno-comment-section -finline-limit -Wno-invalid-command-line-argument \ // RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING2 %s -// RUN: %clang -### -finline-limit \ +// RUN: %clang -### -mno-comment-section -finline-limit \ // RUN: -Winvalid-command-line-argument -Wno-ignored-optimization-argument \ // RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING2 %s // CHECK-NO-WARNING1-NOT: optimization flag '-finline-limit=1000' is not supported @@ -445,29 +445,29 @@ // not both a warning about not claiming the arg, *and* about not supporting // the arg; and that adding -Wno-ignored-optimization silences the warning. // -// RUN: %clang -### -fprofile-correction %s 2>&1 \ +// RUN: %clang -### -mno-comment-section -fprofile-correction %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-NO-WARNING3 %s // CHECK-NO-WARNING3: optimization flag '-fprofile-correction' is not supported // CHECK-NO-WARNING3-NOT: argument unused -// RUN: %clang -### -fprofile-correction -Wno-ignored-optimization-argument %s 2>&1 \ +// RUN: %clang -### -mno-comment-section -fprofile-correction -Wno-ignored-optimization-argument %s 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-NO-WARNING4 %s // CHECK-NO-WARNING4-NOT: not supported // CHECK-NO-WARNING4-NOT: argument unused -// RUN: %clang -### -S -fsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN1 %s +// RUN: %clang -### -mno-comment-section -S -fsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN1 %s // CHAR-SIGN1-NOT: -fno-signed-char -// RUN: %clang -### -S -funsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN2 %s +// RUN: %clang -### -mno-comment-section -S -funsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN2 %s // CHAR-SIGN2: -fno-signed-char -// RUN: %clang -### -S -fno-signed-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN3 %s +// RUN: %clang -### -mno-comment-section -S -fno-signed-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN3 %s // CHAR-SIGN3: -fno-signed-char -// RUN: %clang -### -S -fno-unsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN4 %s +// RUN: %clang -### -mno-comment-section -S -fno-unsigned-char %s 2>&1 | FileCheck -check-prefix=CHAR-SIGN4 %s // CHAR-SIGN4-NOT: -fno-signed-char -// RUN: %clang -### -fshort-wchar -fno-short-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR1 -check-prefix=DELIMITERS %s -// RUN: %clang -### -fno-short-wchar -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR2 -check-prefix=DELIMITERS %s +// RUN: %clang -### -mno-comment-section -fshort-wchar -fno-short-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR1 -check-prefix=DELIMITERS %s +// RUN: %clang -### -mno-comment-section -fno-short-wchar -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR2 -check-prefix=DELIMITERS %s // Make sure we don't match the -NOT lines with the linker invocation. // Delimiters match the start of the cc1 and the start of the linker lines // DELIMITERS: {{^ *"}} @@ -477,20 +477,20 @@ // CHECK-WCHAR2-NOT: -fno-short-wchar // DELIMITERS: {{^ *"}} -// RUN: %clang -### -fno-experimental-new-pass-manager -fexperimental-new-pass-manager %s 2>&1 | FileCheck --check-prefix=CHECK-PM --check-prefix=CHECK-NEW-PM %s -// RUN: %clang -### -fexperimental-new-pass-manager -fno-experimental-new-pass-manager %s 2>&1 | FileCheck --check-prefix=CHECK-PM --check-prefix=CHECK-NO-NEW-PM %s +// RUN: %clang -### -mno-comment-section -fno-experimental-new-pass-manager -fexperimental-new-pass-manager %s 2>&1 | FileCheck --check-prefix=CHECK-PM --check-prefix=CHECK-NEW-PM %s +// RUN: %clang -### -mno-comment-section -fexperimental-new-pass-manager -fno-experimental-new-pass-manager %s 2>&1 | FileCheck --check-prefix=CHECK-PM --check-prefix=CHECK-NO-NEW-PM %s // CHECK-PM-NOT: argument unused // CHECK-NEW-PM: -fexperimental-new-pass-manager // CHECK-NEW-PM-NOT: -fno-experimental-new-pass-manager // CHECK-NO-NEW-PM: -fno-experimental-new-pass-manager // CHECK-NO-NEW-PM-NOT: -fexperimental-new-pass-manager -// RUN: %clang -### -S -fstrict-return %s 2>&1 | FileCheck -check-prefix=CHECK-STRICT-RETURN %s -// RUN: %clang -### -S -fno-strict-return %s 2>&1 | FileCheck -check-prefix=CHECK-NO-STRICT-RETURN %s +// RUN: %clang -### -mno-comment-section -S -fstrict-return %s 2>&1 | FileCheck -check-prefix=CHECK-STRICT-RETURN %s +// RUN: %clang -### -mno-comment-section -S -fno-strict-return %s 2>&1 | FileCheck -check-prefix=CHECK-NO-STRICT-RETURN %s // CHECK-STRICT-RETURN-NOT: "-fno-strict-return" // CHECK-NO-STRICT-RETURN: "-fno-strict-return" -// RUN: %clang -### -S -fno-debug-info-for-profiling -fdebug-info-for-profiling %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DEBUG %s -// RUN: %clang -### -S -fdebug-info-for-profiling -fno-debug-info-for-profiling %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-DEBUG %s +// RUN: %clang -### -mno-comment-section -S -fno-debug-info-for-profiling -fdebug-info-for-profiling %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-DEBUG %s +// RUN: %clang -### -mno-comment-section -S -fdebug-info-for-profiling -fno-debug-info-for-profiling %s 2>&1 | FileCheck -check-prefix=CHECK-NO-PROFILE-DEBUG %s // CHECK-PROFILE-DEBUG: -fdebug-info-for-profiling // CHECK-NO-PROFILE-DEBUG-NOT: -fdebug-info-for-profiling Index: test/Driver/coroutines.c =================================================================== --- test/Driver/coroutines.c +++ test/Driver/coroutines.c @@ -1,6 +1,6 @@ -// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s -// RUN: %clang -fcoroutines-ts -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s -// RUN: %clang -fno-coroutines-ts -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s -// RUN: %clang -fno-coroutines-ts -fcoroutines-ts -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s +// RUN: %clang -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s +// RUN: %clang -fcoroutines-ts -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s +// RUN: %clang -fno-coroutines-ts -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s +// RUN: %clang -fno-coroutines-ts -fcoroutines-ts -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s // CHECK-NO-CORO-NOT: -fcoroutines-ts Index: test/Driver/coroutines.cpp =================================================================== --- test/Driver/coroutines.cpp +++ test/Driver/coroutines.cpp @@ -1,9 +1,8 @@ -// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s -// RUN: %clang -fcoroutines-ts -fno-coroutines-ts -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s -// RUN: %clang -fno-coroutines-ts -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s +// RUN: %clang -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s +// RUN: %clang -fcoroutines-ts -fno-coroutines-ts -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s +// RUN: %clang -fno-coroutines-ts -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-NO-CORO %s // CHECK-NO-CORO-NOT: -fcoroutines-ts -// RUN: %clang -fcoroutines-ts -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-CORO %s -// RUN: %clang -fno-coroutines-ts -fcoroutines-ts -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-CORO %s +// RUN: %clang -fcoroutines-ts -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-CORO %s +// RUN: %clang -fno-coroutines-ts -fcoroutines-ts -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-CORO %s // CHECK-HAS-CORO: -fcoroutines-ts - Index: test/Driver/darwin-max-type-align.c =================================================================== --- test/Driver/darwin-max-type-align.c +++ test/Driver/darwin-max-type-align.c @@ -1,15 +1,15 @@ // Check the -fmax-type-align=N flag // rdar://16254558 // -// RUN: %clang -no-canonical-prefixes -target x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \ +// RUN: %clang -no-canonical-prefixes -target x86_64-apple-macosx10.7.0 %s -o - -### -mno-comment-section 2>&1 | \ // RUN: FileCheck -check-prefix=TEST0 %s // TEST0: -fmax-type-align=16 -// RUN: %clang -no-canonical-prefixes -fmax-type-align=32 -target x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \ +// RUN: %clang -no-canonical-prefixes -fmax-type-align=32 -target x86_64-apple-macosx10.7.0 %s -o - -### -mno-comment-section 2>&1 | \ // RUN: FileCheck -check-prefix=TEST1 %s // TEST1: -fmax-type-align=32 -// RUN: %clang -no-canonical-prefixes -fmax-type-align=32 -fno-max-type-align -target x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \ +// RUN: %clang -no-canonical-prefixes -fmax-type-align=32 -fno-max-type-align -target x86_64-apple-macosx10.7.0 %s -o - -### -mno-comment-section 2>&1 | \ // RUN: FileCheck -check-prefix=TEST2 %s // TEST2-NOT: -fmax-type-align -// RUN: %clang -no-canonical-prefixes -fno-max-type-align -target x86_64-apple-macosx10.7.0 %s -o - -### 2>&1 | \ +// RUN: %clang -no-canonical-prefixes -fno-max-type-align -target x86_64-apple-macosx10.7.0 %s -o - -### -mno-comment-section 2>&1 | \ // RUN: FileCheck -check-prefix=TEST3 %s // TEST3-NOT: -fmax-type-align Index: test/Driver/disable-llvm.c =================================================================== --- test/Driver/disable-llvm.c +++ test/Driver/disable-llvm.c @@ -1,21 +1,21 @@ // We support a CC1 option for disabling LLVM's passes. -// RUN: %clang -O2 -Xclang -disable-llvm-passes -### %s 2>&1 \ +// RUN: %clang -O2 -Xclang -disable-llvm-passes -### -mno-comment-section %s 2>&1 \ // RUN: | FileCheck --check-prefix=DISABLED %s // DISABLED: -cc1 // DISABLED-NOT: "-mllvm" "-disable-llvm-passes" // DISABLED: "-disable-llvm-passes" // // We also support two alternative spellings for historical reasons. -// RUN: %clang -O2 -Xclang -disable-llvm-optzns -### %s 2>&1 \ +// RUN: %clang -O2 -Xclang -disable-llvm-optzns -### -mno-comment-section %s 2>&1 \ // RUN: | FileCheck --check-prefix=DISABLED-LEGACY %s -// RUN: %clang -O2 -mllvm -disable-llvm-optzns -### %s 2>&1 \ +// RUN: %clang -O2 -mllvm -disable-llvm-optzns -### -mno-comment-section %s 2>&1 \ // RUN: | FileCheck --check-prefix=DISABLED-LEGACY %s // DISABLED-LEGACY: -cc1 // DISABLED-LEGACY-NOT: "-mllvm" "-disable-llvm-optzns" // DISABLED-LEGACY: "-disable-llvm-optzns" // // The main flag shouldn't be specially handled when used with '-mllvm'. -// RUN: %clang -O2 -mllvm -disable-llvm-passes -### %s 2>&1 | FileCheck --check-prefix=MLLVM %s +// RUN: %clang -O2 -mllvm -disable-llvm-passes -### -mno-comment-section %s 2>&1 | FileCheck --check-prefix=MLLVM %s // MLLVM: -cc1 // MLLVM-NOT: -disable-llvm-passes // MLLVM: "-mllvm" "-disable-llvm-passes" Index: test/Driver/embed-bitcode.c =================================================================== --- test/Driver/embed-bitcode.c +++ test/Driver/embed-bitcode.c @@ -2,21 +2,21 @@ // CHECK: clang // CHECK: clang -// RUN: %clang %s -c -fembed-bitcode -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-CC +// RUN: %clang %s -c -fembed-bitcode -fintegrated-as 2>&1 -### -mno-comment-section | FileCheck %s -check-prefix=CHECK-CC // CHECK-CC: -cc1 // CHECK-CC: -emit-llvm-bc // CHECK-CC: -cc1 // CHECK-CC: -emit-obj // CHECK-CC: -fembed-bitcode=all -// RUN: %clang %s -c -fembed-bitcode=bitcode -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-BITCODE +// RUN: %clang %s -c -fembed-bitcode=bitcode -fintegrated-as 2>&1 -### -mno-comment-section | FileCheck %s -check-prefix=CHECK-BITCODE // CHECK-BITCODE: -cc1 // CHECK-BITCODE: -emit-llvm-bc // CHECK-BITCODE: -cc1 // CHECK-BITCODE: -emit-obj // CHECK-BITCODE: -fembed-bitcode=bitcode // -// RUN: %clang %s -c -save-temps -fembed-bitcode -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-SAVE-TEMP +// RUN: %clang %s -c -save-temps -fembed-bitcode -fintegrated-as 2>&1 -### -mno-comment-section | FileCheck %s -check-prefix=CHECK-SAVE-TEMP // CHECK-SAVE-TEMP: -cc1 // CHECK-SAVE-TEMP: -E // CHECK-SAVE-TEMP: -cc1 @@ -26,37 +26,37 @@ // CHECK-SAVE-TEMP: -fembed-bitcode=all // CHECK-SAVE-TEMP: -cc1as -// RUN: %clang -c %s -flto -fembed-bitcode 2>&1 -### | FileCheck %s -check-prefix=CHECK-LTO -// RUN: %clang -c %s -flto=full -fembed-bitcode 2>&1 -### | FileCheck %s -check-prefix=CHECK-LTO -// RUN: %clang -c %s -flto=thin -fembed-bitcode 2>&1 -### | FileCheck %s -check-prefix=CHECK-LTO +// RUN: %clang -c %s -flto -fembed-bitcode 2>&1 -### -mno-comment-section | FileCheck %s -check-prefix=CHECK-LTO +// RUN: %clang -c %s -flto=full -fembed-bitcode 2>&1 -### -mno-comment-section | FileCheck %s -check-prefix=CHECK-LTO +// RUN: %clang -c %s -flto=thin -fembed-bitcode 2>&1 -### -mno-comment-section | FileCheck %s -check-prefix=CHECK-LTO // CHECK-LTO: -cc1 // CHECK-LTO: -emit-llvm-bc // CHECK-LTO-NOT: warning: argument unused during compilation: '-fembed-bitcode' // CHECK-LTO-NOT: -cc1 // CHECK-LTO-NOT: -fembed-bitcode=all // RUN: touch %t.o -// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %t.o -fembed-bitcode -fembed-bitcode-marker -mlinker-version=277 2>&1 -### | FileCheck %s -check-prefix=CHECK-LTO-MARKER-277 -// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %t.o -fembed-bitcode -fembed-bitcode-marker -mlinker-version=278 2>&1 -### | FileCheck %s -check-prefix=CHECK-LTO-MARKER-278 +// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %t.o -fembed-bitcode -fembed-bitcode-marker -mlinker-version=277 2>&1 -### -mno-comment-section | FileCheck %s -check-prefix=CHECK-LTO-MARKER-277 +// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %t.o -fembed-bitcode -fembed-bitcode-marker -mlinker-version=278 2>&1 -### -mno-comment-section | FileCheck %s -check-prefix=CHECK-LTO-MARKER-278 // CHECK-LTO-MARKER-277-NOT: bitcode_process_mode // CHECK-LTO-MARKER-278: bitcode_process_mode -// RUN: %clang -c %s -fembed-bitcode-marker -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-MARKER +// RUN: %clang -c %s -fembed-bitcode-marker -fintegrated-as 2>&1 -### -mno-comment-section | FileCheck %s -check-prefix=CHECK-MARKER // CHECK-MARKER: -cc1 // CHECK-MARKER: -emit-obj // CHECK-MARKER: -fembed-bitcode=marker // CHECK-MARKER-NOT: -cc1 -// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -fembed-bitcode=all -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-LINKER -// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -fembed-bitcode=marker -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-LINKER -// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -flto=full -fembed-bitcode=bitcode -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-LINKER -// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -flto=thin -fembed-bitcode=bitcode -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-LINKER -// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -fembed-bitcode=off -fintegrated-as 2>&1 -### | FileCheck %s -check-prefix=CHECK-NO-LINKER +// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -fembed-bitcode=all -fintegrated-as 2>&1 -### -mno-comment-section | FileCheck %s -check-prefix=CHECK-LINKER +// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -fembed-bitcode=marker -fintegrated-as 2>&1 -### -mno-comment-section | FileCheck %s -check-prefix=CHECK-LINKER +// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -flto=full -fembed-bitcode=bitcode -fintegrated-as 2>&1 -### -mno-comment-section | FileCheck %s -check-prefix=CHECK-LINKER +// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -flto=thin -fembed-bitcode=bitcode -fintegrated-as 2>&1 -### -mno-comment-section | FileCheck %s -check-prefix=CHECK-LINKER +// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=6.0 %s -fembed-bitcode=off -fintegrated-as 2>&1 -### -mno-comment-section | FileCheck %s -check-prefix=CHECK-NO-LINKER // CHECK-LINKER: ld // CHECK-LINKER: -bitcode_bundle // CHECK-NO-LINKER-NOT: -bitcode_bundle -// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=5.0 %s -fembed-bitcode -### 2>&1 | \ +// RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=5.0 %s -fembed-bitcode -### -mno-comment-section 2>&1 | \ // RUN: FileCheck %s -check-prefix=CHECK-PLATFORM-NOTSUPPORTED // CHECK-PLATFORM-NOTSUPPORTED: -fembed-bitcode is not supported on versions of iOS prior to 6.0 Index: test/Driver/fsanitize-blacklist.c =================================================================== --- test/Driver/fsanitize-blacklist.c +++ test/Driver/fsanitize-blacklist.c @@ -12,40 +12,40 @@ // RUN: echo "fun:bar" > %t.second // RUN: echo "badline" > %t.bad -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.good -fsanitize-blacklist=%t.second %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BLACKLIST +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.good -fsanitize-blacklist=%t.second %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-BLACKLIST // CHECK-BLACKLIST: -fsanitize-blacklist={{.*}}.good" "-fsanitize-blacklist={{.*}}.second // Now, check for -fdepfile-entry flags. -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.good -fsanitize-blacklist=%t.second %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BLACKLIST2 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.good -fsanitize-blacklist=%t.second %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-BLACKLIST2 // CHECK-BLACKLIST2: -fdepfile-entry={{.*}}.good" "-fdepfile-entry={{.*}}.second // Check that the default blacklist is not added as an extra dependency. -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -resource-dir=%S/Inputs/resource_dir %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-BLACKLIST --implicit-check-not=fdepfile-entry +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -resource-dir=%S/Inputs/resource_dir %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT-BLACKLIST --implicit-check-not=fdepfile-entry // CHECK-DEFAULT-BLACKLIST: -fsanitize-blacklist={{.*}}asan_blacklist.txt // Ignore -fsanitize-blacklist flag if there is no -fsanitize flag. -// RUN: %clang -target x86_64-linux-gnu -fsanitize-blacklist=%t.good %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SANITIZE --check-prefix=DELIMITERS +// RUN: %clang -target x86_64-linux-gnu -fsanitize-blacklist=%t.good %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SANITIZE --check-prefix=DELIMITERS // CHECK-NO-SANITIZE-NOT: -fsanitize-blacklist // Ignore -fsanitize-blacklist flag if there is no -fsanitize flag. // Now, check for the absense of -fdepfile-entry flags. -// RUN: %clang -target x86_64-linux-gnu -fsanitize-blacklist=%t.good %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SANITIZE2 --check-prefix=DELIMITERS +// RUN: %clang -target x86_64-linux-gnu -fsanitize-blacklist=%t.good %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SANITIZE2 --check-prefix=DELIMITERS // CHECK-NO-SANITIZE2-NOT: -fdepfile-entry // Flag -fno-sanitize-blacklist wins if it is specified later. -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.good -fno-sanitize-blacklist %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-BLACKLIST --check-prefix=DELIMITERS +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.good -fno-sanitize-blacklist %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-BLACKLIST --check-prefix=DELIMITERS // CHECK-NO-BLACKLIST-NOT: -fsanitize-blacklist // Driver barks on unexisting blacklist files. -// RUN: %clang -target x86_64-linux-gnu -fno-sanitize-blacklist -fsanitize-blacklist=unexisting.txt %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SUCH-FILE +// RUN: %clang -target x86_64-linux-gnu -fno-sanitize-blacklist -fsanitize-blacklist=unexisting.txt %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SUCH-FILE // CHECK-NO-SUCH-FILE: error: no such file or directory: 'unexisting.txt' // Driver properly reports malformed blacklist files. -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.second -fsanitize-blacklist=%t.bad -fsanitize-blacklist=%t.good %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-BAD-BLACKLIST +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.second -fsanitize-blacklist=%t.bad -fsanitize-blacklist=%t.good %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-BAD-BLACKLIST // CHECK-BAD-BLACKLIST: error: malformed sanitizer blacklist: 'error parsing file '{{.*}}.bad': malformed line 1: 'badline'' // -fno-sanitize-blacklist disables all blacklists specified earlier. -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.good -fno-sanitize-blacklist -fsanitize-blacklist=%t.second %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ONLY-FIRST-DISABLED +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-blacklist=%t.good -fno-sanitize-blacklist -fsanitize-blacklist=%t.second %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ONLY-FIRST-DISABLED // CHECK-ONLY_FIRST-DISABLED-NOT: good // CHECK-ONLY-FIRST-DISABLED: -fsanitize-blacklist={{.*}}.second // CHECK-ONLY_FIRST-DISABLED-NOT: good Index: test/Driver/fsanitize.c =================================================================== --- test/Driver/fsanitize.c +++ test/Driver/fsanitize.c @@ -1,194 +1,194 @@ -// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize-trap=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP -// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize-trap=undefined -fno-sanitize-trap=signed-integer-overflow %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP2 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize-undefined-trap-on-error %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP -// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP -// RUN: %clang -target x86_64-linux-gnu -fsanitize-undefined-trap-on-error -fsanitize=undefined-trap %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP +// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize-trap=undefined %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP +// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize-trap=undefined -fno-sanitize-trap=signed-integer-overflow %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP2 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize-undefined-trap-on-error %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP +// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP +// RUN: %clang -target x86_64-linux-gnu -fsanitize-undefined-trap-on-error -fsanitize=undefined-trap %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP // CHECK-UNDEFINED-TRAP: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute|function),?){18}"}} // CHECK-UNDEFINED-TRAP: "-fsanitize-trap=alignment,array-bounds,bool,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,nonnull-attribute,null,object-size,return,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,unreachable,vla-bound" // CHECK-UNDEFINED-TRAP2: "-fsanitize-trap=alignment,array-bounds,bool,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,nonnull-attribute,null,object-size,return,returns-nonnull-attribute,shift-base,shift-exponent,unreachable,vla-bound" -// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED +// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED // CHECK-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute),?){19}"}} -// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-DARWIN +// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=undefined %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-DARWIN // CHECK-UNDEFINED-DARWIN: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute),?){17}"}} -// RUN: %clang -target i386-unknown-openbsd -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-OPENBSD +// RUN: %clang -target i386-unknown-openbsd -fsanitize=undefined %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-OPENBSD // CHECK-UNDEFINED-OPENBSD: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute),?){17}"}} -// RUN: %clang -target i386-pc-win32 -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN32 -// RUN: %clang -target i386-pc-win32 -fsanitize=undefined -x c++ %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN32 --check-prefix=CHECK-UNDEFINED-WIN-CXX -// RUN: %clang -target x86_64-pc-win32 -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN64 -// RUN: %clang -target x86_64-pc-win32 -fsanitize=undefined -x c++ %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN64 --check-prefix=CHECK-UNDEFINED-WIN-CXX +// RUN: %clang -target i386-pc-win32 -fsanitize=undefined %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN32 +// RUN: %clang -target i386-pc-win32 -fsanitize=undefined -x c++ %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN32 --check-prefix=CHECK-UNDEFINED-WIN-CXX +// RUN: %clang -target x86_64-pc-win32 -fsanitize=undefined %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN64 +// RUN: %clang -target x86_64-pc-win32 -fsanitize=undefined -x c++ %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN64 --check-prefix=CHECK-UNDEFINED-WIN-CXX // CHECK-UNDEFINED-WIN32: "--dependent-lib={{[^"]*}}ubsan_standalone-i386.lib" // CHECK-UNDEFINED-WIN64: "--dependent-lib={{[^"]*}}ubsan_standalone-x86_64.lib" // CHECK-UNDEFINED-WIN-CXX: "--dependent-lib={{[^"]*}}ubsan_standalone_cxx{{[^"]*}}.lib" // CHECK-UNDEFINED-WIN-SAME: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute),?){17}"}} -// RUN: %clang -target i386-pc-win32 -fsanitize-coverage=bb %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-COVERAGE-WIN32 +// RUN: %clang -target i386-pc-win32 -fsanitize-coverage=bb %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-COVERAGE-WIN32 // CHECK-COVERAGE-WIN32: "--dependent-lib={{[^"]*}}ubsan_standalone-i386.lib" -// RUN: %clang -target x86_64-pc-win32 -fsanitize-coverage=bb %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-COVERAGE-WIN64 +// RUN: %clang -target x86_64-pc-win32 -fsanitize-coverage=bb %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-COVERAGE-WIN64 // CHECK-COVERAGE-WIN64: "--dependent-lib={{[^"]*}}ubsan_standalone-x86_64.lib" -// RUN: %clang -target x86_64-linux-gnu -fsanitize=integer %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-INTEGER +// RUN: %clang -target x86_64-linux-gnu -fsanitize=integer %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-INTEGER // CHECK-INTEGER: "-fsanitize={{((signed-integer-overflow|unsigned-integer-overflow|integer-divide-by-zero|shift-base|shift-exponent),?){5}"}} -// RUN: %clang -fsanitize=bounds -### -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix=CHECK-BOUNDS +// RUN: %clang -fsanitize=bounds -### -mno-comment-section -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix=CHECK-BOUNDS // CHECK-BOUNDS: "-fsanitize={{((array-bounds|local-bounds),?){2}"}} -// RUN: %clang -target x86_64-linux-gnu -fsanitize=all %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSANITIZE-ALL +// RUN: %clang -target x86_64-linux-gnu -fsanitize=all %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-FSANITIZE-ALL // CHECK-FSANITIZE-ALL: error: unsupported argument 'all' to option 'fsanitize=' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,undefined -fno-sanitize=all -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FNO-SANITIZE-ALL +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,undefined -fno-sanitize=all -fsanitize=thread %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-FNO-SANITIZE-ALL // CHECK-FNO-SANITIZE-ALL: "-fsanitize=thread" -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,undefined -fno-sanitize=thread -fno-sanitize=float-cast-overflow,vptr,bool,enum %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PARTIAL-UNDEFINED +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,undefined -fno-sanitize=thread -fno-sanitize=float-cast-overflow,vptr,bool,enum %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-PARTIAL-UNDEFINED // CHECK-PARTIAL-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|object-size|array-bounds|returns-nonnull-attribute|nonnull-attribute),?){15}"}} -// RUN: %clang -target x86_64-linux-gnu -fsanitize=shift -fno-sanitize=shift-base %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSANITIZE-SHIFT-PARTIAL +// RUN: %clang -target x86_64-linux-gnu -fsanitize=shift -fno-sanitize=shift-base %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-FSANITIZE-SHIFT-PARTIAL // CHECK-FSANITIZE-SHIFT-PARTIAL: "-fsanitize=shift-exponent" -// RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fsanitize-trap=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-TRAP-UNDEF -// RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fsanitize-undefined-trap-on-error %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-TRAP-UNDEF +// RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fsanitize-trap=undefined %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-TRAP-UNDEF +// RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fsanitize-undefined-trap-on-error %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-TRAP-UNDEF // CHECK-VPTR-TRAP-UNDEF: error: invalid argument '-fsanitize=vptr' not allowed with '-fsanitize-trap=undefined' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-NO-RTTI +// RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-NO-RTTI // CHECK-VPTR-NO-RTTI: '-fsanitize=vptr' not allowed with '-fno-rtti' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-NO-RTTI +// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-NO-RTTI // CHECK-UNDEFINED-NO-RTTI-NOT: vptr -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,thread -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANT +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,thread -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANT // CHECK-SANA-SANT: '-fsanitize=address' not allowed with '-fsanitize=thread' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANM +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,memory -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANM // CHECK-SANA-SANM: '-fsanitize=address' not allowed with '-fsanitize=memory' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANT-SANM +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,memory -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANT-SANM // CHECK-SANT-SANM: '-fsanitize=thread' not allowed with '-fsanitize=memory' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory,thread -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANM-SANT +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory,thread -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANM-SANT // CHECK-SANM-SANT: '-fsanitize=thread' not allowed with '-fsanitize=memory' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak,thread -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL-SANT +// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak,thread -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANL-SANT // CHECK-SANL-SANT: '-fsanitize=leak' not allowed with '-fsanitize=thread' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL-SANM +// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak,memory -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANL-SANM // CHECK-SANL-SANM: '-fsanitize=leak' not allowed with '-fsanitize=memory' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-address,thread -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANKA-SANT +// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-address,thread -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANKA-SANT // CHECK-SANKA-SANT: '-fsanitize=kernel-address' not allowed with '-fsanitize=thread' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-address,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANKA-SANM +// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-address,memory -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANKA-SANM // CHECK-SANKA-SANM: '-fsanitize=kernel-address' not allowed with '-fsanitize=memory' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-address,address -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANKA-SANA +// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-address,address -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANKA-SANA // CHECK-SANKA-SANA: '-fsanitize=kernel-address' not allowed with '-fsanitize=address' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-address,leak -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANKA-SANL +// RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-address,leak -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANKA-SANL // CHECK-SANKA-SANL: '-fsanitize=kernel-address' not allowed with '-fsanitize=leak' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-cache-frag,address -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANA -// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-working-set,address -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANA +// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-cache-frag,address -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANA +// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-working-set,address -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANA // CHECK-SANE-SANA: '-fsanitize=efficiency-{{.*}}' not allowed with '-fsanitize=address' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-cache-frag,leak -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANL -// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-working-set,leak -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANL +// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-cache-frag,leak -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANL +// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-working-set,leak -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANL // CHECK-SANE-SANL: '-fsanitize=efficiency-{{.*}}' not allowed with '-fsanitize=leak' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-cache-frag,thread -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANT -// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-working-set,thread -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANT +// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-cache-frag,thread -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANT +// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-working-set,thread -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANT // CHECK-SANE-SANT: '-fsanitize=efficiency-{{.*}}' not allowed with '-fsanitize=thread' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-cache-frag,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANM -// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-working-set,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANM +// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-cache-frag,memory -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANM +// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-working-set,memory -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANM // CHECK-SANE-SANM: '-fsanitize=efficiency-{{.*}}' not allowed with '-fsanitize=memory' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-cache-frag,kernel-address -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANKA -// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-working-set,kernel-address -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANKA +// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-cache-frag,kernel-address -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANKA +// RUN: %clang -target x86_64-linux-gnu -fsanitize=efficiency-working-set,kernel-address -pie -fno-rtti %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANE-SANKA // CHECK-SANE-SANKA: '-fsanitize=efficiency-{{.*}}' not allowed with '-fsanitize=kernel-address' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-use-after-scope %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-USE-AFTER-SCOPE +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-use-after-scope %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-USE-AFTER-SCOPE // CHECK-USE-AFTER-SCOPE: -cc1{{.*}}-fsanitize-address-use-after-scope -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fno-sanitize-address-use-after-scope %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-USE-AFTER-SCOPE-OFF +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fno-sanitize-address-use-after-scope %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-USE-AFTER-SCOPE-OFF // CHECK-USE-AFTER-SCOPE-OFF-NOT: -cc1{{.*}}address-use-after-scope -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fno-sanitize-address-use-after-scope -fsanitize-address-use-after-scope %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-USE-AFTER-SCOPE-BOTH +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fno-sanitize-address-use-after-scope -fsanitize-address-use-after-scope %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-USE-AFTER-SCOPE-BOTH // CHECK-USE-AFTER-SCOPE-BOTH: -cc1{{.*}}-fsanitize-address-use-after-scope -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-use-after-scope -fno-sanitize-address-use-after-scope %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-USE-AFTER-SCOPE-BOTH-OFF +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-use-after-scope -fno-sanitize-address-use-after-scope %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-USE-AFTER-SCOPE-BOTH-OFF // CHECK-USE-AFTER-SCOPE-BOTH-OFF-NOT: -cc1{{.*}}address-use-after-scope -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-WITHOUT-USE-AFTER-SCOPE +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-WITHOUT-USE-AFTER-SCOPE // CHECK-ASAN-WITHOUT-USE-AFTER-SCOPE: -cc1{{.*}}address-use-after-scope -// RUN: %clang -target x86_64-linux-gnu -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ONLY-TRACK-ORIGINS +// RUN: %clang -target x86_64-linux-gnu -fsanitize-memory-track-origins -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ONLY-TRACK-ORIGINS // CHECK-ONLY-TRACK-ORIGINS: warning: argument unused during compilation: '-fsanitize-memory-track-origins' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fno-sanitize=memory -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-DISABLED-MSAN +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fno-sanitize=memory -fsanitize-memory-track-origins -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-DISABLED-MSAN // CHECK-TRACK-ORIGINS-DISABLED-MSAN-NOT: warning: argument unused -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-EXTRA-TRACK-ORIGINS +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-EXTRA-TRACK-ORIGINS // CHECK-NO-EXTRA-TRACK-ORIGINS-NOT: "-fsanitize-memory-track-origins" -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize=alignment -fsanitize=vptr -fno-sanitize=vptr %s -### 2>&1 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize=alignment -fsanitize=vptr -fno-sanitize=vptr %s -### -mno-comment-section 2>&1 // OK -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -pie %s -### 2>&1 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -pie %s -### -mno-comment-section 2>&1 // OK -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=1 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-1 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=1 -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fno-sanitize-memory-track-origins -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=0 -fsanitize-memory-track-origins=1 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-1 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=0 -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=1 -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-1 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=1 -fsanitize-memory-track-origins -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-memory-track-origins -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fno-sanitize-memory-track-origins -fsanitize-memory-track-origins -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=0 -fsanitize-memory-track-origins=1 -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-1 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=0 -fsanitize-memory-track-origins -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 // CHECK-TRACK-ORIGINS-1: -fsanitize-memory-track-origins=1 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fno-sanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=0 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins -fno-sanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins -fsanitize-memory-track-origins=0 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -fno-sanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-memory-track-origins=0 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fno-sanitize-memory-track-origins -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=0 -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins -fno-sanitize-memory-track-origins -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins -fsanitize-memory-track-origins=0 -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -fno-sanitize-memory-track-origins -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-memory-track-origins=0 -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS // CHECK-NO-TRACK-ORIGINS-NOT: sanitize-memory-track-origins -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 // CHECK-TRACK-ORIGINS-2: -fsanitize-memory-track-origins=2 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=3 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-3 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=3 -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-3 // CHECK-TRACK-ORIGINS-3: error: invalid value '3' in '-fsanitize-memory-track-origins=3' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-use-after-dtor -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-USE-AFTER-DTOR +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-use-after-dtor -pie %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-USE-AFTER-DTOR // CHECK-MSAN-USE-AFTER-DTOR: -cc1{{.*}}-fsanitize-memory-use-after-dtor -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-0 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=0 %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-0 // CHECK-ASAN-FIELD-PADDING-0-NOT: -fsanitize-address-field-padding -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-1 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=1 %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-1 // CHECK-ASAN-FIELD-PADDING-1: -fsanitize-address-field-padding=1 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=2 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-2 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=2 %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-2 // CHECK-ASAN-FIELD-PADDING-2: -fsanitize-address-field-padding=2 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=3 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-3 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=3 %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-3 // CHECK-ASAN-FIELD-PADDING-3: error: invalid value '3' in '-fsanitize-address-field-padding=3' -// RUN: %clang -target x86_64-linux-gnu -fsanitize-address-field-padding=2 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-NO-ASAN +// RUN: %clang -target x86_64-linux-gnu -fsanitize-address-field-padding=2 %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-NO-ASAN // CHECK-ASAN-FIELD-PADDING-NO-ASAN: warning: argument unused during compilation: '-fsanitize-address-field-padding=2' -// RUN: %clang -target x86_64-linux-gnu -fsanitize-address-field-padding=2 -fsanitize=address -fno-sanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-DISABLED-ASAN +// RUN: %clang -target x86_64-linux-gnu -fsanitize-address-field-padding=2 -fsanitize=address -fno-sanitize=address %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-DISABLED-ASAN // CHECK-ASAN-FIELD-PADDING-DISABLED-ASAN-NOT: warning: argument unused -// RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### -mno-comment-section 2>&1 // OK -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE -// RUN: %clang -target x86_64-unknown-freebsd -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE -// RUN: %clang -target aarch64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE -// RUN: %clang -target arm-linux-androideabi -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIE -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE -// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE +// RUN: %clang -target x86_64-unknown-freebsd -fsanitize=memory %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-PIE +// RUN: %clang -target aarch64-linux-gnu -fsanitize=memory %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-PIE +// RUN: %clang -target arm-linux-androideabi -fsanitize=address %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-PIE +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE +// RUN: %clang -target i386-linux-gnu -fsanitize=address %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIE // CHECK-NO-PIE-NOT: "-pie" // CHECK-NO-PIE: "-mrelocation-model" "static" @@ -197,246 +197,246 @@ // CHECK-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" // CHECK-PIE: "-pie" -// RUN: %clang -target arm-linux-androideabi %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-NO-ASAN +// RUN: %clang -target arm-linux-androideabi %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-NO-ASAN // CHECK-ANDROID-NO-ASAN: "-mrelocation-model" "pic" -// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-UBSAN -// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-UBSAN -// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover=all -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-UBSAN -// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover -fsanitize-recover=undefined -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-UBSAN -// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover=undefined -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER-UBSAN -// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover=all -fsanitize-recover=thread -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER-UBSAN -// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover=all -fno-sanitize-recover=undefined -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER-UBSAN +// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-UBSAN +// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-UBSAN +// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover=all -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-UBSAN +// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover -fsanitize-recover=undefined -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-UBSAN +// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover=undefined -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER-UBSAN +// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover=all -fsanitize-recover=thread -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER-UBSAN +// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover=all -fno-sanitize-recover=undefined -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER-UBSAN // CHECK-RECOVER-UBSAN: "-fsanitize-recover={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift-base|shift-exponent|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute),?){17}"}} // CHECK-NO-RECOVER-UBSAN-NOT: sanitize-recover -// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover=all -fsanitize-recover=object-size,shift-base -### 2>&1 | FileCheck %s --check-prefix=CHECK-PARTIAL-RECOVER +// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover=all -fsanitize-recover=object-size,shift-base -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-PARTIAL-RECOVER // CHECK-PARTIAL-RECOVER: "-fsanitize-recover={{((object-size|shift-base),?){2}"}} -// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=address -fsanitize-recover=all -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-ASAN +// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=address -fsanitize-recover=all -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER-ASAN // CHECK-RECOVER-ASAN: "-fsanitize-recover=address" -// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover=foobar,object-size,unreachable -### 2>&1 | FileCheck %s --check-prefix=CHECK-DIAG-RECOVER +// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover=foobar,object-size,unreachable -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-DIAG-RECOVER // CHECK-DIAG-RECOVER: unsupported argument 'foobar' to option 'fsanitize-recover=' // CHECK-DIAG-RECOVER: unsupported argument 'unreachable' to option 'fsanitize-recover=' -// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover -fno-sanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEPRECATED-RECOVER +// RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover -fno-sanitize-recover -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-DEPRECATED-RECOVER // CHECK-DEPRECATED-RECOVER: argument '-fsanitize-recover' is deprecated, use '-fsanitize-recover=undefined,integer' or '-fsanitize-recover=all' instead // CHECK-DEPRECATED-RECOVER: argument '-fno-sanitize-recover' is deprecated, use '-fno-sanitize-recover=undefined,integer' or '-fno-sanitize-recover=all' instead // CHECK-DEPRECATED-RECOVER-NOT: is deprecated -// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL +// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANL // CHECK-SANL: "-fsanitize=leak" -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,leak -fno-sanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANL-NO-SANA +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,leak -fno-sanitize=address %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANL-NO-SANA // CHECK-SANA-SANL-NO-SANA: "-fsanitize=leak" -// RUN: %clang -target i686-linux-gnu -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL-X86 +// RUN: %clang -target i686-linux-gnu -fsanitize=leak %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANL-X86 // CHECK-SANL-X86: "-fsanitize=leak" -// RUN: %clang -target i686-linux-gnu -fsanitize=address,leak -fno-sanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANL-NO-SANA-X86 +// RUN: %clang -target i686-linux-gnu -fsanitize=address,leak -fno-sanitize=address %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANL-NO-SANA-X86 // CHECK-SANA-SANL-NO-SANA-X86: "-fsanitize=leak" -// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN +// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN // CHECK-MSAN: "-fno-assume-sane-operator-new" -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN // CHECK-ASAN: "-fno-assume-sane-operator-new" -// RUN: %clang -target x86_64-linux-gnu -fsanitize=zzz %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DIAG1 +// RUN: %clang -target x86_64-linux-gnu -fsanitize=zzz %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-DIAG1 // CHECK-DIAG1: unsupported argument 'zzz' to option 'fsanitize=' // CHECK-DIAG1-NOT: unsupported argument 'zzz' to option 'fsanitize=' -// RUN: %clang -target i686-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-X86 +// RUN: %clang -target i686-linux-gnu -fsanitize=memory %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-X86 // CHECK-MSAN-X86: error: unsupported option '-fsanitize=memory' for target 'i686--linux-gnu' -// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-DARWIN +// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-DARWIN // CHECK-MSAN-DARWIN: unsupported option '-fsanitize=memory' for target 'x86_64-apple-darwin10' -// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory -fno-sanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-NOMSAN-DARWIN +// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory -fno-sanitize=memory %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-NOMSAN-DARWIN // CHECK-MSAN-NOMSAN-DARWIN-NOT: unsupported option -// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory -fsanitize=thread,memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-TSAN-MSAN-DARWIN +// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory -fsanitize=thread,memory %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-TSAN-MSAN-DARWIN // CHECK-MSAN-TSAN-MSAN-DARWIN: unsupported option '-fsanitize=memory' for target 'x86_64-apple-darwin10' // CHECK-MSAN-TSAN-MSAN-DARWIN-NOT: unsupported option -// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=thread,memory -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MSAN-MSAN-DARWIN +// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=thread,memory -fsanitize=memory %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MSAN-MSAN-DARWIN // CHECK-TSAN-MSAN-MSAN-DARWIN: unsupported option '-fsanitize=memory' for target 'x86_64-apple-darwin10' // CHECK-TSAN-MSAN-MSAN-DARWIN-NOT: unsupported option -// RUN: %clang -target x86_64-apple-darwin -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-DARWIN +// RUN: %clang -target x86_64-apple-darwin -fsanitize=thread %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-DARWIN // CHECK-TSAN-X86-64-DARWIN-NOT: unsupported option -// RUN: %clang -target x86_64-apple-iossimulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-IOSSIMULATOR +// RUN: %clang -target x86_64-apple-iossimulator -fsanitize=thread %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-IOSSIMULATOR // CHECK-TSAN-X86-64-IOSSIMULATOR-NOT: unsupported option -// RUN: %clang -target x86_64-apple-tvossimulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-TVOSSIMULATOR +// RUN: %clang -target x86_64-apple-tvossimulator -fsanitize=thread %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-TVOSSIMULATOR // CHECK-TSAN-X86-64-TVOSSIMULATOR-NOT: unsupported option -// RUN: %clang -target i386-apple-darwin -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-DARWIN +// RUN: %clang -target i386-apple-darwin -fsanitize=thread %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-DARWIN // CHECK-TSAN-I386-DARWIN: unsupported option '-fsanitize=thread' for target 'i386-apple-darwin' -// RUN: %clang -target arm-apple-ios -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-ARM-IOS +// RUN: %clang -target arm-apple-ios -fsanitize=thread %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-ARM-IOS // CHECK-TSAN-ARM-IOS: unsupported option '-fsanitize=thread' for target 'arm-apple-ios' -// RUN: %clang -target i386-apple-iossimulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-IOSSIMULATOR +// RUN: %clang -target i386-apple-iossimulator -fsanitize=thread %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-IOSSIMULATOR // CHECK-TSAN-I386-IOSSIMULATOR: unsupported option '-fsanitize=thread' for target 'i386-apple-iossimulator' -// RUN: %clang -target i386-apple-tvossimulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-TVOSSIMULATOR +// RUN: %clang -target i386-apple-tvossimulator -fsanitize=thread %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-I386-TVOSSIMULATOR // CHECK-TSAN-I386-TVOSSIMULATOR: unsupported option '-fsanitize=thread' for target 'i386-apple-tvossimulator' -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-thread-memory-access %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MEMORY-ACCESS +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-thread-memory-access %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MEMORY-ACCESS // CHECK-TSAN-MEMORY-ACCESS-NOT: -cc1{{.*}}tsan-instrument-memory-accesses=0 // CHECK-TSAN-MEMORY-ACCESS-NOT: -cc1{{.*}}tsan-instrument-memintrinsics=0 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fno-sanitize-thread-memory-access %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MEMORY-ACCESS-OFF +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fno-sanitize-thread-memory-access %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MEMORY-ACCESS-OFF // CHECK-TSAN-MEMORY-ACCESS-OFF: -cc1{{.*}}tsan-instrument-memory-accesses=0{{.*}}tsan-instrument-memintrinsics=0 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fno-sanitize-thread-memory-access -fsanitize-thread-memory-access %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MEMORY-ACCESS-BOTH +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fno-sanitize-thread-memory-access -fsanitize-thread-memory-access %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MEMORY-ACCESS-BOTH // CHECK-TSAN-MEMORY-ACCESS-BOTH-NOT: -cc1{{.*}}tsan-instrument-memory-accesses=0 // CHECK-TSAN-MEMORY-ACCESS-BOTH-NOT: -cc1{{.*}}tsan-instrument-memintrinsics=0 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-thread-memory-access -fno-sanitize-thread-memory-access %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MEMORY-ACCESS-BOTH-OFF +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-thread-memory-access -fno-sanitize-thread-memory-access %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MEMORY-ACCESS-BOTH-OFF // CHECK-TSAN-MEMORY-ACCESS-BOTH-OFF: -cc1{{.*}}tsan-instrument-memory-accesses=0{{.*}}tsan-instrument-memintrinsics=0 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-thread-func-entry-exit %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-FUNC-ENTRY-EXIT +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-thread-func-entry-exit %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-FUNC-ENTRY-EXIT // CHECK-TSAN-FUNC-ENTRY-EXIT-NOT: -cc1{{.*}}tsan-instrument-func-entry-exit=0 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fno-sanitize-thread-func-entry-exit %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-FUNC-ENTRY-EXIT-OFF +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fno-sanitize-thread-func-entry-exit %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-FUNC-ENTRY-EXIT-OFF // CHECK-TSAN-FUNC-ENTRY-EXIT-OFF: -cc1{{.*}}tsan-instrument-func-entry-exit=0 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fno-sanitize-thread-func-entry-exit -fsanitize-thread-func-entry-exit %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-FUNC-ENTRY-EXIT-BOTH +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fno-sanitize-thread-func-entry-exit -fsanitize-thread-func-entry-exit %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-FUNC-ENTRY-EXIT-BOTH // CHECK-TSAN-FUNC-ENTRY-EXIT-BOTH-NOT: -cc1{{.*}}tsan-instrument-func-entry-exit=0 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-thread-func-entry-exit -fno-sanitize-thread-func-entry-exit %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-FUNC-ENTRY-EXIT-BOTH-OFF +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-thread-func-entry-exit -fno-sanitize-thread-func-entry-exit %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-FUNC-ENTRY-EXIT-BOTH-OFF // CHECK-TSAN-FUNC-ENTRY-EXIT-BOTH-OFF: -cc1{{.*}}tsan-instrument-func-entry-exit=0 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-thread-atomics %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-ATOMICS +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-thread-atomics %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-ATOMICS // CHECK-TSAN-ATOMICS-NOT: -cc1{{.*}}tsan-instrument-atomics=0 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fno-sanitize-thread-atomics %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-ATOMICS-OFF +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fno-sanitize-thread-atomics %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-ATOMICS-OFF // CHECK-TSAN-ATOMICS-OFF: -cc1{{.*}}tsan-instrument-atomics=0 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fno-sanitize-thread-atomics -fsanitize-thread-atomics %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-ATOMICS-BOTH +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fno-sanitize-thread-atomics -fsanitize-thread-atomics %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-ATOMICS-BOTH // CHECK-TSAN-ATOMICS-BOTH-NOT: -cc1{{.*}}tsan-instrument-atomics=0 -// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-thread-atomics -fno-sanitize-thread-atomics %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-ATOMICS-BOTH-OFF +// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread -fsanitize-thread-atomics -fno-sanitize-thread-atomics %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-ATOMICS-BOTH-OFF // CHECK-TSAN-ATOMICS-BOTH-OFF: -cc1{{.*}}tsan-instrument-atomics=0 -// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=function %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-DARWIN +// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=function %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-DARWIN // CHECK-FSAN-DARWIN: unsupported option '-fsanitize=function' for target 'x86_64-apple-darwin10' -// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=function -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-UBSAN-DARWIN +// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=function -fsanitize=undefined %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-UBSAN-DARWIN // CHECK-FSAN-UBSAN-DARWIN: unsupported option '-fsanitize=function' for target 'x86_64-apple-darwin10' -// RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.8 -fsanitize=vptr %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-DARWIN-OLD +// RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.8 -fsanitize=vptr %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-DARWIN-OLD // CHECK-VPTR-DARWIN-OLD: unsupported option '-fsanitize=vptr' for target 'x86_64-apple-darwin10' -// RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.9 -fsanitize=alignment,vptr %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-DARWIN-NEW +// RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.9 -fsanitize=alignment,vptr %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-DARWIN-NEW // CHECK-VPTR-DARWIN-NEW: -fsanitize=alignment,vptr -// RUN: %clang -target armv7-apple-ios7 -miphoneos-version-min=7.0 -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-IOS +// RUN: %clang -target armv7-apple-ios7 -miphoneos-version-min=7.0 -fsanitize=address %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-IOS // CHECK-ASAN-IOS: -fsanitize=address -// RUN: %clang -target i386-pc-openbsd -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-OPENBSD +// RUN: %clang -target i386-pc-openbsd -fsanitize=address %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-OPENBSD // CHECK-ASAN-OPENBSD: unsupported option '-fsanitize=address' for target 'i386-pc-openbsd' -// RUN: %clang -target i686-linux-gnu -fsanitize=efficiency-cache-frag %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-X86 -// RUN: %clang -target i686-linux-gnu -fsanitize=efficiency-working-set %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-X86 +// RUN: %clang -target i686-linux-gnu -fsanitize=efficiency-cache-frag %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-X86 +// RUN: %clang -target i686-linux-gnu -fsanitize=efficiency-working-set %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-X86 // CHECK-ESAN-X86: error: unsupported option '-fsanitize=efficiency-{{.*}}' for target 'i686--linux-gnu' -// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=efficiency-cache-frag %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-DARWIN -// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=efficiency-working-set %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-DARWIN +// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=efficiency-cache-frag %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-DARWIN +// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=efficiency-working-set %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-DARWIN // CHECK-ESAN-DARWIN: unsupported option '-fsanitize=efficiency-{{.*}}' for target 'x86_64-apple-darwin10' -// RUN: %clang -target i386-apple-darwin -fsanitize=efficiency-cache-frag %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-I386-DARWIN -// RUN: %clang -target i386-apple-darwin -fsanitize=efficiency-working-set %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-I386-DARWIN +// RUN: %clang -target i386-apple-darwin -fsanitize=efficiency-cache-frag %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-I386-DARWIN +// RUN: %clang -target i386-apple-darwin -fsanitize=efficiency-working-set %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-I386-DARWIN // CHECK-ESAN-I386-DARWIN: unsupported option '-fsanitize=efficiency-{{.*}}' for target 'i386-apple-darwin' -// RUN: %clang -target arm-apple-ios -fsanitize=efficiency-cache-frag %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-ARM-IOS -// RUN: %clang -target arm-apple-ios -fsanitize=efficiency-working-set %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-ARM-IOS +// RUN: %clang -target arm-apple-ios -fsanitize=efficiency-cache-frag %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-ARM-IOS +// RUN: %clang -target arm-apple-ios -fsanitize=efficiency-working-set %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-ARM-IOS // CHECK-ESAN-ARM-IOS: unsupported option '-fsanitize=efficiency-{{.*}}' for target 'arm-apple-ios' -// RUN: %clang -target i386-apple-iossimulator -fsanitize=efficiency-cache-frag %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-I386-IOSSIMULATOR -// RUN: %clang -target i386-apple-iossimulator -fsanitize=efficiency-working-set %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-I386-IOSSIMULATOR +// RUN: %clang -target i386-apple-iossimulator -fsanitize=efficiency-cache-frag %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-I386-IOSSIMULATOR +// RUN: %clang -target i386-apple-iossimulator -fsanitize=efficiency-working-set %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-I386-IOSSIMULATOR // CHECK-ESAN-I386-IOSSIMULATOR: unsupported option '-fsanitize=efficiency-{{.*}}' for target 'i386-apple-iossimulator' -// RUN: %clang -target i386-apple-tvossimulator -fsanitize=efficiency-cache-frag %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-I386-TVOSSIMULATOR -// RUN: %clang -target i386-apple-tvossimulator -fsanitize=efficiency-working-set %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-I386-TVOSSIMULATOR +// RUN: %clang -target i386-apple-tvossimulator -fsanitize=efficiency-cache-frag %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-I386-TVOSSIMULATOR +// RUN: %clang -target i386-apple-tvossimulator -fsanitize=efficiency-working-set %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-I386-TVOSSIMULATOR // CHECK-ESAN-I386-TVOSSIMULATOR: unsupported option '-fsanitize=efficiency-{{.*}}' for target 'i386-apple-tvossimulator' -// RUN: %clang -target x86_64-linux-gnu -fvisibility=hidden -fsanitize=cfi -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI -// RUN: %clang -target x86_64-apple-darwin10 -fvisibility=hidden -fsanitize=cfi -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI -// RUN: %clang -target x86_64-linux-gnu -fvisibility=hidden -fsanitize=cfi-derived-cast -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-DCAST -// RUN: %clang -target x86_64-linux-gnu -fvisibility=hidden -fsanitize=cfi-unrelated-cast -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-UCAST -// RUN: %clang -target x86_64-linux-gnu -flto -fvisibility=hidden -fsanitize=cfi-nvcall -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NVCALL -// RUN: %clang -target x86_64-linux-gnu -flto -fvisibility=hidden -fsanitize=cfi-vcall -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-VCALL -// RUN: %clang -target arm-linux-gnu -fvisibility=hidden -fsanitize=cfi -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI -// RUN: %clang -target aarch64-linux-gnu -fvisibility=hidden -fsanitize=cfi -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI -// RUN: %clang -target arm-linux-android -fvisibility=hidden -fsanitize=cfi -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI -// RUN: %clang -target aarch64-linux-android -fvisibility=hidden -fsanitize=cfi -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI +// RUN: %clang -target x86_64-linux-gnu -fvisibility=hidden -fsanitize=cfi -flto -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI +// RUN: %clang -target x86_64-apple-darwin10 -fvisibility=hidden -fsanitize=cfi -flto -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI +// RUN: %clang -target x86_64-linux-gnu -fvisibility=hidden -fsanitize=cfi-derived-cast -flto -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-DCAST +// RUN: %clang -target x86_64-linux-gnu -fvisibility=hidden -fsanitize=cfi-unrelated-cast -flto -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-UCAST +// RUN: %clang -target x86_64-linux-gnu -flto -fvisibility=hidden -fsanitize=cfi-nvcall -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NVCALL +// RUN: %clang -target x86_64-linux-gnu -flto -fvisibility=hidden -fsanitize=cfi-vcall -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-VCALL +// RUN: %clang -target arm-linux-gnu -fvisibility=hidden -fsanitize=cfi -flto -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI +// RUN: %clang -target aarch64-linux-gnu -fvisibility=hidden -fsanitize=cfi -flto -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI +// RUN: %clang -target arm-linux-android -fvisibility=hidden -fsanitize=cfi -flto -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI +// RUN: %clang -target aarch64-linux-android -fvisibility=hidden -fsanitize=cfi -flto -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI // CHECK-CFI: -emit-llvm-bc{{.*}}-fsanitize=cfi-derived-cast,cfi-icall,cfi-unrelated-cast,cfi-nvcall,cfi-vcall // CHECK-CFI-DCAST: -emit-llvm-bc{{.*}}-fsanitize=cfi-derived-cast // CHECK-CFI-UCAST: -emit-llvm-bc{{.*}}-fsanitize=cfi-unrelated-cast // CHECK-CFI-NVCALL: -emit-llvm-bc{{.*}}-fsanitize=cfi-nvcall // CHECK-CFI-VCALL: -emit-llvm-bc{{.*}}-fsanitize=cfi-vcall -// RUN: %clang -target x86_64-linux-gnu -fvisibility=hidden -flto -fsanitize=cfi-derived-cast -fno-lto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOLTO +// RUN: %clang -target x86_64-linux-gnu -fvisibility=hidden -flto -fsanitize=cfi-derived-cast -fno-lto -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOLTO // CHECK-CFI-NOLTO: '-fsanitize=cfi-derived-cast' only allowed with '-flto' -// RUN: %clang -target x86_64-linux-gnu -flto -fsanitize=cfi-derived-cast -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOVIS +// RUN: %clang -target x86_64-linux-gnu -flto -fsanitize=cfi-derived-cast -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOVIS // CHECK-CFI-NOVIS: '-fsanitize=cfi-derived-cast' only allowed with '-fvisibility=' -// RUN: %clang -target x86_64-pc-win32 -flto -fsanitize=cfi-derived-cast -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOVIS-NOERROR +// RUN: %clang -target x86_64-pc-win32 -flto -fsanitize=cfi-derived-cast -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOVIS-NOERROR // RUN: echo > %t.o -// RUN: %clang -target x86_64-linux-gnu -flto -fsanitize=cfi-derived-cast %t.o -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOVIS-NOERROR +// RUN: %clang -target x86_64-linux-gnu -flto -fsanitize=cfi-derived-cast %t.o -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOVIS-NOERROR // CHECK-CFI-NOVIS-NOERROR-NOT: only allowed with -// RUN: %clang -target mips-unknown-linux -fsanitize=cfi-icall %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-ICALL-MIPS +// RUN: %clang -target mips-unknown-linux -fsanitize=cfi-icall %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-ICALL-MIPS // CHECK-CFI-ICALL-MIPS: unsupported option '-fsanitize=cfi-icall' for target 'mips-unknown-linux' -// RUN: %clang -target x86_64-linux-gnu -fsanitize-trap=address -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-TRAP +// RUN: %clang -target x86_64-linux-gnu -fsanitize-trap=address -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-TRAP // CHECK-ASAN-TRAP: error: unsupported argument 'address' to option '-fsanitize-trap' -// RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.7 -flto -fsanitize=cfi-vcall -fno-sanitize-trap=cfi -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOTRAP-OLD-MACOS +// RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.7 -flto -fsanitize=cfi-vcall -fno-sanitize-trap=cfi -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOTRAP-OLD-MACOS // CHECK-CFI-NOTRAP-OLD-MACOS: error: unsupported option '-fno-sanitize-trap=cfi-vcall' for target 'x86_64-apple-darwin10' -// RUN: %clang -target x86_64-pc-win32 -flto -fsanitize=cfi-vcall -fno-sanitize-trap=cfi -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOTRAP-WIN +// RUN: %clang -target x86_64-pc-win32 -flto -fsanitize=cfi-vcall -fno-sanitize-trap=cfi -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOTRAP-WIN // CHECK-CFI-NOTRAP-WIN: -emit-llvm-bc // CHECK-CFI-NOTRAP-WIN-NOT: -fsanitize-trap=cfi -// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi -fsanitize-cfi-cross-dso -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-CROSS-DSO -// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NO-CROSS-DSO -// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi -fsanitize-cfi-cross-dso -fno-sanitize-cfi-cross-dso -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NO-CROSS-DSO -// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi -fno-sanitize-cfi-cross-dso -fsanitize-cfi-cross-dso -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-CROSS-DSO +// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi -fsanitize-cfi-cross-dso -flto -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-CROSS-DSO +// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi -flto -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NO-CROSS-DSO +// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi -fsanitize-cfi-cross-dso -fno-sanitize-cfi-cross-dso -flto -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NO-CROSS-DSO +// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi -fno-sanitize-cfi-cross-dso -fsanitize-cfi-cross-dso -flto -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-CROSS-DSO // CHECK-CFI-CROSS-DSO: -emit-llvm-bc // CHECK-CFI-CROSS-DSO: -fsanitize-cfi-cross-dso // CHECK-CFI-NO-CROSS-DSO: -emit-llvm-bc // CHECK-CFI-NO-CROSS-DSO-NOT: -fsanitize-cfi-cross-dso -// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi -fsanitize-stats -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-STATS +// RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi -fsanitize-stats -flto -c %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-STATS // CHECK-CFI-STATS: -fsanitize-stats -// RUN: %clang_cl -fsanitize=address -c -MDd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL -// RUN: %clang_cl -fsanitize=address -c -MTd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL -// RUN: %clang_cl -fsanitize=address -c -LDd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL -// RUN: %clang_cl -fsanitize=address -c -MD -MDd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL -// RUN: %clang_cl -fsanitize=address -c -MT -MTd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL -// RUN: %clang_cl -fsanitize=address -c -LD -LDd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL +// RUN: %clang_cl -fsanitize=address -c -MDd -### -mno-comment-section -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL +// RUN: %clang_cl -fsanitize=address -c -MTd -### -mno-comment-section -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL +// RUN: %clang_cl -fsanitize=address -c -LDd -### -mno-comment-section -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL +// RUN: %clang_cl -fsanitize=address -c -MD -MDd -### -mno-comment-section -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL +// RUN: %clang_cl -fsanitize=address -c -MT -MTd -### -mno-comment-section -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL +// RUN: %clang_cl -fsanitize=address -c -LD -LDd -### -mno-comment-section -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL // CHECK-ASAN-DEBUGRTL: error: invalid argument // CHECK-ASAN-DEBUGRTL: not allowed with '-fsanitize=address' // CHECK-ASAN-DEBUGRTL: note: AddressSanitizer doesn't support linking with debug runtime libraries yet -// RUN: %clang_cl -fsanitize=address -c -MT -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL -// RUN: %clang_cl -fsanitize=address -c -MD -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL -// RUN: %clang_cl -fsanitize=address -c -LD -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL -// RUN: %clang_cl -fsanitize=address -c -MTd -MT -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL -// RUN: %clang_cl -fsanitize=address -c -MDd -MD -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL -// RUN: %clang_cl -fsanitize=address -c -LDd -LD -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL +// RUN: %clang_cl -fsanitize=address -c -MT -### -mno-comment-section -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL +// RUN: %clang_cl -fsanitize=address -c -MD -### -mno-comment-section -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL +// RUN: %clang_cl -fsanitize=address -c -LD -### -mno-comment-section -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL +// RUN: %clang_cl -fsanitize=address -c -MTd -MT -### -mno-comment-section -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL +// RUN: %clang_cl -fsanitize=address -c -MDd -MD -### -mno-comment-section -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL +// RUN: %clang_cl -fsanitize=address -c -LDd -LD -### -mno-comment-section -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL // CHECK-ASAN-RELEASERTL-NOT: error: invalid argument -// RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP +// RUN: %clang -fno-sanitize=safe-stack -### -mno-comment-section %s 2>&1 | FileCheck %s -check-prefix=NOSP // NOSP-NOT: "-fsanitize=safe-stack" -// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP -// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP-ASAN -// RUN: %clang -target x86_64-linux-gnu -fstack-protector -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP -// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP -// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP -// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP -// RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NO-SP +// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### -mno-comment-section %s 2>&1 | FileCheck %s -check-prefix=NO-SP +// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,safe-stack -### -mno-comment-section %s 2>&1 | FileCheck %s -check-prefix=NO-SP-ASAN +// RUN: %clang -target x86_64-linux-gnu -fstack-protector -fsanitize=safe-stack -### -mno-comment-section %s 2>&1 | FileCheck %s -check-prefix=SP +// RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### -mno-comment-section %s 2>&1 | FileCheck %s -check-prefix=SP +// RUN: %clang -target arm-linux-androideabi -fsanitize=safe-stack -### -mno-comment-section %s 2>&1 | FileCheck %s -check-prefix=NO-SP +// RUN: %clang -target aarch64-linux-android -fsanitize=safe-stack -### -mno-comment-section %s 2>&1 | FileCheck %s -check-prefix=NO-SP +// RUN: %clang -target i386-contiki-unknown -fsanitize=safe-stack -### -mno-comment-section %s 2>&1 | FileCheck %s -check-prefix=NO-SP // NO-SP-NOT: stack-protector // NO-SP: "-fsanitize=safe-stack" // SP: "-fsanitize=safe-stack" @@ -447,30 +447,30 @@ // NO-SP-ASAN: "-fsanitize=address,safe-stack" // NO-SP-ASAN-NOT: stack-protector -// RUN: %clang -target powerpc64-unknown-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s -check-prefix=CHECK-SANM -// RUN: %clang -target powerpc64le-unknown-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s -check-prefix=CHECK-SANM +// RUN: %clang -target powerpc64-unknown-linux-gnu -fsanitize=memory %s -### -mno-comment-section 2>&1 | FileCheck %s -check-prefix=CHECK-SANM +// RUN: %clang -target powerpc64le-unknown-linux-gnu -fsanitize=memory %s -### -mno-comment-section 2>&1 | FileCheck %s -check-prefix=CHECK-SANM // CHECK-SANM: "-fsanitize=memory" -// RUN: %clang -target aarch64-unknown-cloudabi -fsanitize=safe-stack %s -### 2>&1 | FileCheck %s -check-prefix=SAFESTACK-CLOUDABI -// RUN: %clang -target x86_64-unknown-cloudabi -fsanitize=safe-stack %s -### 2>&1 | FileCheck %s -check-prefix=SAFESTACK-CLOUDABI +// RUN: %clang -target aarch64-unknown-cloudabi -fsanitize=safe-stack %s -### -mno-comment-section 2>&1 | FileCheck %s -check-prefix=SAFESTACK-CLOUDABI +// RUN: %clang -target x86_64-unknown-cloudabi -fsanitize=safe-stack %s -### -mno-comment-section 2>&1 | FileCheck %s -check-prefix=SAFESTACK-CLOUDABI // SAFESTACK-CLOUDABI: "-fsanitize=safe-stack" -// RUN: %clang -target x86_64-scei-ps4 -fsanitize=function -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-UBSAN-PS4 +// RUN: %clang -target x86_64-scei-ps4 -fsanitize=function -fsanitize=undefined %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-UBSAN-PS4 // CHECK-FSAN-UBSAN-PS4: unsupported option '-fsanitize=function' for target 'x86_64-scei-ps4' -// RUN: %clang -target x86_64-scei-ps4 -fsanitize=function %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-PS4 +// RUN: %clang -target x86_64-scei-ps4 -fsanitize=function %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-PS4 // CHECK-FSAN-PS4: unsupported option '-fsanitize=function' for target 'x86_64-scei-ps4' -// RUN: %clang -target x86_64-scei-ps4 -fsanitize=dataflow %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DFSAN-PS4 +// RUN: %clang -target x86_64-scei-ps4 -fsanitize=dataflow %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-DFSAN-PS4 // CHECK-DFSAN-PS4: unsupported option '-fsanitize=dataflow' for target 'x86_64-scei-ps4' -// RUN: %clang -target x86_64-scei-ps4 -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-PS4 +// RUN: %clang -target x86_64-scei-ps4 -fsanitize=leak %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-LSAN-PS4 // CHECK-LSAN-PS4: unsupported option '-fsanitize=leak' for target 'x86_64-scei-ps4' -// RUN: %clang -target x86_64-scei-ps4 -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-PS4 +// RUN: %clang -target x86_64-scei-ps4 -fsanitize=memory %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-PS4 // CHECK-MSAN-PS4: unsupported option '-fsanitize=memory' for target 'x86_64-scei-ps4' -// RUN: %clang -target x86_64-scei-ps4 -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-PS4 +// RUN: %clang -target x86_64-scei-ps4 -fsanitize=thread %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-PS4 // CHECK-TSAN-PS4: unsupported option '-fsanitize=thread' for target 'x86_64-scei-ps4' -// RUN: %clang -target x86_64-scei-ps4 -fsanitize=efficiency-cache-frag %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-PS4 -// RUN: %clang -target x86_64-scei-ps4 -fsanitize=efficiency-working-set %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-PS4 +// RUN: %clang -target x86_64-scei-ps4 -fsanitize=efficiency-cache-frag %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-PS4 +// RUN: %clang -target x86_64-scei-ps4 -fsanitize=efficiency-working-set %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ESAN-PS4 // CHECK-ESAN-PS4: unsupported option '-fsanitize=efficiency-{{.*}}' for target 'x86_64-scei-ps4' -// RUN: %clang -target x86_64-scei-ps4 -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-PS4 +// RUN: %clang -target x86_64-scei-ps4 -fsanitize=address %s -### -mno-comment-section 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-PS4 // Make sure there are no *.{o,bc} or -l passed before the ASan library. // CHECK-ASAN-PS4-NOT: {{(\.(o|bc)"? |-l).*-lSceDbgAddressSanitizer_stub_weak}} // CHECK-ASAN-PS4: -lSceDbgAddressSanitizer_stub_weak Index: test/Driver/function-sections.c =================================================================== --- test/Driver/function-sections.c +++ test/Driver/function-sections.c @@ -7,68 +7,68 @@ // CHECK-US-NOT: -fno-unique-section-names // CHECK-NOUS: -fno-unique-section-names -// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: %clang -no-canonical-prefixes %s -### -mno-comment-section -fsyntax-only 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: | FileCheck --check-prefix=CHECK-NOFS --check-prefix=CHECK-NODS %s -// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: %clang -no-canonical-prefixes %s -### -mno-comment-section -fsyntax-only 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: -ffunction-sections \ // RUN: | FileCheck --check-prefix=CHECK-FS %s -// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: %clang -no-canonical-prefixes %s -### -mno-comment-section -fsyntax-only 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: -fno-function-sections \ // RUN: | FileCheck --check-prefix=CHECK-NOFS %s -// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: %clang -no-canonical-prefixes %s -### -mno-comment-section -fsyntax-only 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: -ffunction-sections -fno-function-sections \ // RUN: | FileCheck --check-prefix=CHECK-NOFS %s -// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: %clang -no-canonical-prefixes %s -### -mno-comment-section -fsyntax-only 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: -fno-function-sections -ffunction-sections \ // RUN: | FileCheck --check-prefix=CHECK-FS %s -// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: %clang -no-canonical-prefixes %s -### -mno-comment-section -fsyntax-only 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: -ffunction-sections -fno-function-sections -ffunction-sections \ // RUN: | FileCheck --check-prefix=CHECK-FS %s -// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: %clang -no-canonical-prefixes %s -### -mno-comment-section -fsyntax-only 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: -fdata-sections \ // RUN: | FileCheck --check-prefix=CHECK-DS %s -// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: %clang -no-canonical-prefixes %s -### -mno-comment-section -fsyntax-only 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: -fno-data-sections \ // RUN: | FileCheck --check-prefix=CHECK-NODS %s -// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: %clang -no-canonical-prefixes %s -### -mno-comment-section -fsyntax-only 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: -fdata-sections -fno-data-sections \ // RUN: | FileCheck --check-prefix=CHECK-NODS %s -// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: %clang -no-canonical-prefixes %s -### -mno-comment-section -fsyntax-only 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: -fno-data-sections -fdata-sections \ // RUN: | FileCheck --check-prefix=CHECK-DS %s -// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: %clang -no-canonical-prefixes %s -### -mno-comment-section -fsyntax-only 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: -fdata-sections -fno-data-sections -fdata-sections \ // RUN: | FileCheck --check-prefix=CHECK-DS %s -// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: %clang -no-canonical-prefixes %s -### -mno-comment-section -fsyntax-only 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: -funique-section-names \ // RUN: | FileCheck --check-prefix=CHECK-US %s -// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: %clang -no-canonical-prefixes %s -### -mno-comment-section -fsyntax-only 2>&1 \ // RUN: -target i386-unknown-linux \ // RUN: -fno-unique-section-names \ // RUN: | FileCheck --check-prefix=CHECK-NOUS %s Index: test/Driver/mcomment-section-helper.py =================================================================== --- /dev/null +++ test/Driver/mcomment-section-helper.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +import re +import binascii +import argparse + +def find_in_list(query, list): + return [i for i, line in enumerate(list) if line.strip() == query] + +parser = argparse.ArgumentParser() + +parser.add_argument('--input', required=True) +parser.add_argument('--file_path', required=True) + +args = parser.parse_args() + +content = [] +with open(args.input, 'r') as f: + content = f.readlines() + +# get .comment section data +section_data_start = find_in_list('SectionData (', content)[3]+1 +section_data_end = find_in_list(')', content)[3] +hex_string = '' +for line in content[section_data_start:section_data_end]: + hex_columns = line.strip().split(' ')[1:5] + for column in hex_columns: + hex_string = hex_string + column +hex_string = hex_string[2:-2] +try: + (version_string, ident_string) = str(binascii.unhexlify(bytes(hex_string))).strip().split('Command-line options: ') + version_string = version_string.rstrip('\0') + ident_string = 'Command-line options: ' + ident_string.replace('\0', ' ') +except ValueError, e: + version_string = '' + ident_string = '' + +# get --help version +help_version_string = '' +for line in content: + if line.strip().startswith('Component: ') or line.strip().startswith('clang version'): + help_version_string = line.strip() + elif line.strip().startswith('Tool: '): + help_version_string = help_version_string + ' ' + line.strip() +ident_string = ident_string.replace(args.file_path, '%s') +print('Version match' if version_string == help_version_string else 'Version mismatch') +print(ident_string) \ No newline at end of file Index: test/Driver/mcomment-section.s =================================================================== --- /dev/null +++ test/Driver/mcomment-section.s @@ -0,0 +1,28 @@ +// REQUIRES: arm-registered-target +// Test that version and command-line information is added to the output + +// -mcomment-section is set by default +// RUN: %clang --target=arm-arm-none-eabi -march=armv7-a -c %s -emit-llvm -o - | llvm-readobj -s -sd > %t +// RUN: %clang --target=arm-arm-none-eabi --version >> %t +// RUN: %python %S/mcomment-section-helper.py --input %t --file_path %s | FileCheck %s -check-prefix=DEFAULT + +// DEFAULT: Version match +// DEFAULT-NEXT: Command-line options: {{.*}}--target=arm-arm-none-eabi -march=armv7-a -c %s -emit-llvm -o- + +// -mcomment-section set manually +// RUN: %clang --target=arm-arm-none-eabi -march=armv7-a -c %s -emit-llvm -o - -mcomment-section | llvm-readobj -s -sd > %t +// RUN: %clang --target=arm-arm-none-eabi --version >> %t +// RUN: %python %S/mcomment-section-helper.py --input %t --file_path %s | FileCheck %s -check-prefix=COMMENT + +// COMMENT: Version match +// COMMENT-NEXT: Command-line options: {{.*}}--target=arm-arm-none-eabi -march=armv7-a -c %s -emit-llvm -o- -mcomment-section + +// -mno-comment-section can be used to disable the feature +// RUN: %clang --target=arm-arm-none-eabi -march=armv7-a -c %s -emit-llvm -o - -mno-comment-section | llvm-readobj -s -sd > %t +// RUN: %clang --target=arm-arm-none-eabi --version >> %t +// RUN: %python %S/mcomment-section-helper.py --input %t --file_path %s | FileCheck %s -check-prefix=NOCOMMENT + +// NOCOMMENT: Version mismatch +// NOCOMMENT-NOT: Command-line options: {{.*}}--target=arm-arm-none-eabi -march=armv7-a -c %s -emit-llvm -o- -mno-comment-section + + mov r0, r0 Index: test/Driver/mips-as.c =================================================================== --- test/Driver/mips-as.c +++ test/Driver/mips-as.c @@ -1,264 +1,264 @@ // Check passing options to the assembler for MIPS targets. // -// RUN: %clang -target mips-linux-gnu -### \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS32R2-EB-AS %s -// RUN: %clang -target mipsel-linux-gnu -### \ +// RUN: %clang -target mipsel-linux-gnu -### -mno-comment-section \ // RUN: -no-integrated-as -c -EB %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS32R2-EB-AS %s // MIPS32R2-EB-AS: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // MIPS32R2-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" // -// RUN: %clang -target mips-linux-gnu -### \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section \ // RUN: -no-integrated-as -fPIC -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS32R2-EB-PIC %s // MIPS32R2-EB-PIC: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-call_nonpic" "-EB" // MIPS32R2-EB-PIC: "-KPIC" // -// RUN: %clang -target mipsel-linux-gnu -### \ +// RUN: %clang -target mipsel-linux-gnu -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS32R2-DEF-EL-AS %s // MIPS32R2-DEF-EL-AS: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EL" // -// RUN: %clang -target mips64-linux-gnu -### \ +// RUN: %clang -target mips64-linux-gnu -### -mno-comment-section \ // RUN: -no-integrated-as -fno-pic -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS64R2-EB-AS %s // MIPS64R2-EB-AS: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-EB" // -// RUN: %clang -target mips64-linux-gnu -### \ +// RUN: %clang -target mips64-linux-gnu -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS64R2-EB-AS-PIC %s // MIPS64R2-EB-AS-PIC: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-EB" "-KPIC" // -// RUN: %clang -target mips64el-linux-gnu -### \ +// RUN: %clang -target mips64el-linux-gnu -### -mno-comment-section \ // RUN: -no-integrated-as -c -fno-pic %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS64R2-DEF-EL-AS %s // MIPS64R2-DEF-EL-AS: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-EL" // -// RUN: %clang -target mips64el-linux-gnu -### \ +// RUN: %clang -target mips64el-linux-gnu -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS64R2-DEF-EL-AS-PIC %s // MIPS64R2-DEF-EL-AS-PIC: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-EL" "-KPIC" // -// RUN: %clang -target mips64-linux-gnu -mabi=n32 -### \ +// RUN: %clang -target mips64-linux-gnu -mabi=n32 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-N32-PIC %s // MIPS-N32-PIC: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "n32" "-call_nonpic" "-EB" "-KPIC" // -// RUN: %clang -target mips64-linux-gnu -mabi=n32 -### \ +// RUN: %clang -target mips64-linux-gnu -mabi=n32 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s -fno-pic 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-N32 %s // MIPS-N32: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "n32" "-mno-shared" "-call_nonpic" "-EB" // -// RUN: %clang -target mipsel-linux-gnu -mabi=32 -### \ +// RUN: %clang -target mipsel-linux-gnu -mabi=32 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS32R2-EL-AS %s -// RUN: %clang -target mips-linux-gnu -mabi=32 -### \ +// RUN: %clang -target mips-linux-gnu -mabi=32 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s -EL 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS32R2-EL-AS %s // MIPS32R2-EL-AS: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EL" // -// RUN: %clang -target mips64el-linux-gnu -mabi=64 -### \ +// RUN: %clang -target mips64el-linux-gnu -mabi=64 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS64R2-EL-AS-PIC %s // MIPS64R2-EL-AS-PIC: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-EL" "-KPIC" // -// RUN: %clang -target mips64el-linux-gnu -mabi=64 -### \ +// RUN: %clang -target mips64el-linux-gnu -mabi=64 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s -fno-pic 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS64R2-EL-AS %s // MIPS64R2-EL-AS: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-EL" // -// RUN: %clang -target mips-linux-gnu -march=mips32r2 -### \ +// RUN: %clang -target mips-linux-gnu -march=mips32r2 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-32R2 %s // MIPS-32R2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // -// RUN: %clang -target mips-linux-gnu -march=p5600 -### \ +// RUN: %clang -target mips-linux-gnu -march=p5600 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-P5600 %s // MIPS-P5600: as{{(.exe)?}}" "-march" "p5600" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // -// RUN: %clang -target mips64-linux-gnu -march=octeon -### \ +// RUN: %clang -target mips64-linux-gnu -march=octeon -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-OCTEON-PIC %s // MIPS-OCTEON-PIC: as{{(.exe)?}}" "-march" "octeon" "-mabi" "64" "-EB" "-KPIC" // -// RUN: %clang -target mips64-linux-gnu -march=octeon -### \ +// RUN: %clang -target mips64-linux-gnu -march=octeon -### -mno-comment-section \ // RUN: -no-integrated-as -c %s -fno-pic 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-OCTEON %s // MIPS-OCTEON: as{{(.exe)?}}" "-march" "octeon" "-mabi" "64" "-mno-shared" "-EB" // -// RUN: %clang -target mips-linux-gnu -mips1 -### \ +// RUN: %clang -target mips-linux-gnu -mips1 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-1 %s // MIPS-ALIAS-1: as{{(.exe)?}}" "-march" "mips1" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // -// RUN: %clang -target mips-linux-gnu -mips2 -### \ +// RUN: %clang -target mips-linux-gnu -mips2 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-2 %s // MIPS-ALIAS-2: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // -// RUN: %clang -target mips-linux-gnu -mips3 -### \ +// RUN: %clang -target mips-linux-gnu -mips3 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-3 %s // MIPS-ALIAS-3: as{{(.exe)?}}" "-march" "mips3" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // -// RUN: %clang -target mips-linux-gnu -mips4 -### \ +// RUN: %clang -target mips-linux-gnu -mips4 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-4 %s // MIPS-ALIAS-4: as{{(.exe)?}}" "-march" "mips4" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // -// RUN: %clang -target mips-linux-gnu -mips5 -### \ +// RUN: %clang -target mips-linux-gnu -mips5 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-5 %s // MIPS-ALIAS-5: as{{(.exe)?}}" "-march" "mips5" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // -// RUN: %clang -target mips-linux-gnu -mips32 -### \ +// RUN: %clang -target mips-linux-gnu -mips32 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-32 %s // MIPS-ALIAS-32: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // -// RUN: %clang -target mips-linux-gnu -mips32r2 -### \ +// RUN: %clang -target mips-linux-gnu -mips32r2 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-32R2 %s // MIPS-ALIAS-32R2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // -// RUN: %clang -target mips-linux-gnu -mips32r3 -### \ +// RUN: %clang -target mips-linux-gnu -mips32r3 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-32R3 %s // MIPS-ALIAS-32R3: as{{(.exe)?}}" "-march" "mips32r3" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // -// RUN: %clang -target mips-linux-gnu -mips32r5 -### \ +// RUN: %clang -target mips-linux-gnu -mips32r5 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-32R5 %s // MIPS-ALIAS-32R5: as{{(.exe)?}}" "-march" "mips32r5" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // -// RUN: %clang -target mips-linux-gnu -mips32r6 -### \ +// RUN: %clang -target mips-linux-gnu -mips32r6 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-32R6 %s // MIPS-ALIAS-32R6: as{{(.exe)?}}" "-march" "mips32r6" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // -// RUN: %clang -target mips64-linux-gnu -mips64 -### \ +// RUN: %clang -target mips64-linux-gnu -mips64 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64-PIC %s // MIPS-ALIAS-64-PIC: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-EB" "-KPIC" // -// RUN: %clang -target mips64-linux-gnu -mips64 -### \ +// RUN: %clang -target mips64-linux-gnu -mips64 -### -mno-comment-section \ // RUN: -no-integrated-as -c -fno-pic %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64 %s // MIPS-ALIAS-64: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-mno-shared" "-EB" // -// RUN: %clang -target mips64-linux-gnu -mips64r2 -### \ +// RUN: %clang -target mips64-linux-gnu -mips64r2 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R2-PIC %s // MIPS-ALIAS-64R2-PIC: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-EB" "-KPIC" // -// RUN: %clang -target mips64-linux-gnu -mips64r3 -### \ +// RUN: %clang -target mips64-linux-gnu -mips64r3 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R3-PIC %s // MIPS-ALIAS-64R3-PIC: as{{(.exe)?}}" "-march" "mips64r3" "-mabi" "64" "-EB" "-KPIC" // -// RUN: %clang -target mips64-linux-gnu -mips64r3 -### \ +// RUN: %clang -target mips64-linux-gnu -mips64r3 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s -fno-pic 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R3 %s // MIPS-ALIAS-64R3: as{{(.exe)?}}" "-march" "mips64r3" "-mabi" "64" "-mno-shared" "-EB" // -// RUN: %clang -target mips64-linux-gnu -mips64r5 -### \ +// RUN: %clang -target mips64-linux-gnu -mips64r5 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R5-PIC %s // MIPS-ALIAS-64R5-PIC: as{{(.exe)?}}" "-march" "mips64r5" "-mabi" "64" "-EB" "-KPIC" // -// RUN: %clang -target mips64-linux-gnu -mips64r5 -### \ +// RUN: %clang -target mips64-linux-gnu -mips64r5 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s -fno-pic 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R5 %s // MIPS-ALIAS-64R5: as{{(.exe)?}}" "-march" "mips64r5" "-mabi" "64" "-mno-shared" "-EB" // -// RUN: %clang -target mips64-linux-gnu -mips64r6 -### \ +// RUN: %clang -target mips64-linux-gnu -mips64r6 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R6-PIC %s // MIPS-ALIAS-64R6-PIC: as{{(.exe)?}}" "-march" "mips64r6" "-mabi" "64" "-EB" "-KPIC" // -// RUN: %clang -target mips64-linux-gnu -mips64r6 -### \ +// RUN: %clang -target mips64-linux-gnu -mips64r6 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s -fno-pic 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R6 %s // MIPS-ALIAS-64R6: as{{(.exe)?}}" "-march" "mips64r6" "-mabi" "64" "-mno-shared" "-EB" // -// RUN: %clang -target mips-linux-gnu -mno-mips16 -mips16 -### \ +// RUN: %clang -target mips-linux-gnu -mno-mips16 -mips16 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-16 %s // MIPS-16: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mips16" // -// RUN: %clang -target mips-linux-gnu -mips16 -mno-mips16 -### \ +// RUN: %clang -target mips-linux-gnu -mips16 -mno-mips16 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-N16 %s // MIPS-N16: as{{(.exe)?}}" // MIPS-N16: -no-mips16 // -// RUN: %clang -target mips-linux-gnu -mno-micromips -mmicromips -### \ +// RUN: %clang -target mips-linux-gnu -mno-micromips -mmicromips -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-MICRO %s // MIPS-MICRO: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mmicromips" // -// RUN: %clang -target mips-linux-gnu -mmicromips -mno-micromips -### \ +// RUN: %clang -target mips-linux-gnu -mmicromips -mno-micromips -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-NMICRO %s // MIPS-NMICRO: as{{(.exe)?}}" // MIPS-NMICRO-NOT: {{[A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-mmicromips" // -// RUN: %clang -target mips-linux-gnu -mno-dsp -mdsp -### \ +// RUN: %clang -target mips-linux-gnu -mno-dsp -mdsp -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-DSP %s // MIPS-DSP: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mdsp" // -// RUN: %clang -target mips-linux-gnu -mdsp -mno-dsp -### \ +// RUN: %clang -target mips-linux-gnu -mdsp -mno-dsp -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-NDSP %s // MIPS-NDSP: as{{(.exe)?}}" // MIPS-NDSP-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-mdsp" // -// RUN: %clang -target mips-linux-gnu -mno-dspr2 -mdspr2 -### \ +// RUN: %clang -target mips-linux-gnu -mno-dspr2 -mdspr2 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-DSPR2 %s // MIPS-DSPR2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mdspr2" // -// RUN: %clang -target mips-linux-gnu -mdspr2 -mno-dspr2 -### \ +// RUN: %clang -target mips-linux-gnu -mdspr2 -mno-dspr2 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-NDSPR2 %s // MIPS-NDSPR2: as{{(.exe)?}}" // MIPS-NDSPR2-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-mdspr2" // -// RUN: %clang -target mips-linux-gnu -mnan=legacy -mnan=2008 -### \ +// RUN: %clang -target mips-linux-gnu -mnan=legacy -mnan=2008 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-NAN2008 %s // MIPS-NAN2008: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mnan=2008" // -// RUN: %clang -target mips-linux-gnu -mnan=2008 -mnan=legacy -### \ +// RUN: %clang -target mips-linux-gnu -mnan=2008 -mnan=legacy -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-NAN-LEGACY %s // MIPS-NAN-LEGACY: as{{(.exe)?}}" // MIPS-NAN-LEGACY-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-mnan={{.*}}" // -// RUN: %clang -target mips-linux-gnu -mfp64 -mfpxx -mfp32 -### \ +// RUN: %clang -target mips-linux-gnu -mfp64 -mfpxx -mfp32 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-MFP32 %s // MIPS-MFP32: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mfp32" // -// RUN: %clang -target mips-linux-gnu -mfp32 -mfp64 -mfpxx -### \ +// RUN: %clang -target mips-linux-gnu -mfp32 -mfp64 -mfpxx -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-MFPXX %s // MIPS-MFPXX: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mfpxx" // -// RUN: %clang -target mips-linux-gnu -mfpxx -mfp32 -mfp64 -### \ +// RUN: %clang -target mips-linux-gnu -mfpxx -mfp32 -mfp64 -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-MFP64 %s // MIPS-MFP64: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mfp64" // -// RUN: %clang -target mips-linux-gnu -mno-msa -mmsa -### \ +// RUN: %clang -target mips-linux-gnu -mno-msa -mmsa -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-MSA %s // MIPS-MSA: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" "-mmsa" // -// RUN: %clang -target mips-linux-gnu -mmsa -mno-msa -### \ +// RUN: %clang -target mips-linux-gnu -mmsa -mno-msa -### -mno-comment-section \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-NMSA %s // MIPS-NMSA: as{{(.exe)?}}" @@ -267,137 +267,137 @@ // We've already tested MIPS32r2 and MIPS64r2 thoroughly. Do minimal tests on // the remaining CPU's since it was possible to pass on a -mabi with no value // when the CPU name is absent from a StringSwitch in getMipsCPUAndABI() -// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -c %s -mcpu=mips1 \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section -no-integrated-as -c %s -mcpu=mips1 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS1-EB-AS %s // MIPS1-EB-AS: as{{(.exe)?}}" "-march" "mips1" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // MIPS1-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" // -// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -c %s -mcpu=mips2 \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section -no-integrated-as -c %s -mcpu=mips2 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS2-EB-AS %s // MIPS2-EB-AS: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // MIPS2-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" // -// RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips3 \ +// RUN: %clang -target mips64-linux-gnu -### -mno-comment-section -no-integrated-as -c %s -mcpu=mips3 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS3-EB-AS %s // MIPS3-EB-AS: as{{(.exe)?}}" "-march" "mips3" "-mabi" "64" "-EB" "-KPIC" // -// RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips4 \ +// RUN: %clang -target mips64-linux-gnu -### -mno-comment-section -no-integrated-as -c %s -mcpu=mips4 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS4-EB-AS %s // MIPS4-EB-AS: as{{(.exe)?}}" "-march" "mips4" "-mabi" "64" "-EB" "-KPIC" // -// RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips5 \ +// RUN: %clang -target mips64-linux-gnu -### -mno-comment-section -no-integrated-as -c %s -mcpu=mips5 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS5-EB-AS %s // MIPS5-EB-AS: as{{(.exe)?}}" "-march" "mips5" "-mabi" "64" "-EB" "-KPIC" // -// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -c %s -mcpu=mips32 \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section -no-integrated-as -c %s -mcpu=mips32 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS32-EB-AS %s // MIPS32-EB-AS: as{{(.exe)?}}" "-march" "mips32" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // MIPS32-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" // -// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -c %s -mcpu=mips32r6 \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section -no-integrated-as -c %s -mcpu=mips32r6 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS32R6-EB-AS %s // MIPS32R6-EB-AS: as{{(.exe)?}}" "-march" "mips32r6" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // MIPS32R6-EB-AS-NOT: "{{[ A-Za-z\\\/]*}}as{{(.exe)?}}{{.*}}"-KPIC" // -// RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips64 \ +// RUN: %clang -target mips64-linux-gnu -### -mno-comment-section -no-integrated-as -c %s -mcpu=mips64 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS64-EB-AS %s // MIPS64-EB-AS: as{{(.exe)?}}" "-march" "mips64" "-mabi" "64" "-EB" "-KPIC" // -// RUN: %clang -target mips64-linux-gnu -### -no-integrated-as -c %s -mcpu=mips64r6 \ +// RUN: %clang -target mips64-linux-gnu -### -mno-comment-section -no-integrated-as -c %s -mcpu=mips64r6 \ // RUN: 2>&1 | FileCheck -check-prefix=MIPS64R6-EB-AS %s // MIPS64R6-EB-AS: as{{(.exe)?}}" "-march" "mips64r6" "-mabi" "64" "-EB" "-KPIC" // -// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -msoft-float -mhard-float -c %s 2>&1 \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section -no-integrated-as -msoft-float -mhard-float -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=HARDFLOAT --implicit-check-not=-msoft-float %s // HARDFLOAT: as{{(.exe)?}}" // HARDFLOAT: -mhard-float // -// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -mhard-float -msoft-float -c %s 2>&1 \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section -no-integrated-as -mhard-float -msoft-float -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=SOFTFLOAT --implicit-check-not=-mhard-float %s // SOFTFLOAT: as{{(.exe)?}}" // SOFTFLOAT: -msoft-float // -// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -mno-odd-spreg -modd-spreg -c %s 2>&1 \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section -no-integrated-as -mno-odd-spreg -modd-spreg -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=ODDSPREG --implicit-check-not=-mno-odd-spreg %s // ODDSPREG: as{{(.exe)?}}" // ODDSPREG: -modd-spreg // -// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -modd-spreg -mno-odd-spreg -c %s 2>&1 \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section -no-integrated-as -modd-spreg -mno-odd-spreg -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=NOODDSPREG --implicit-check-not=-modd-spreg %s // NOODDSPREG: as{{(.exe)?}}" // NOODDSPREG: -mno-odd-spreg // -// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -mdouble-float -msingle-float -c %s 2>&1 \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section -no-integrated-as -mdouble-float -msingle-float -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=SINGLEFLOAT --implicit-check-not=-mdouble-float %s // SINGLEFLOAT: as{{(.exe)?}}" // SINGLEFLOAT: -msingle-float // -// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -msingle-float -mdouble-float -c %s 2>&1 \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section -no-integrated-as -msingle-float -mdouble-float -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=DOUBLEFLOAT --implicit-check-not=-msingle-float %s // DOUBLEFLOAT: as{{(.exe)?}}" // DOUBLEFLOAT: -mdouble-float // -// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -msoft-float -c %s 2>&1 \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section -no-integrated-as -msoft-float -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=SOFTFLOAT-IMPLICIT-FPXX --implicit-check-not=-mfpxx %s // SOFTFLOAT-IMPLICIT-FPXX: as{{(.exe)?}}" // SOFTFLOAT-IMPLICIT-FPXX: -msoft-float // -// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -msoft-float -mfpxx -c %s 2>&1 \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section -no-integrated-as -msoft-float -mfpxx -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=SOFTFLOAT-EXPLICIT-FPXX %s // SOFTFLOAT-EXPLICIT-FPXX: as{{(.exe)?}}" // SOFTFLOAT-EXPLICIT-FPXX: -mfpxx // SOFTFLOAT-EXPLICIT-FPXX: -msoft-float // -// RUN: %clang -target mips-mti-linux-gnu -### -no-integrated-as -msoft-float -c %s 2>&1 \ +// RUN: %clang -target mips-mti-linux-gnu -### -mno-comment-section -no-integrated-as -msoft-float -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MTI-SOFTFLOAT-IMPLICIT-FPXX --implicit-check-not=-mfpxx %s // MTI-SOFTFLOAT-IMPLICIT-FPXX: as{{(.exe)?}}" // MTI-SOFTFLOAT-IMPLICIT-FPXX: -msoft-float // -// RUN: %clang -target mips-mti-linux-gnu -### -no-integrated-as -msoft-float -mfpxx -c %s 2>&1 \ +// RUN: %clang -target mips-mti-linux-gnu -### -mno-comment-section -no-integrated-as -msoft-float -mfpxx -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MTI-SOFTFLOAT-EXPLICIT-FPXX %s // MTI-SOFTFLOAT-EXPLICIT-FPXX: as{{(.exe)?}}" // MTI-SOFTFLOAT-EXPLICIT-FPXX: -mfpxx // MTI-SOFTFLOAT-EXPLICIT-FPXX: -msoft-float // -// RUN: %clang -target mips-img-linux-gnu -### -no-integrated-as -msoft-float -c %s 2>&1 \ +// RUN: %clang -target mips-img-linux-gnu -### -mno-comment-section -no-integrated-as -msoft-float -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=IMG-SOFTFLOAT-IMPLICIT-FPXX --implicit-check-not=-mfpxx %s // IMG-SOFTFLOAT-IMPLICIT-FPXX: as{{(.exe)?}}" // IMG-SOFTFLOAT-IMPLICIT-FPXX: -msoft-float // -// RUN: %clang -target mips-img-linux-gnu -### -no-integrated-as -msoft-float -mfpxx -c %s 2>&1 \ +// RUN: %clang -target mips-img-linux-gnu -### -mno-comment-section -no-integrated-as -msoft-float -mfpxx -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=IMG-SOFTFLOAT-EXPLICIT-FPXX %s // IMG-SOFTFLOAT-EXPLICIT-FPXX: as{{(.exe)?}}" // IMG-SOFTFLOAT-EXPLICIT-FPXX: -mfpxx // IMG-SOFTFLOAT-EXPLICIT-FPXX: -msoft-float // -// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -msingle-float -c %s 2>&1 \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section -no-integrated-as -msingle-float -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=SINGLEFLOAT-IMPLICIT-FPXX --implicit-check-not=-mfpxx %s // SINGLEFLOAT-IMPLICIT-FPXX: as{{(.exe)?}}" // SINGLEFLOAT-IMPLICIT-FPXX: -msingle-float // -// RUN: %clang -target mips-linux-gnu -### -no-integrated-as -msingle-float -mfpxx -c %s 2>&1 \ +// RUN: %clang -target mips-linux-gnu -### -mno-comment-section -no-integrated-as -msingle-float -mfpxx -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=SINGLEFLOAT-EXPLICIT-FPXX %s // SINGLEFLOAT-EXPLICIT-FPXX: as{{(.exe)?}}" // SINGLEFLOAT-EXPLICIT-FPXX: -mfpxx // SINGLEFLOAT-EXPLICIT-FPXX: -msingle-float // -// RUN: %clang -target mips-mti-linux-gnu -### -no-integrated-as -msingle-float -c %s 2>&1 \ +// RUN: %clang -target mips-mti-linux-gnu -### -mno-comment-section -no-integrated-as -msingle-float -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MTI-SINGLEFLOAT-IMPLICIT-FPXX --implicit-check-not=-mfpxx %s // MTI-SINGLEFLOAT-IMPLICIT-FPXX: as{{(.exe)?}}" // MTI-SINGLEFLOAT-IMPLICIT-FPXX: -msingle-float // -// RUN: %clang -target mips-mti-linux-gnu -### -no-integrated-as -msingle-float -mfpxx -c %s 2>&1 \ +// RUN: %clang -target mips-mti-linux-gnu -### -mno-comment-section -no-integrated-as -msingle-float -mfpxx -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MTI-SINGLEFLOAT-EXPLICIT-FPXX %s // MTI-SINGLEFLOAT-EXPLICIT-FPXX: as{{(.exe)?}}" // MTI-SINGLEFLOAT-EXPLICIT-FPXX: -mfpxx // MTI-SINGLEFLOAT-EXPLICIT-FPXX: -msingle-float // -// RUN: %clang -target mips-img-linux-gnu -### -no-integrated-as -msingle-float -c %s 2>&1 \ +// RUN: %clang -target mips-img-linux-gnu -### -mno-comment-section -no-integrated-as -msingle-float -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=IMG-SINGLEFLOAT-IMPLICIT-FPXX --implicit-check-not=-mfpxx %s // IMG-SINGLEFLOAT-IMPLICIT-FPXX: as{{(.exe)?}}" // IMG-SINGLEFLOAT-IMPLICIT-FPXX: -msingle-float // -// RUN: %clang -target mips-img-linux-gnu -### -no-integrated-as -msingle-float -mfpxx -c %s 2>&1 \ +// RUN: %clang -target mips-img-linux-gnu -### -mno-comment-section -no-integrated-as -msingle-float -mfpxx -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=IMG-SINGLEFLOAT-EXPLICIT-FPXX %s // IMG-SINGLEFLOAT-EXPLICIT-FPXX: as{{(.exe)?}}" // IMG-SINGLEFLOAT-EXPLICIT-FPXX: -mfpxx Index: test/Driver/modules.m =================================================================== --- test/Driver/modules.m +++ test/Driver/modules.m @@ -1,66 +1,66 @@ -// RUN: %clang -fmodules -fno-modules -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s +// RUN: %clang -fmodules -fno-modules -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s // CHECK-NO-MODULES-NOT: -fmodules -// RUN: %clang -fmodules -fno-modules -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s +// RUN: %clang -fmodules -fno-modules -fmodules -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s // CHECK-HAS-MODULES: -fmodules -// RUN: %clang -fbuild-session-file=doesntexist -### %s 2>&1 | FileCheck -check-prefix=NOFILE %s +// RUN: %clang -fbuild-session-file=doesntexist -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=NOFILE %s // NOFILE: no such file or directory: 'doesntexist' // RUN: touch -m -a -t 201008011501 %t.build-session-file -// RUN: %clang -fbuild-session-file=%t.build-session-file -### %s 2>&1 | FileCheck -check-prefix=TIMESTAMP_ONLY %s +// RUN: %clang -fbuild-session-file=%t.build-session-file -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=TIMESTAMP_ONLY %s -// RUN: %clang -fbuild-session-timestamp=1280703457 -### %s 2>&1 | FileCheck -check-prefix=TIMESTAMP_ONLY %s +// RUN: %clang -fbuild-session-timestamp=1280703457 -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=TIMESTAMP_ONLY %s // TIMESTAMP_ONLY: -fbuild-session-timestamp=128 -// RUN: %clang -fbuild-session-file=%t.build-session-file -fbuild-session-timestamp=123 -### %s 2>&1 | FileCheck -check-prefix=CONFLICT %s +// RUN: %clang -fbuild-session-file=%t.build-session-file -fbuild-session-timestamp=123 -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CONFLICT %s // CONFLICT: error: invalid argument '-fbuild-session-file={{.*}}.build-session-file' not allowed with '-fbuild-session-timestamp' -// RUN: %clang -fbuild-session-timestamp=123 -fmodules-validate-once-per-build-session -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_ONCE %s +// RUN: %clang -fbuild-session-timestamp=123 -fmodules-validate-once-per-build-session -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_ONCE %s // MODULES_VALIDATE_ONCE: -fbuild-session-timestamp=123 // MODULES_VALIDATE_ONCE: -fmodules-validate-once-per-build-session -// RUN: %clang -fbuild-session-file=%t.build-session-file -fmodules-validate-once-per-build-session -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_ONCE_FILE %s +// RUN: %clang -fbuild-session-file=%t.build-session-file -fmodules-validate-once-per-build-session -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_ONCE_FILE %s // MODULES_VALIDATE_ONCE_FILE: -fbuild-session-timestamp=128 // MODULES_VALIDATE_ONCE_FILE: -fmodules-validate-once-per-build-session -// RUN: %clang -fmodules-validate-once-per-build-session -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_ONCE_ERR %s +// RUN: %clang -fmodules-validate-once-per-build-session -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_ONCE_ERR %s // MODULES_VALIDATE_ONCE_ERR: option '-fmodules-validate-once-per-build-session' requires '-fbuild-session-timestamp=' or '-fbuild-session-file=' -// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_SYSTEM_HEADERS_DEFAULT %s +// RUN: %clang -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_SYSTEM_HEADERS_DEFAULT %s // MODULES_VALIDATE_SYSTEM_HEADERS_DEFAULT-NOT: -fmodules-validate-system-headers -// RUN: %clang -fmodules-validate-system-headers -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_SYSTEM_HEADERS %s +// RUN: %clang -fmodules-validate-system-headers -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_SYSTEM_HEADERS %s // MODULES_VALIDATE_SYSTEM_HEADERS: -fmodules-validate-system-headers -// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=MODULES_DISABLE_DIAGNOSTIC_VALIDATION_DEFAULT %s +// RUN: %clang -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=MODULES_DISABLE_DIAGNOSTIC_VALIDATION_DEFAULT %s // MODULES_DISABLE_DIAGNOSTIC_VALIDATION_DEFAULT-NOT: -fmodules-disable-diagnostic-validation -// RUN: %clang -fmodules-disable-diagnostic-validation -### %s 2>&1 | FileCheck -check-prefix=MODULES_DISABLE_DIAGNOSTIC_VALIDATION %s +// RUN: %clang -fmodules-disable-diagnostic-validation -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=MODULES_DISABLE_DIAGNOSTIC_VALIDATION %s // MODULES_DISABLE_DIAGNOSTIC_VALIDATION: -fmodules-disable-diagnostic-validation -// RUN: %clang -fmodules -### %s 2>&1 | FileCheck -check-prefix=MODULES_PREBUILT_PATH_DEFAULT %s +// RUN: %clang -fmodules -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=MODULES_PREBUILT_PATH_DEFAULT %s // MODULES_PREBUILT_PATH_DEFAULT-NOT: -fprebuilt-module-path -// RUN: %clang -fmodules -fprebuilt-module-path=foo -fprebuilt-module-path=bar -### %s 2>&1 | FileCheck -check-prefix=MODULES_PREBUILT_PATH %s +// RUN: %clang -fmodules -fprebuilt-module-path=foo -fprebuilt-module-path=bar -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=MODULES_PREBUILT_PATH %s // MODULES_PREBUILT_PATH: "-fprebuilt-module-path=foo" // MODULES_PREBUILT_PATH: "-fprebuilt-module-path=bar" -// RUN: %clang -fmodules -fmodule-map-file=foo.map -fmodule-map-file=bar.map -### %s 2>&1 | FileCheck -check-prefix=CHECK-MODULE-MAP-FILES %s +// RUN: %clang -fmodules -fmodule-map-file=foo.map -fmodule-map-file=bar.map -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-MODULE-MAP-FILES %s // CHECK-MODULE-MAP-FILES: "-fmodules" // CHECK-MODULE-MAP-FILES: "-fmodule-map-file=foo.map" // CHECK-MODULE-MAP-FILES: "-fmodule-map-file=bar.map" -// RUN: %clang -fmodules -fbuiltin-module-map -### %s 2>&1 | FileCheck -check-prefix=CHECK-BUILTIN-MODULE-MAP %s +// RUN: %clang -fmodules -fbuiltin-module-map -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-BUILTIN-MODULE-MAP %s // CHECK-BUILTIN-MODULE-MAP: "-fmodules" // CHECK-BUILTIN-MODULE-MAP: "-fmodule-map-file={{.*}}include{{/|\\\\}}module.modulemap" -// RUN: %clang -fmodules -fmodule-file=foo.pcm -fmodule-file=bar.pcm -### %s 2>&1 | FileCheck -check-prefix=CHECK-MODULE-FILES %s +// RUN: %clang -fmodules -fmodule-file=foo.pcm -fmodule-file=bar.pcm -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-MODULE-FILES %s // CHECK-MODULE-FILES: "-fmodules" // CHECK-MODULE-FILES: "-fmodule-file=foo.pcm" // CHECK-MODULE-FILES: "-fmodule-file=bar.pcm" -// RUN: %clang -fno-modules -fmodule-file=foo.pcm -fmodule-file=bar.pcm -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULE-FILES %s +// RUN: %clang -fno-modules -fmodule-file=foo.pcm -fmodule-file=bar.pcm -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULE-FILES %s // CHECK-NO-MODULE-FILES-NOT: "-fmodules" // CHECK-NO-MODULE-FILES-NOT: "-fmodule-file=foo.pcm" // CHECK-NO-MODULE-FILES-NOT: "-fmodule-file=bar.pcm" Index: test/Driver/modules.mm =================================================================== --- test/Driver/modules.mm +++ test/Driver/modules.mm @@ -1,15 +1,15 @@ -// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s -// RUN: %clang -fcxx-modules -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s -// RUN: %clang -fmodules -fno-cxx-modules -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s +// RUN: %clang -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s +// RUN: %clang -fcxx-modules -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s +// RUN: %clang -fmodules -fno-cxx-modules -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MODULES %s // CHECK-NO-MODULES-NOT: -fmodules -// RUN: %clang -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s -// RUN: %clang -fmodules -fno-cxx-modules -fcxx-modules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s +// RUN: %clang -fmodules -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s +// RUN: %clang -fmodules -fno-cxx-modules -fcxx-modules -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MODULES %s // CHECK-HAS-MODULES: -fmodules -// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MAPS %s -// RUN: %clang -fimplicit-module-maps -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MAPS %s -// RUN: %clang -fmodules -### %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MAPS %s -// RUN: %clang -fmodules -fno-implicit-module-maps -### %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MAPS %s +// RUN: %clang -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MAPS %s +// RUN: %clang -fimplicit-module-maps -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MAPS %s +// RUN: %clang -fmodules -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-HAS-MAPS %s +// RUN: %clang -fmodules -fno-implicit-module-maps -### -mno-comment-section %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MAPS %s // CHECK-HAS-MAPS: -fimplicit-module-maps // CHECK-NO-MAPS-NOT: -fimplicit-module-maps Index: test/Driver/ms-bitfields.c =================================================================== --- test/Driver/ms-bitfields.c +++ test/Driver/ms-bitfields.c @@ -1,6 +1,6 @@ -// RUN: %clang -### %s 2>&1 | FileCheck %s -check-prefix=NO-MSBITFIELDS -// RUN: %clang -### -mno-ms-bitfields -mms-bitfields %s 2>&1 | FileCheck %s -check-prefix=MSBITFIELDS -// RUN: %clang -### -mms-bitfields -mno-ms-bitfields %s 2>&1 | FileCheck %s -check-prefix=NO-MSBITFIELDS +// RUN: %clang -### -mno-comment-section %s 2>&1 | FileCheck %s -check-prefix=NO-MSBITFIELDS +// RUN: %clang -### -mno-comment-section -mno-ms-bitfields -mms-bitfields %s 2>&1 | FileCheck %s -check-prefix=MSBITFIELDS +// RUN: %clang -### -mno-comment-section -mms-bitfields -mno-ms-bitfields %s 2>&1 | FileCheck %s -check-prefix=NO-MSBITFIELDS // MSBITFIELDS: -mms-bitfields // NO-MSBITFIELDS-NOT: -mms-bitfields Index: test/Driver/offloading-interoperability.c =================================================================== --- test/Driver/offloading-interoperability.c +++ test/Driver/offloading-interoperability.c @@ -5,7 +5,7 @@ // // Verify that CUDA device commands do not get OpenMP flags. // -// RUN: %clang -no-canonical-prefixes -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp=libomp %s 2>&1 \ +// RUN: %clang -no-canonical-prefixes -### -mno-comment-section -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp=libomp %s 2>&1 \ // RUN: | FileCheck %s --check-prefix NO-OPENMP-FLAGS-FOR-CUDA-DEVICE // // NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: clang{{.*}}" "-cc1" "-triple" "nvptx64-nvidia-cuda" Index: test/Driver/pch-deps.c =================================================================== --- test/Driver/pch-deps.c +++ test/Driver/pch-deps.c @@ -1,21 +1,21 @@ -// RUN: %clang -x c-header %s -o %t.pch -MMD -MT dependencies -MF %t.d -### 2> %t +// RUN: %clang -x c-header %s -o %t.pch -MMD -MT dependencies -MF %t.d -### -mno-comment-section 2> %t // RUN: FileCheck %s -input-file=%t // CHECK: -emit-pch // CHECK: -dependency-file // CHECK: -module-file-deps -// RUN: %clang -c %s -o %t -MMD -MT dependencies -MF %t.d -### 2> %t +// RUN: %clang -c %s -o %t -MMD -MT dependencies -MF %t.d -### -mno-comment-section 2> %t // RUN: FileCheck %s -check-prefix=CHECK-NOPCH -input-file=%t // CHECK-NOPCH: -dependency-file // CHECK-NOPCH-NOT: -module-file-deps // RUN: %clang -x c-header %s -o %t.pch -MMD -MT dependencies -MF %t.d \ -// RUN: -fno-module-file-deps -### 2> %t +// RUN: -fno-module-file-deps -### -mno-comment-section 2> %t // RUN: FileCheck %s -check-prefix=CHECK-EXPLICIT -input-file=%t // CHECK-EXPLICIT: -dependency-file // CHECK-EXPLICIT-NOT: -module-file-deps -// RUN: %clang -x c++ %s -o %t.o -MMD -MT dependencies -MF %t.d -fmodule-file-deps -### 2> %t +// RUN: %clang -x c++ %s -o %t.o -MMD -MT dependencies -MF %t.d -fmodule-file-deps -### -mno-comment-section 2> %t // RUN: FileCheck %s -check-prefix=CHECK-EXPLICIT-NOPCH -input-file=%t // CHECK-EXPLICIT-NOPCH: -dependency-file // CHECK-EXPLICIT-NOPCH: -module-file-deps Index: test/Driver/stackrealign.c =================================================================== --- test/Driver/stackrealign.c +++ test/Driver/stackrealign.c @@ -1,6 +1,6 @@ -// RUN: %clang -### %s 2>&1 | FileCheck %s -check-prefix=NO-REALIGN -// RUN: %clang -### -mno-stackrealign -mstackrealign %s 2>&1 | FileCheck %s -check-prefix=REALIGN -// RUN: %clang -### -mstackrealign -mno-stackrealign %s 2>&1 | FileCheck %s -check-prefix=NO-REALIGN +// RUN: %clang -### -mno-comment-section %s 2>&1 | FileCheck %s -check-prefix=NO-REALIGN +// RUN: %clang -### -mno-comment-section -mno-stackrealign -mstackrealign %s 2>&1 | FileCheck %s -check-prefix=REALIGN +// RUN: %clang -### -mno-comment-section -mstackrealign -mno-stackrealign %s 2>&1 | FileCheck %s -check-prefix=NO-REALIGN // REQUIRES: clang-driver // REALIGN: -mstackrealign Index: test/Driver/warning-options_pedantic.cpp =================================================================== --- test/Driver/warning-options_pedantic.cpp +++ test/Driver/warning-options_pedantic.cpp @@ -2,11 +2,11 @@ // Delimiters match the start of the cc1 and the start of the linker lines // DELIMITERS: {{^ *"}} -// RUN: %clang -### -pedantic -no-pedantic %s 2>&1 | FileCheck -check-prefix=NO_PEDANTIC -check-prefix=DELIMITERS %s -// RUN: %clang -### -pedantic -Wno-pedantic %s 2>&1 | FileCheck -check-prefix=PEDANTIC -check-prefix=DELIMITERS %s +// RUN: %clang -### -mno-comment-section -pedantic -no-pedantic %s 2>&1 | FileCheck -check-prefix=NO_PEDANTIC -check-prefix=DELIMITERS %s +// RUN: %clang -### -mno-comment-section -pedantic -Wno-pedantic %s 2>&1 | FileCheck -check-prefix=PEDANTIC -check-prefix=DELIMITERS %s // NO_PEDANTIC-NOT: -pedantic -// RUN: %clang -### -pedantic -pedantic -no-pedantic -pedantic %s 2>&1 | FileCheck -check-prefix=PEDANTIC -check-prefix=DELIMITERS %s -// RUN: %clang -### -pedantic -pedantic -no-pedantic -Wpedantic %s 2>&1 | FileCheck -check-prefix=NO_PEDANTIC -check-prefix=DELIMITERS %s +// RUN: %clang -### -mno-comment-section -pedantic -pedantic -no-pedantic -pedantic %s 2>&1 | FileCheck -check-prefix=PEDANTIC -check-prefix=DELIMITERS %s +// RUN: %clang -### -mno-comment-section -pedantic -pedantic -no-pedantic -Wpedantic %s 2>&1 | FileCheck -check-prefix=NO_PEDANTIC -check-prefix=DELIMITERS %s // PEDANTIC: -pedantic // REQUIRES: clang-driver Index: test/Driver/wasm-toolchain.c =================================================================== --- test/Driver/wasm-toolchain.c +++ test/Driver/wasm-toolchain.c @@ -2,43 +2,43 @@ // enabling -ffunction-sections, -fdata-sections, and -fvisibility=hidden by // default. -// RUN: %clang %s -### -no-canonical-prefixes -target wasm32-unknown-unknown 2>&1 | FileCheck -check-prefix=CC1 %s +// RUN: %clang %s -### -mno-comment-section -no-canonical-prefixes -target wasm32-unknown-unknown 2>&1 | FileCheck -check-prefix=CC1 %s // CC1: clang{{.*}} "-cc1" "-triple" "wasm32-unknown-unknown" {{.*}} "-fvisibility" "hidden" {{.*}} "-ffunction-sections" "-fdata-sections" // Ditto, but ensure that a user -fno-function-sections disables the // default -ffunction-sections. -// RUN: %clang %s -### -target wasm32-unknown-unknown -fno-function-sections 2>&1 | FileCheck -check-prefix=NO_FUNCTION_SECTIONS %s +// RUN: %clang %s -### -mno-comment-section -target wasm32-unknown-unknown -fno-function-sections 2>&1 | FileCheck -check-prefix=NO_FUNCTION_SECTIONS %s // NO_FUNCTION_SECTIONS-NOT: function-sections // Ditto, but ensure that a user -fno-data-sections disables the // default -fdata-sections. -// RUN: %clang %s -### -target wasm32-unknown-unknown -fno-data-sections 2>&1 | FileCheck -check-prefix=NO_DATA_SECTIONS %s +// RUN: %clang %s -### -mno-comment-section -target wasm32-unknown-unknown -fno-data-sections 2>&1 | FileCheck -check-prefix=NO_DATA_SECTIONS %s // NO_DATA_SECTIONS-NOT: data-sections // Ditto, but ensure that a user -fvisibility=default disables the default // -fvisibility=hidden. -// RUN: %clang %s -### -target wasm32-unknown-unknown -fvisibility=default 2>&1 | FileCheck -check-prefix=FVISIBILITY_DEFAULT %s +// RUN: %clang %s -### -mno-comment-section -target wasm32-unknown-unknown -fvisibility=default 2>&1 | FileCheck -check-prefix=FVISIBILITY_DEFAULT %s // FVISIBILITY_DEFAULT-NOT: hidden // A basic C link command-line. -// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo %s 2>&1 | FileCheck -check-prefix=LINK %s +// RUN: %clang -### -mno-comment-section -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo %s 2>&1 | FileCheck -check-prefix=LINK %s // LINK: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" // LINK: lld{{.*}}" "-flavor" "ld" "-L/foo/lib32" "crt1.o" "crti.o" "[[temp]]" "-lc" "-lcompiler_rt" "crtn.o" "-o" "a.out" // A basic C link command-line with optimization. WebAssembly is somewhat // special in enabling --gc-sections by default. -// RUN: %clang -### -O2 -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo %s 2>&1 | FileCheck -check-prefix=LINK_OPT %s +// RUN: %clang -### -mno-comment-section -O2 -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo %s 2>&1 | FileCheck -check-prefix=LINK_OPT %s // LINK_OPT: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" // LINK_OPT: lld{{.*}}" "-flavor" "ld" "--gc-sections" "-L/foo/lib32" "crt1.o" "crti.o" "[[temp]]" "-lc" "-lcompiler_rt" "crtn.o" "-o" "a.out" // Ditto, but ensure that a user --no-gc-sections comes after the // default --gc-sections. -// RUN: %clang -### -O2 -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo -Wl,--no-gc-sections %s 2>&1 | FileCheck -check-prefix=NO_GC_SECTIONS %s +// RUN: %clang -### -mno-comment-section -O2 -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo -Wl,--no-gc-sections %s 2>&1 | FileCheck -check-prefix=NO_GC_SECTIONS %s // NO_GC_SECTIONS: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]" // NO_GC_SECTIONS: lld{{.*}}" "-flavor" "ld" "--gc-sections" "-L/foo/lib32" "crt1.o" "crti.o" "--no-gc-sections" "[[temp]]" "-lc" "-lcompiler_rt" "crtn.o" "-o" "a.out" Index: test/Frontend/ast-main.c =================================================================== --- test/Frontend/ast-main.c +++ test/Frontend/ast-main.c @@ -1,6 +1,6 @@ -// RUN: %clang -emit-llvm -S -o %t1.ll -x c - < %s +// RUN: %clang -mno-comment-section -emit-llvm -S -o %t1.ll -x c - < %s // RUN: %clang -emit-ast -o %t.ast %s -// RUN: %clang -emit-llvm -S -o %t2.ll -x ast - < %t.ast +// RUN: %clang -mno-comment-section -emit-llvm -S -o %t2.ll -x ast - < %t.ast // RUN: diff %t1.ll %t2.ll int main() { Index: test/Frontend/ast-main.cpp =================================================================== --- test/Frontend/ast-main.cpp +++ test/Frontend/ast-main.cpp @@ -1,6 +1,6 @@ -// RUN: %clang -emit-llvm -S -o %t1.ll -x c++ - < %s +// RUN: %clang -mno-comment-section -emit-llvm -S -o %t1.ll -x c++ - < %s // RUN: %clang -fno-delayed-template-parsing -emit-ast -o %t.ast %s -// RUN: %clang -emit-llvm -S -o %t2.ll -x ast - < %t.ast +// RUN: %clang -mno-comment-section -emit-llvm -S -o %t2.ll -x ast - < %t.ast // RUN: diff %t1.ll %t2.ll // http://llvm.org/bugs/show_bug.cgi?id=15377 Index: test/Headers/altivec-header.c =================================================================== --- test/Headers/altivec-header.c +++ test/Headers/altivec-header.c @@ -8,5 +8,6 @@ // (i.e. all inline routines in the header are marked "static") // CHECK: target triple = "powerpc64- -// CHECK-NEXT: {{^$}} -// CHECK-NEXT: {{llvm\..*}} +// CHECK-NOT: define +// CHECK-NOT: global +// CHECK-NOT: constant Index: test/Headers/htm-header.c =================================================================== --- test/Headers/htm-header.c +++ test/Headers/htm-header.c @@ -15,5 +15,6 @@ // (i.e. all inline routines in the header are marked "static") // CHECK: target triple = "powerpc64 -// CHECK-NEXT: {{^$}} -// CHECK-NEXT: {{llvm\..*}} +// CHECK-NOT: define +// CHECK-NOT: global +// CHECK-NOT: constant Index: test/lit.cfg =================================================================== --- test/lit.cfg +++ test/lit.cfg @@ -212,6 +212,7 @@ config.substitutions.append( ('%llvmshlibdir', config.llvm_shlib_dir) ) config.substitutions.append( ('%pluginext', config.llvm_plugin_ext) ) config.substitutions.append( ('%PATH%', config.environment['PATH']) ) +config.substitutions.append( ('%python', config.python_executable) ) if config.clang_examples: config.available_features.add('examples') Index: test/lit.site.cfg.in =================================================================== --- test/lit.site.cfg.in +++ test/lit.site.cfg.in @@ -9,6 +9,7 @@ config.llvm_shlib_dir = "@SHLIBDIR@" config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" +config.python_executable = "@PYTHON_EXECUTABLE@" config.clang_obj_root = "@CLANG_BINARY_DIR@" config.clang_tools_dir = "@CLANG_TOOLS_DIR@" config.host_triple = "@LLVM_HOST_TRIPLE@" Index: tools/driver/cc1as_main.cpp =================================================================== --- tools/driver/cc1as_main.cpp +++ tools/driver/cc1as_main.cpp @@ -52,6 +52,7 @@ #include "llvm/Support/Timer.h" #include "llvm/Support/raw_ostream.h" #include +#include #include using namespace clang; using namespace clang::driver; @@ -111,6 +112,7 @@ FileType OutputType; unsigned ShowHelp : 1; unsigned ShowVersion : 1; + std::string IdentString; /// @} /// @name Transliterate Options @@ -239,6 +241,7 @@ } Opts.ShowHelp = Args.hasArg(OPT_help); Opts.ShowVersion = Args.hasArg(OPT_version); + Opts.IdentString = Args.getLastArgValue(OPT_mident_string); // Transliterate Options Opts.OutputAsmVariant = @@ -281,6 +284,32 @@ return Out; } +static void EmitIdentString(const std::unique_ptr &Str, + AssemblerInvocation &Opts) { + std::istringstream iss(Opts.IdentString.substr(1, Opts.IdentString.length()-2)); + std::string s; + std::string line; + while (std::getline(iss, s, ';')) { + if ((s.length() + line.length()) < 80) { + if (!line.empty()) { + line += " " + s; + } + else { + line = "" + s; + } + } + else { + if (!line.empty()) { + Str.get()->EmitIdent(line); + } + line = "" + s; + } + } + if (!line.empty()) { + Str.get()->EmitIdent(line); + } +} + static bool ExecuteAssembler(AssemblerInvocation &Opts, DiagnosticsEngine &Diags) { // Get the target specific parser. @@ -408,6 +437,10 @@ Opts.IncrementalLinkerCompatible, /*DWARFMustBeAtTheEnd*/ true)); Str.get()->InitSections(Opts.NoExecStack); + // Add ident strings to the output stream + if (!Opts.IdentString.empty()) { + EmitIdentString(Str, Opts); + } } bool Failed = false;