/* This should be kept in sync with
cooked_index_shard::finalize. Note that there, C
requires canonicalization -- but that is only for
- types, 'main' doesn't count. */
- if (entry->lang != language_ada && entry->lang != language_cplus)
+ types, 'main' doesn't count. Similarly, C++ requires
+ canonicalization, but again "main" is an
+ exception. */
+ if ((entry->lang != language_ada
+ && entry->lang != language_cplus)
+ || strcmp (entry->name, "main") == 0)
{
/* There won't be one better than this. */
return entry;
standard_testfile .c -2.c
-proc do_tests { dwarf_version dwarf_bits strict_dwarf } {
+proc do_tests { lang dwarf_version dwarf_bits strict_dwarf } {
set opts {}
lappend opts debug
lappend opts quiet
lappend opts additional_flags=-gsplit-dwarf
+ if {$lang == "c++"} {
+ lappend opts "additional_flags=-x c++"
+ }
lappend opts macros
if { $dwarf_bits == 64 } {
gdb_test "info macro FOURTH" "#define FOURTH 4"
}
-foreach_with_prefix dwarf_version {4 5} {
- if { $dwarf_version == 4 && [gcc_major_version] < 15 } {
- # Gcc does not contain fix for PR debug/115066.
- continue
- }
- foreach_with_prefix dwarf_bits {32 64} {
- foreach_with_prefix strict_dwarf {0 1} {
- do_tests $dwarf_version $dwarf_bits $strict_dwarf
+foreach_with_prefix lang {c c++} {
+ foreach_with_prefix dwarf_version {4 5} {
+ if { $dwarf_version == 4 && [gcc_major_version] < 15 } {
+ # Gcc does not contain fix for PR debug/115066.
+ continue
+ }
+ foreach_with_prefix dwarf_bits {32 64} {
+ foreach_with_prefix strict_dwarf {0 1} {
+ do_tests $lang $dwarf_version $dwarf_bits $strict_dwarf
+ }
}
}
}