===================================================================
@@ -268,6 +268,10 @@ c_common_handle_option (size_t scode, const char *
break;
case OPT__output_pch_:
+ if (write_symbols != NO_DEBUG && write_symbols != DWARF2_DEBUG)
+ warning (OPT_Wdeprecated,
+ "the \"%s\" debug format cannot be used with pre-compiled headers",
+ debug_type_names[write_symbols]);
pch_file = arg;
break;
===================================================================
@@ -39,8 +39,12 @@ proc dg-flags-pch { subdir test otherflags options
set dg-do-what-default precompile
catch { file_on_host delete "$bname$suffix" }
gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix"
- dg-test -keep-output "./$bname$suffix" "$otherflags $flags" ""
+ # Suppress -Wdeprecated to allow PCH tests to work with non-DWARF2
+ # debug formats. Support for such combinations has been deprecated
+ # for GCC 4.8.
+ dg-test -keep-output "./$bname$suffix" "$otherflags $flags -Wno-deprecated" ""
+
# For the rest, the default is to compile to .s.
set dg-do-what-default compile