diff --git a/clang/include/clang/Basic/DebugOptions.def b/clang/include/clang/Basic/DebugOptions.def index 7cd3edf08a17e..458608fc67972 100644 --- a/clang/include/clang/Basic/DebugOptions.def +++ b/clang/include/clang/Basic/DebugOptions.def @@ -108,6 +108,9 @@ ENUM_DEBUGOPT(DebugInfo, llvm::codegenoptions::DebugInfoKind, 4, /// Whether to generate macro debug info. DEBUGOPT(MacroDebugInfo, 1, 0) +/// Whether to not generate debug info for system headers. +DEBUGOPT(NoSystemDebug, 1, 0) + /// Tune the debug info for this debugger. ENUM_DEBUGOPT(DebuggerTuning, llvm::DebuggerKind, 3, llvm::DebuggerKind::Default) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index ace168f0e6f1d..c660f7d3e5ba9 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -3761,6 +3761,10 @@ def fdebug_macro : Flag<["-"], "fdebug-macro">, Group, def fno_debug_macro : Flag<["-"], "fno-debug-macro">, Group, Visibility<[ClangOption, CLOption, DXCOption]>, HelpText<"Do not emit macro debug information">; +def fno_system_debug : Flag<["-"], "fno-system-debug">, Group, + Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>, + HelpText<"Do not emit debug information for declarations in system headers">, + MarshallingInfoFlag>; def fstrict_aliasing : Flag<["-"], "fstrict-aliasing">, Group, Visibility<[ClangOption, CLOption, DXCOption]>, HelpText<"Enable optimizations based on strict aliasing rules">; diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 56c563fa438f2..cda279a39f0bb 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1376,7 +1376,7 @@ llvm::DIType *CGDebugInfo::CreateType(const TemplateSpecializationType *Ty, return Src; const auto *AliasDecl = cast(TD)->getTemplatedDecl(); - if (AliasDecl->hasAttr()) + if (AliasDecl->hasAttr() || noSystemDebugInfo(AliasDecl, CGM)) return Src; SmallString<128> NS; @@ -1435,7 +1435,8 @@ llvm::DIType *CGDebugInfo::CreateType(const TypedefType *Ty, llvm::DIType *Underlying = getOrCreateType(Ty->getDecl()->getUnderlyingType(), Unit); - if (Ty->getDecl()->hasAttr()) + if (Ty->getDecl()->hasAttr() || + noSystemDebugInfo(Ty->getDecl(), CGM)) return Underlying; // We don't set size information, but do specify where the typedef was @@ -1818,7 +1819,7 @@ void CGDebugInfo::CollectRecordFields( // the corresponding declarations in the source program. for (const auto *I : record->decls()) if (const auto *V = dyn_cast(I)) { - if (V->hasAttr()) + if (V->hasAttr() || noSystemDebugInfo(V, CGM)) continue; // Skip variable template specializations when emitting CodeView. MSVC @@ -2081,7 +2082,8 @@ void CGDebugInfo::CollectCXXMemberFunctions( // derived classes. GDB doesn't seem to notice/leverage these when I tried // it, so I'm not rushing to fix this. (GCC seems to produce them, if // referenced) - if (!Method || Method->isImplicit() || Method->hasAttr()) + if (!Method || Method->isImplicit() || Method->hasAttr() || + noSystemDebugInfo(Method, CGM)) continue; if (Method->getType()->castAs()->getContainedAutoType()) @@ -4451,6 +4453,7 @@ void CGDebugInfo::EmitFuncDeclForCallSite(llvm::CallBase *CallOrInvoke, // Do not emit a declaration subprogram for a function with nodebug // attribute, or if call site info isn't required. if (CalleeDecl->hasAttr() || + noSystemDebugInfo(CalleeDecl, CGM) || getCallSiteRelatedAttrs() == llvm::DINode::FlagZero) return; @@ -4642,7 +4645,7 @@ llvm::DILocalVariable *CGDebugInfo::EmitDeclare(const VarDecl *VD, const bool UsePointerValue) { assert(CGM.getCodeGenOpts().hasReducedDebugInfo()); assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!"); - if (VD->hasAttr()) + if (VD->hasAttr() || noSystemDebugInfo(VD, CGM)) return nullptr; bool Unwritten = @@ -4856,7 +4859,7 @@ llvm::DILocalVariable *CGDebugInfo::EmitDeclare(const BindingDecl *BD, const bool UsePointerValue) { assert(CGM.getCodeGenOpts().hasReducedDebugInfo()); assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!"); - if (BD->hasAttr()) + if (BD->hasAttr() || noSystemDebugInfo(BD, CGM)) return nullptr; // Skip the tuple like case, we don't handle that here @@ -4962,7 +4965,7 @@ void CGDebugInfo::EmitLabel(const LabelDecl *D, CGBuilderTy &Builder) { assert(CGM.getCodeGenOpts().hasReducedDebugInfo()); assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!"); - if (D->hasAttr()) + if (D->hasAttr() || noSystemDebugInfo(D, CGM)) return; auto *Scope = cast(LexicalBlockStack.back()); @@ -5001,7 +5004,7 @@ void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable( if (Builder.GetInsertBlock() == nullptr) return; - if (VD->hasAttr()) + if (VD->hasAttr() || noSystemDebugInfo(VD, CGM)) return; bool isByRef = VD->hasAttr(); @@ -5521,7 +5524,7 @@ std::string CGDebugInfo::GetName(const Decl *D, bool Qualified) const { void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var, const VarDecl *D) { assert(CGM.getCodeGenOpts().hasReducedDebugInfo()); - if (D->hasAttr()) + if (D->hasAttr() || noSystemDebugInfo(D, CGM)) return; llvm::TimeTraceScope TimeScope("DebugGlobalVariable", [&]() { @@ -5586,7 +5589,7 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var, void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, const APValue &Init) { assert(CGM.getCodeGenOpts().hasReducedDebugInfo()); - if (VD->hasAttr()) + if (VD->hasAttr() || noSystemDebugInfo(VD, CGM)) return; llvm::TimeTraceScope TimeScope("DebugConstGlobalVariable", [&]() { return GetName(VD, true); @@ -5663,7 +5666,7 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, const APValue &Init) { void CGDebugInfo::EmitExternalVariable(llvm::GlobalVariable *Var, const VarDecl *D) { assert(CGM.getCodeGenOpts().hasReducedDebugInfo()); - if (D->hasAttr()) + if (D->hasAttr() || noSystemDebugInfo(D, CGM)) return; auto Align = getDeclAlignIfRequired(D, CGM.getContext()); @@ -5688,7 +5691,7 @@ void CGDebugInfo::EmitGlobalAlias(const llvm::GlobalValue *GV, return; const auto *D = cast(GD.getDecl()); - if (D->hasAttr()) + if (D->hasAttr() || noSystemDebugInfo(D, CGM)) return; auto AliaseeDecl = CGM.getMangledNameDecl(GV->getName()); @@ -5745,6 +5748,8 @@ llvm::DIScope *CGDebugInfo::getCurrentContextDescriptor(const Decl *D) { void CGDebugInfo::EmitUsingDirective(const UsingDirectiveDecl &UD) { if (!CGM.getCodeGenOpts().hasReducedDebugInfo()) return; + if (noSystemDebugInfo(&UD, CGM)) + return; const NamespaceDecl *NSDecl = UD.getNominatedNamespace(); if (!NSDecl->isAnonymousNamespace() || CGM.getCodeGenOpts().DebugExplicitImport) { @@ -5770,6 +5775,8 @@ void CGDebugInfo::EmitUsingShadowDecl(const UsingShadowDecl &USD) { void CGDebugInfo::EmitUsingDecl(const UsingDecl &UD) { if (!CGM.getCodeGenOpts().hasReducedDebugInfo()) return; + if (noSystemDebugInfo(&UD, CGM)) + return; assert(UD.shadow_size() && "We shouldn't be codegening an invalid UsingDecl containing no decls"); @@ -5795,6 +5802,8 @@ void CGDebugInfo::EmitUsingDecl(const UsingDecl &UD) { void CGDebugInfo::EmitUsingEnumDecl(const UsingEnumDecl &UD) { if (!CGM.getCodeGenOpts().hasReducedDebugInfo()) return; + if (noSystemDebugInfo(&UD, CGM)) + return; assert(UD.shadow_size() && "We shouldn't be codegening an invalid UsingEnumDecl" " containing no decls"); @@ -5820,6 +5829,8 @@ llvm::DIImportedEntity * CGDebugInfo::EmitNamespaceAlias(const NamespaceAliasDecl &NA) { if (!CGM.getCodeGenOpts().hasReducedDebugInfo()) return nullptr; + if (noSystemDebugInfo(&NA, CGM)) + return nullptr; auto &VH = NamespaceAliasCache[&NA]; if (VH) return cast(VH); @@ -6011,3 +6022,14 @@ CGDebugInfo::createConstantValueExpression(const clang::ValueDecl *VD, return nullptr; } + +bool clang::CodeGen::noSystemDebugInfo(const Decl *D, + const CodeGenModule &CGM) { + // Declaration is in system file + if (CGM.getContext().getSourceManager().isInSystemHeader(D->getLocation())) { + // -fno-system-debug was used. Do not generate debug info. + if (CGM.getCodeGenOpts().NoSystemDebug) + return true; + } + return false; +} diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h index 5080c7083b74d..1827de1146851 100644 --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/lib/CodeGen/CGDebugInfo.h @@ -901,6 +901,8 @@ class ApplyInlineDebugLocation { ~ApplyInlineDebugLocation(); }; +bool noSystemDebugInfo(const Decl *D, const CodeGenModule &CGM); + } // namespace CodeGen } // namespace clang diff --git a/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp index 995d7e7e719d9..1aefbac8d4f20 100644 --- a/clang/lib/CodeGen/CGDeclCXX.cpp +++ b/clang/lib/CodeGen/CGDeclCXX.cpp @@ -1011,7 +1011,7 @@ void CodeGenFunction::GenerateCXXGlobalVarDeclInitFunc(llvm::Function *Fn, llvm::GlobalVariable *Addr, bool PerformInit) { // Check if we need to emit debug info for variable initializer. - if (D->hasAttr()) + if (D->hasAttr() || noSystemDebugInfo(D, CGM)) DebugInfo = nullptr; // disable debug info indefinitely for this function CurEHLocation = D->getBeginLoc(); diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index 2d359f87d7b4c..b2b296c41a256 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -753,8 +753,9 @@ void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD, const ObjCContainerDecl *CD) { SourceLocation StartLoc = OMD->getBeginLoc(); FunctionArgList args; + // Check if we should generate debug info for this method. - if (OMD->hasAttr()) + if (OMD->hasAttr() || noSystemDebugInfo(OMD, CGM)) DebugInfo = nullptr; // disable debug info indefinitely for this function llvm::Function *Fn = CGM.getObjCRuntime().GenerateMethod(OMD, CD); diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index c393aadb510e1..d26fb80f884b0 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -1627,7 +1627,7 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn, } // Check if we should generate debug info for this function. - if (FD->hasAttr()) { + if (FD->hasAttr() || noSystemDebugInfo(FD, CGM)) { // Clear non-distinct debug info that was possibly attached to the function // due to an earlier declaration without the nodebug attribute Fn->setSubprogram(nullptr); diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 2c27fa7c5610a..61d9b46d12f3f 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -4564,6 +4564,10 @@ renderDebugOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T, D, TC)) CmdArgs.push_back("-debug-info-macro"); + // -fno-system-debug turns off debug info generation for system headers + if (Args.hasArg(options::OPT_fno_system_debug)) + CmdArgs.push_back("-fno-system-debug"); + // -ggnu-pubnames turns on gnu style pubnames in the backend. const auto *PubnamesArg = Args.getLastArg(options::OPT_ggnu_pubnames, options::OPT_gno_gnu_pubnames, diff --git a/clang/test/CodeGenCXX/debug-sin.cpp b/clang/test/CodeGenCXX/debug-sin.cpp new file mode 100644 index 0000000000000..4d429396c093d --- /dev/null +++ b/clang/test/CodeGenCXX/debug-sin.cpp @@ -0,0 +1,33 @@ +//////////////////////////////////////////////////////////////////////////////////////// + +// With default options, ensure that declarations obtained by a using declaration have +// debug info generated. sin() is declared through cmath with: using ::sin; +// +// Also ensure that no debug info for sin() is generated if -fno-system-debug is used. + +// Debug info for math library functions is not generated on Windows +// UNSUPPORTED: system-windows + +// RUN: %clang -emit-llvm -S -g %s -o %t.default.ll +// RUN: %clang -fno-system-debug -emit-llvm -S -g %s -o %t.no_system_debug.ll + +// Check for debug info for "sin" with default option +// RUN: FileCheck --check-prefix=CHECK-DEFAULT %s < %t.default.ll + +// No debug information for "sin" should be generated with -fno-system-debug +// RUN: FileCheck --check-prefix=CHECK-NO-SYSTEM-DEBUG %s < %t.no_system_debug.ll + +// CHECK-DEFAULT: DISubprogram(name: "sin", +// CHECK-NO-SYSTEM-DEBUG-NOT: DISubprogram(name: "sin", + +//////////////////////////////////////////////////////////////////////////////////////// + + +#include + +int main() { + float f; + + f=sin(1.32); + return 0; +} diff --git a/clang/test/CodeGenCXX/no-system-debug.cpp b/clang/test/CodeGenCXX/no-system-debug.cpp new file mode 100644 index 0000000000000..3a73974bbfbca --- /dev/null +++ b/clang/test/CodeGenCXX/no-system-debug.cpp @@ -0,0 +1,114 @@ +// Check whether debug information for system header functions vector::insert and vector::pop_back are generated +// for a test program that includes . Debug info for these functions should be generated by default, but +// should not be generated with -fno-system-debug. + +// There is nothing special about vector::insert and vector::pop_back versus other system header functions. They +// are just two representative examples of functions declared in a system header file that can be used to +// exercise -fno-system-debug + +// This testcase tests four option settings: +// By default debug info for vector::insert and vector::pop_back is generated +// When -fno-system-debug is used debug info for vector::insert and vector::pop_back is NOT generated +// When -fstandalone-debug is used more debug info is generated and debug info for vector::insert and vector::pop_back is generated +// When -fno-eliminate-unused-debug-types is used even more debug info is generated and debug info for vector::insert and vector::pop_back is generated + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Prepare check results. Expected mangled names are different between Linux and Windows. +// RUN: %clang %s -DCHECK_RESULTS -E > %t.check_results +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// only vector::insert is in the user source +// +// RUN: %clang -emit-llvm -S -g %s -o %t.default -DINSERT +// RUN: %clang -emit-llvm -S -g %s -o %t.no_system_debug -fno-system-debug -DINSERT +// RUN: %clang -emit-llvm -S -g %s -o %t.standalone_debug -fstandalone-debug -DINSERT +// RUN: %clang -emit-llvm -S -g %s -o %t.no_eliminate_unused_debug_types -fno-eliminate-unused-debug-types -DINSERT + +// RUN: grep DISubprogram %t.default | FileCheck --check-prefix=CHECK-ALL-DEBUG %t.check_results +// RUN: grep DISubprogram %t.no_system_debug | FileCheck --check-prefix=CHECK-NO-DEBUG %t.check_results +// RUN: grep DISubprogram %t.standalone_debug | FileCheck --check-prefix=CHECK-ALL-DEBUG %t.check_results +// RUN: grep DISubprogram %t.no_eliminate_unused_debug_types | FileCheck --check-prefix=CHECK-ALL-DEBUG %t.check_results + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// vector::pop_back and vector::insert are both in user source +// +// RUN: %clang -emit-llvm -S -g %s -o %t.default -DINSERT -DPOP_BACK +// RUN: %clang -emit-llvm -S -g %s -o %t.no_system_debug -fno-system-debug -DINSERT -DPOP_BACK +// RUN: %clang -emit-llvm -S -g %s -o %t.standalone_debug -fstandalone-debug -DINSERT -DPOP_BACK +// RUN: %clang -emit-llvm -S -g %s -o %t.no_eliminate_unused_debug_types -fno-eliminate-unused-debug-types -DINSERT -DPOP_BACK + +// RUN: grep DISubprogram %t.default | FileCheck --check-prefix=CHECK-ALL-DEBUG %t.check_results +// RUN: grep DISubprogram %t.no_system_debug | FileCheck --check-prefix=CHECK-NO-DEBUG %t.check_results +// RUN: grep DISubprogram %t.standalone_debug | FileCheck --check-prefix=CHECK-ALL-DEBUG %t.check_results +// RUN: grep DISubprogram %t.no_eliminate_unused_debug_types | FileCheck --check-prefix=CHECK-ALL-DEBUG %t.check_results + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// class vector is explicitly instantiated. +// vector::pop_back and vector::insert are NOT in user source +// +// RUN: %clang -emit-llvm -S -g %s -o %t.default -DEXPLICIT_INSTANTIATION +// RUN: %clang -emit-llvm -S -g %s -o %t.no_system_debug -fno-system-debug -DEXPLICIT_INSTANTIATION +// RUN: %clang -emit-llvm -S -g %s -o %t.standalone_debug -fstandalone-debug -DEXPLICIT_INSTANTIATION +// RUN: %clang -emit-llvm -S -g %s -o %t.no_eliminate_unused_debug_types -fno-eliminate-unused-debug-types -DEXPLICIT_INSTANTIATION + +// RUN: grep DISubprogram %t.default | FileCheck --check-prefix=CHECK-ALL-DEBUG %t.check_results +// RUN: grep DISubprogram %t.no_system_debug | FileCheck --check-prefix=CHECK-NO-DEBUG %t.check_results +// RUN: grep DISubprogram %t.standalone_debug | FileCheck --check-prefix=CHECK-ALL-DEBUG %t.check_results +// RUN: grep DISubprogram %t.no_eliminate_unused_debug_types | FileCheck --check-prefix=CHECK-ALL-DEBUG %t.check_results + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// class vector is explicitly instantiated. +// vector::pop_back and vector::insert are BOTH in user source +// +// RUN: %clang -emit-llvm -S -g %s -o %t.default -DEXPLICIT_INSTANTIATION -DINSERT -DPOP_BACK +// RUN: %clang -emit-llvm -S -g %s -o %t.no_system_debug -fno-system-debug -DEXPLICIT_INSTANTIATION -DINSERT -DPOP_BACK +// RUN: %clang -emit-llvm -S -g %s -o %t.standalone_debug -fstandalone-debug -DEXPLICIT_INSTANTIATION -DINSERT -DPOP_BACK +// RUN: %clang -emit-llvm -S -g %s -o %t.no_eliminate_unused_debug_types -fno-eliminate-unused-debug-types -DEXPLICIT_INSTANTIATION -DINSERT -DPOP_BACK + +// RUN: grep DISubprogram %t.default | FileCheck --check-prefix=CHECK-ALL-DEBUG %t.check_results +// RUN: grep DISubprogram %t.no_system_debug | FileCheck --check-prefix=CHECK-NO-DEBUG %t.check_results +// RUN: grep DISubprogram %t.standalone_debug | FileCheck --check-prefix=CHECK-ALL-DEBUG %t.check_results +// RUN: grep DISubprogram %t.no_eliminate_unused_debug_types | FileCheck --check-prefix=CHECK-ALL-DEBUG %t.check_results + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef CHECK_RESULTS +#if defined(_WIN32) || defined(_WIN64) +// vector::pop_back and vector::insert must both not be found +; CHECK-NO-DEBUG-NOT: ?pop_back@?$vector@HV?$allocator@H@std@@@std@@QEAAXXZ +; CHECK-NO-DEBUG-NOT: ?insert@?$vector@HV?$allocator@H@std@@@std@@QEAA?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@H@std@@@std@@@2@V?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@H@std@@@std@@@2@$$QEAH@Z + +// vector::pop_back and vector::insert must both be found +; CHECK-ALL-DEBUG: ?pop_back@?$vector@HV?$allocator@H@std@@@std@@QEAAXXZ +; CHECK-ALL-DEBUG: ?insert@?$vector@HV?$allocator@H@std@@@std@@QEAA?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@H@std@@@std@@@2@V?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@H@std@@@std@@@2@$$QEAH@Z +#else +// vector::pop_back and vector::insert must both not be found +; CHECK-NO-DEBUG-NOT: _ZNSt6vectorIiSaIiEE8pop_backEv +; CHECK-NO-DEBUG-NOT: _ZNSt6vectorIiSaIiEE6insertEN9__gnu_cxx17__normal_iteratorIPKiS1_EEOi + +// vector::pop_back and vector::insert must both be found +; CHECK-ALL-DEBUG: _ZNSt6vectorIiSaIiEE8pop_backEv +; CHECK-ALL-DEBUG: _ZNSt6vectorIiSaIiEE6insertEN9__gnu_cxx17__normal_iteratorIPKiS1_EEOi +#endif +#endif // CHECK_RESULTS + +#include + +#ifdef EXPLICIT_INSTANTIATION +template class std::vector; +#endif + +int main() { +#if defined(INSERT) || defined(POP_BACK) + std::vector a; +#endif + +#ifdef INSERT + a.insert(a.begin(),2); +#endif +#ifdef POP_BACK + a.pop_back(); +#endif +} diff --git a/clang/test/Driver/no-system-debug.c b/clang/test/Driver/no-system-debug.c new file mode 100644 index 0000000000000..bc8c7e5231d9c --- /dev/null +++ b/clang/test/Driver/no-system-debug.c @@ -0,0 +1,6 @@ +// Ensure -fno-system-debug is passed to cc1 +// RUN: %clang -fno-system-debug -### -c %s 2>&1 | FileCheck %s + +// CHECK: -cc1 +// CHECK-SAME: -fno-system-debug +