gen_type_die_for_member (type, decl,
get_context_die (TYPE_CONTEXT (type)));
}
+ if (TREE_CODE (decl) == CONST_DECL)
+ {
+ /* Individual enumerators of an enum type do not get output here
+ (see gen_decl_die), so we cannot call force_decl_die. */
+ if (!is_fortran () && !is_ada () && !is_dlang ())
+ return;
+ }
if (TREE_CODE (decl) == NAMELIST_DECL)
at_import_die = gen_namelist_decl (DECL_NAME (decl),
get_context_die (DECL_CONTEXT (decl)),
--- /dev/null
+# Copyright (C) 2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Load support procs.
+load_lib gdc-dg.exp
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+gcc-dg-debug-runtest gdc_target_compile trivial.d [list -O -O3] \
+ [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
+
+# All done.
+dg-finish
--- /dev/null
+# Copyright (C) 2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Load support procs.
+load_lib gdc-dg.exp
+
+# Main loop.
+set comp_output [gdc_target_compile \
+ "$srcdir/$subdir/../trivial.d" "trivial.S" assembly \
+ "additional_flags=-gdwarf"]
+if { ! [string match "*: target system does not support the * debug format*" \
+ $comp_output] } {
+ remove-build-file "trivial.S"
+ gdc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.d ] ] "" "-gdwarf"
+}
+
+# All done.
+dg-finish
--- /dev/null
+module imports.pr98067;
+
+enum MAP_ANON = 0x10;
--- /dev/null
+// DW_LANG_D is not available in dwarf2, so we should produce DW_LANG_C (0x2)
+// as AT_language.
+// { dg-do compile }
+// { dg-options "-gdwarf-2 -gstrict-dwarf -dA" }
+// { dg-final { scan-assembler "0x2\[^\n\r\]*AT_language" } }
+
+module langdw2;
--- /dev/null
+// We should produce DW_LANG_D (0x13) as AT_language.
+// { dg-do compile }
+// { dg-options "-gdwarf-3 -dA" }
+// { dg-final { scan-assembler "0x13\[^\n\r\]*AT_language" } }
+
+module langdw3;
--- /dev/null
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98067
+// { dg-options "-gdwarf-2 -gstrict-dwarf -I $srcdir/gdc.dg/debug/dwarf2" }
+// { dg-do compile }
+module pr98067;
+
+import imports.pr98067 : MAP_ANON;
--- /dev/null
+/* { dg-do run } */
+
+int main()
+{
+ return 0;
+}