Index: COFF/Driver.cpp =================================================================== --- COFF/Driver.cpp +++ COFF/Driver.cpp @@ -1151,8 +1151,8 @@ sys::path::replace_extension(Config->PDBPath, ".pdb"); } - // Disable PDB generation if the user requested it. - if (Args.hasArg(OPT_nopdb) || Args.hasArg(OPT_debug_dwarf)) + // Disable PDB generation if the user requested DWARF. + if (Args.hasArg(OPT_debug_dwarf)) Config->PDBPath = ""; // Set default image base if /base is not given. Index: COFF/Options.td =================================================================== --- COFF/Options.td +++ COFF/Options.td @@ -120,7 +120,6 @@ def debug_ghash : F<"debug:ghash">; def debug_dwarf : F<"debug:dwarf">; def export_all_symbols : F<"export-all-symbols">; -def nopdb : F<"nopdb">, HelpText<"Disable PDB generation for DWARF users">; def lldmingw : F<"lldmingw">; def msvclto : F<"msvclto">; def output_def : Joined<["/", "-"], "output-def:">; Index: test/COFF/debug-dwarf.test =================================================================== --- /dev/null +++ test/COFF/debug-dwarf.test @@ -0,0 +1,19 @@ +# Check that /debug creates %t.pdb. +# RUN: rm -f %t.pdb +# RUN: lld-link /debug /entry:main /out:%t.exe %p/Inputs/ret42.obj +# RUN: ls %t.pdb + +# Check that /debug:dwarf does not create %t.pdb. +# RUN: rm -f %t.pdb +# RUN: lld-link /debug:dwarf /entry:main /out:%t.exe %p/Inputs/ret42.obj +# RUN: not ls %t.pdb + +# Check that /debug:dwarf /debug does not create %t.pdb. +# RUN: rm -f %t.pdb +# RUN: lld-link /debug:dwarf /debug /entry:main /out:%t.exe %p/Inputs/ret42.obj +# RUN: not ls %t.pdb + +# Check that /debug:dwarf /pdb:%t.pdb does not create %t.pdb. +# RUN: rm -f %t.pdb +# RUN: lld-link /debug:dwarf /pdb:%t.pdb /entry:main /out:%t.exe %p/Inputs/ret42.obj +# RUN: not ls %t.pdb Index: test/COFF/nopdb.test =================================================================== --- test/COFF/nopdb.test +++ /dev/null @@ -1,14 +0,0 @@ -# Check that /debug creates %t.pdb. -# RUN: rm -f %t.pdb -# RUN: lld-link /debug /entry:main /out:%t.exe %p/Inputs/ret42.obj -# RUN: ls %t.pdb - -# Check that /debug /nopdb does not create %t.pdb. -# RUN: rm -f %t.pdb -# RUN: lld-link /debug /nopdb /entry:main /out:%t.exe %p/Inputs/ret42.obj -# RUN: not ls %t.pdb - -# Check that /debug /nopdb /pdb:%t.pdb does not create %t.pdb. -# RUN: rm -f %t.pdb -# RUN: lld-link /debug /nopdb /pdb:%t.pdb /entry:main /out:%t.exe %p/Inputs/ret42.obj -# RUN: not ls %t.pdb