diff options
author | Lawrence Crowl <crowl@google.com> | 2007-04-17 06:19:36 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2007-04-17 06:19:36 +0000 |
commit | 39ef65923c5943c0f04193463dee8eb46d249f12 (patch) | |
tree | 4e1b0eb361d1ad81f81cf74c4941675abea36a99 /gcc/testsuite | |
parent | fc6827fe9fe4d3c72013462bf2d9d658bf73d7bb (diff) | |
download | gcc-39ef65923c5943c0f04193463dee8eb46d249f12.zip gcc-39ef65923c5943c0f04193463dee8eb46d249f12.tar.gz gcc-39ef65923c5943c0f04193463dee8eb46d249f12.tar.bz2 |
invoke.texi (Debugging Options): Add documentation for the -femit-struct-debug options...
./: * doc/invoke.texi (Debugging Options): Add documentation for the
-femit-struct-debug options -femit-struct-debug-baseonly,
-femit-struct-debug-reduced, and
-femit-struct-debug-detailed[=...].
* c-opts.c (c_common_handle_option): Add
OPT_femit_struct_debug_baseonly, OPT_femit_struct_debug_reduced,
and OPT_femit_struct_debug_detailed_.
* c.opt: Add specifications for
-femit-struct-debug-baseonly, -femit-struct-debug-reduced,
and -femit-struct-debug-detailed[=...].
* opts.c (set_struct_debug_option): Parse the
-femit-struct-debug-... options.
* opts.c (matches_main_base, main_input_basename,
main_input_baselength, base_of_path, matches_main_base): Add
variables and functions to compare header base name to compilation
unit base name.
* opts.c (should_emit_struct_debug): Add to determine to emit a
structure based on the option.
(dump_struct_debug) Also disabled function to debug this
function.
* opts.c (handle_options): Save the base name of the
compilation unit.
* langhooks-def.h (LANG_HOOKS_GENERIC_TYPE_P): Define.
(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add.
This hook indicates if a type is generic. Set it by default
to "never generic".
* langhooks.h (struct lang_hooks_for_types): Add a new hook
to determine if a struct type is generic or not.
* cp/cp-tree.h (class_tmpl_impl_spec_p): Declare a C++ hook.
* cp/tree.c (class_tmpl_impl_spec_p): Implement the C++ hook.
* cp/cp-lang.c (LANG_HOOKS_GENERIC_TYPE_P): Override null C hook
with live C++ hook.
* flags.h (enum debug_info_usage): Add an enumeration to describe
a program's use of a structure type.
* dwarf2out.c (gen_struct_or_union_type_die): Add a new parameter
to indicate the program's usage of the type. Filter structs based
on the -femit-struct-debug-... specification.
(gen_type_die): Split into two routines, gen_type_die and
gen_type_die_with_usage. gen_type_die is now a wrapper
that assumes direct usage.
(gen_type_die_with_usage): Replace calls to gen_type_die
with gen_type_die_with_usage adding the program usage of
the referenced type.
(dwarf2out_imported_module_or_decl): Suppress struct debug
information using should_emit_struct_debug when appropriate.
testsuite/:
* g++.dg/other/fesd-any.C: Test -femit-struct-debug-detailed=any.
* g++.dg/other/fesd-any.h: Test -femit-struct-debug-detailed=any.
* g++.dg/other/fesd-baseonly.C: Test -femit-struct-debug-baseonly.
* g++.dg/other/fesd-baseonly.h: Test -femit-struct-debug-baseonly.
* g++.dg/other/fesd-none.C: Test -femit-struct-debug-detailed=none.
* g++.dg/other/fesd-none.h: Test -femit-struct-debug-detailed=none.
* g++.dg/other/fesd-reduced.C: Test -femit-struct-debug-reduced.
* g++.dg/other/fesd-reduced.h: Test -femit-struct-debug-reduced.
* g++.dg/other/fesd-sys.C: Test -femit-struct-debug-detailed=sys.
* g++.dg/other/fesd-sys.h: Test -femit-struct-debug-detailed=sys.
* g++.dg/other/fesd.h: Common to -femit-struct-debug-... tests.
* gcc.dg/fesd-any.c: Test -femit-struct-debug-detailed=any.
* gcc.dg/fesd-any.h: Test -femit-struct-debug-detailed=any.
* gcc.dg/fesd-baseonly.c: Test -femit-struct-debug-baseonly.
* gcc.dg/fesd-baseonly.h: Test -femit-struct-debug-baseonly.
* gcc.dg/fesd-none.c: Test -femit-struct-debug-detailed=none.
* gcc.dg/fesd-none.h: Test -femit-struct-debug-detailed=none.
* gcc.dg/fesd-reduced.c: Test -femit-struct-debug-reduced.
* gcc.dg/fesd-reduced.h: Test -femit-struct-debug-reduced.
* gcc.dg/fesd-sys.c: Test -femit-struct-debug-detailed=sys.
* gcc.dg/fesd-sys.h: Test -femit-struct-debug-detailed=sys.
* gcc.dg/fesd.h: Common to -femit-struct-debug-... tests.
From-SVN: r123909
Diffstat (limited to 'gcc/testsuite')
23 files changed, 1481 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ea93fcc..652e4cc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,29 @@ +2007-04-16 Lawrence Crowl <crowl@google.com> + + * g++.dg/other/fesd-any.C: Test -femit-struct-debug-detailed=any. + * g++.dg/other/fesd-any.h: Test -femit-struct-debug-detailed=any. + * g++.dg/other/fesd-baseonly.C: Test -femit-struct-debug-baseonly. + * g++.dg/other/fesd-baseonly.h: Test -femit-struct-debug-baseonly. + * g++.dg/other/fesd-none.C: Test -femit-struct-debug-detailed=none. + * g++.dg/other/fesd-none.h: Test -femit-struct-debug-detailed=none. + * g++.dg/other/fesd-reduced.C: Test -femit-struct-debug-reduced. + * g++.dg/other/fesd-reduced.h: Test -femit-struct-debug-reduced. + * g++.dg/other/fesd-sys.C: Test -femit-struct-debug-detailed=sys. + * g++.dg/other/fesd-sys.h: Test -femit-struct-debug-detailed=sys. + * g++.dg/other/fesd.h: Common to -femit-struct-debug-... tests. + + * gcc.dg/fesd-any.c: Test -femit-struct-debug-detailed=any. + * gcc.dg/fesd-any.h: Test -femit-struct-debug-detailed=any. + * gcc.dg/fesd-baseonly.c: Test -femit-struct-debug-baseonly. + * gcc.dg/fesd-baseonly.h: Test -femit-struct-debug-baseonly. + * gcc.dg/fesd-none.c: Test -femit-struct-debug-detailed=none. + * gcc.dg/fesd-none.h: Test -femit-struct-debug-detailed=none. + * gcc.dg/fesd-reduced.c: Test -femit-struct-debug-reduced. + * gcc.dg/fesd-reduced.h: Test -femit-struct-debug-reduced. + * gcc.dg/fesd-sys.c: Test -femit-struct-debug-detailed=sys. + * gcc.dg/fesd-sys.h: Test -femit-struct-debug-detailed=sys. + * gcc.dg/fesd.h: Common to -femit-struct-debug-... tests. + 2007-04-16 Ian Lance Taylor <iant@google.com> PR tree-optimization/31522 diff --git a/gcc/testsuite/g++.dg/other/fesd-any.C b/gcc/testsuite/g++.dg/other/fesd-any.C new file mode 100644 index 0000000..a4a0b50 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/fesd-any.C @@ -0,0 +1,126 @@ +// { dg-do compile } +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=any" } +// { dg-final { scan-assembler "timespec.*DW_AT_name" } } +// { dg-final { scan-assembler "tv_sec.*DW_AT_name" } } +// { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } } +// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } } +// { dg-final { scan-assembler "it_interval.*DW_AT_name" } } +// { dg-final { scan-assembler "it_value.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_fld_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_var_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_decl_ref_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_ref_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_ptr_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_var_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_fld_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_fld_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_tmpl_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_var_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_decl_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_ptr_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_decl_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_ptr_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_tmpl_defn_ptr_base.*DW_AT_name" } } +# 1 "fesd-any.C" +# 1 "<built-in>" +# 1 "<command-line>" +# 1 "fesd-any.C" + +//#include "time.h" +# 1 "time.h" 1 3 4 +struct timespec + { + long int tv_sec; + long int tv_nsec; + }; + +struct itimerspec + { + struct timespec it_interval; + struct timespec it_value; + }; + +# 6 "fesd-any.C" 2 + +struct timespec base_var8; +struct itimerspec *base_var9; + +#include "fesd-any.h" + +struct gstruct_head_ordy_defn_var_base base_var1; +struct gstruct_base_ordy_defn_var_base base_var2; + +struct gstruct_head_tmpl_defn_var_base< int > base_var5; +struct gstruct_base_tmpl_defn_var_base< int > base_var6; + +int base_function() { + return 0 ++ base_var1.field_head_ordy_defn_var_base ++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base ++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base ++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base ++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base ++ base_var5.field_head_tmpl_defn_var_base ++ base_var6.field1_base_tmpl_defn_var_base_ptr->field_head_tmpl_defn_ptr_base ++ base_var6.field1_base_tmpl_defn_var_base_fld.field_head_tmpl_defn_fld_base ++ base_var6.field2_base_tmpl_defn_var_base_ptr->field_base_tmpl_defn_ptr_base ++ base_var6.field2_base_tmpl_defn_var_base_fld.field_base_tmpl_defn_fld_base +; +} + diff --git a/gcc/testsuite/g++.dg/other/fesd-any.h b/gcc/testsuite/g++.dg/other/fesd-any.h new file mode 100644 index 0000000..762f587 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/fesd-any.h @@ -0,0 +1,42 @@ +#include "fesd.h" + +struct gstruct_base_ordy_decl_not; +struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; }; + +struct gstruct_base_ordy_decl_ref_base; +struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; }; +struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; }; +struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; }; +struct gstruct_base_ordy_defn_var_base { + gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc; + gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref; + gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr; + gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld; + gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc; + gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref; + gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr; + gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld; +}; + +template< typename T > struct gstruct_base_tmpl_decl_not; +template< typename T > struct gstruct_base_tmpl_defn_not +{ int field_base_tmpl_defn_not; }; + +template< typename T > struct gstruct_base_tmpl_decl_ref_base; +template< typename T > struct gstruct_base_tmpl_defn_ref_base +{ int field_base_tmpl_defn_ref_base; }; +template< typename T > struct gstruct_base_tmpl_defn_ptr_base +{ int field_base_tmpl_defn_ptr_base; }; +template< typename T > struct gstruct_base_tmpl_defn_fld_base +{ int field_base_tmpl_defn_fld_base; }; +template< typename T > struct gstruct_base_tmpl_defn_var_base { + gstruct_head_tmpl_decl_ref_base< T > *field1_base_tmpl_defn_var_base_inc; + gstruct_head_tmpl_defn_ref_base< T > *field1_base_tmpl_defn_var_base_ref; + gstruct_head_tmpl_defn_ptr_base< T > *field1_base_tmpl_defn_var_base_ptr; + gstruct_head_tmpl_defn_fld_base< T > field1_base_tmpl_defn_var_base_fld; + gstruct_base_tmpl_decl_ref_base< T > *field2_base_tmpl_defn_var_base_inc; + gstruct_base_tmpl_defn_ref_base< T > *field2_base_tmpl_defn_var_base_ref; + gstruct_base_tmpl_defn_ptr_base< T > *field2_base_tmpl_defn_var_base_ptr; + gstruct_base_tmpl_defn_fld_base< T > field2_base_tmpl_defn_var_base_fld; +}; + diff --git a/gcc/testsuite/g++.dg/other/fesd-baseonly.C b/gcc/testsuite/g++.dg/other/fesd-baseonly.C new file mode 100644 index 0000000..4f580eb --- /dev/null +++ b/gcc/testsuite/g++.dg/other/fesd-baseonly.C @@ -0,0 +1,126 @@ +// { dg-do compile } +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-baseonly" } +// { dg-final { scan-assembler "timespec.*DW_AT_name" } } +// { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } } +// { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } } +// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } } +// { dg-final { scan-assembler-not "it_interval.*DW_AT_name" } } +// { dg-final { scan-assembler-not "it_value.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_defn_fld_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_var_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_decl_ref_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_defn_ref_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_defn_ptr_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_var_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_fld_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_fld_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_tmpl_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_var_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_decl_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_ptr_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_decl_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_ptr_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_tmpl_defn_ptr_base.*DW_AT_name" } } +# 1 "fesd-baseonly.C" +# 1 "<built-in>" +# 1 "<command-line>" +# 1 "fesd-baseonly.C" + +//#include "time.h" +# 1 "time.h" 1 3 4 +struct timespec + { + long int tv_sec; + long int tv_nsec; + }; + +struct itimerspec + { + struct timespec it_interval; + struct timespec it_value; + }; + +# 6 "fesd-baseonly.C" 2 + +struct timespec base_var8; +struct itimerspec *base_var9; + +#include "fesd-baseonly.h" + +struct gstruct_head_ordy_defn_var_base base_var1; +struct gstruct_base_ordy_defn_var_base base_var2; + +struct gstruct_head_tmpl_defn_var_base< int > base_var5; +struct gstruct_base_tmpl_defn_var_base< int > base_var6; + +int base_function() { + return 0 ++ base_var1.field_head_ordy_defn_var_base ++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base ++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base ++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base ++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base ++ base_var5.field_head_tmpl_defn_var_base ++ base_var6.field1_base_tmpl_defn_var_base_ptr->field_head_tmpl_defn_ptr_base ++ base_var6.field1_base_tmpl_defn_var_base_fld.field_head_tmpl_defn_fld_base ++ base_var6.field2_base_tmpl_defn_var_base_ptr->field_base_tmpl_defn_ptr_base ++ base_var6.field2_base_tmpl_defn_var_base_fld.field_base_tmpl_defn_fld_base +; +} + diff --git a/gcc/testsuite/g++.dg/other/fesd-baseonly.h b/gcc/testsuite/g++.dg/other/fesd-baseonly.h new file mode 100644 index 0000000..762f587 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/fesd-baseonly.h @@ -0,0 +1,42 @@ +#include "fesd.h" + +struct gstruct_base_ordy_decl_not; +struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; }; + +struct gstruct_base_ordy_decl_ref_base; +struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; }; +struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; }; +struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; }; +struct gstruct_base_ordy_defn_var_base { + gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc; + gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref; + gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr; + gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld; + gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc; + gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref; + gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr; + gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld; +}; + +template< typename T > struct gstruct_base_tmpl_decl_not; +template< typename T > struct gstruct_base_tmpl_defn_not +{ int field_base_tmpl_defn_not; }; + +template< typename T > struct gstruct_base_tmpl_decl_ref_base; +template< typename T > struct gstruct_base_tmpl_defn_ref_base +{ int field_base_tmpl_defn_ref_base; }; +template< typename T > struct gstruct_base_tmpl_defn_ptr_base +{ int field_base_tmpl_defn_ptr_base; }; +template< typename T > struct gstruct_base_tmpl_defn_fld_base +{ int field_base_tmpl_defn_fld_base; }; +template< typename T > struct gstruct_base_tmpl_defn_var_base { + gstruct_head_tmpl_decl_ref_base< T > *field1_base_tmpl_defn_var_base_inc; + gstruct_head_tmpl_defn_ref_base< T > *field1_base_tmpl_defn_var_base_ref; + gstruct_head_tmpl_defn_ptr_base< T > *field1_base_tmpl_defn_var_base_ptr; + gstruct_head_tmpl_defn_fld_base< T > field1_base_tmpl_defn_var_base_fld; + gstruct_base_tmpl_decl_ref_base< T > *field2_base_tmpl_defn_var_base_inc; + gstruct_base_tmpl_defn_ref_base< T > *field2_base_tmpl_defn_var_base_ref; + gstruct_base_tmpl_defn_ptr_base< T > *field2_base_tmpl_defn_var_base_ptr; + gstruct_base_tmpl_defn_fld_base< T > field2_base_tmpl_defn_var_base_fld; +}; + diff --git a/gcc/testsuite/g++.dg/other/fesd-none.C b/gcc/testsuite/g++.dg/other/fesd-none.C new file mode 100644 index 0000000..0af0a83 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/fesd-none.C @@ -0,0 +1,126 @@ +// { dg-do compile } +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=none" } +// { dg-final { scan-assembler "timespec.*DW_AT_name" } } +// { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } } +// { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } } +// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } } +// { dg-final { scan-assembler-not "it_interval.*DW_AT_name" } } +// { dg-final { scan-assembler-not "it_value.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_defn_fld_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_var_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_decl_ref_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_defn_ref_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_defn_ptr_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_var_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_defn_fld_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_base_tmpl_defn_fld_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_base_tmpl_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_var_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field1_base_tmpl_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field1_base_tmpl_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field1_base_tmpl_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field1_base_tmpl_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field2_base_tmpl_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field2_base_tmpl_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field2_base_tmpl_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field2_base_tmpl_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_decl_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_defn_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_defn_ptr_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_base_tmpl_decl_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_base_tmpl_defn_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_base_tmpl_defn_ptr_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_base_tmpl_defn_ptr_base.*DW_AT_name" } } +# 1 "fesd-none.C" +# 1 "<built-in>" +# 1 "<command-line>" +# 1 "fesd-none.C" + +//#include "time.h" +# 1 "time.h" 1 3 4 +struct timespec + { + long int tv_sec; + long int tv_nsec; + }; + +struct itimerspec + { + struct timespec it_interval; + struct timespec it_value; + }; + +# 6 "fesd-none.C" 2 + +struct timespec base_var8; +struct itimerspec *base_var9; + +#include "fesd-none.h" + +struct gstruct_head_ordy_defn_var_base base_var1; +struct gstruct_base_ordy_defn_var_base base_var2; + +struct gstruct_head_tmpl_defn_var_base< int > base_var5; +struct gstruct_base_tmpl_defn_var_base< int > base_var6; + +int base_function() { + return 0 ++ base_var1.field_head_ordy_defn_var_base ++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base ++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base ++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base ++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base ++ base_var5.field_head_tmpl_defn_var_base ++ base_var6.field1_base_tmpl_defn_var_base_ptr->field_head_tmpl_defn_ptr_base ++ base_var6.field1_base_tmpl_defn_var_base_fld.field_head_tmpl_defn_fld_base ++ base_var6.field2_base_tmpl_defn_var_base_ptr->field_base_tmpl_defn_ptr_base ++ base_var6.field2_base_tmpl_defn_var_base_fld.field_base_tmpl_defn_fld_base +; +} + diff --git a/gcc/testsuite/g++.dg/other/fesd-none.h b/gcc/testsuite/g++.dg/other/fesd-none.h new file mode 100644 index 0000000..762f587 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/fesd-none.h @@ -0,0 +1,42 @@ +#include "fesd.h" + +struct gstruct_base_ordy_decl_not; +struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; }; + +struct gstruct_base_ordy_decl_ref_base; +struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; }; +struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; }; +struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; }; +struct gstruct_base_ordy_defn_var_base { + gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc; + gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref; + gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr; + gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld; + gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc; + gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref; + gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr; + gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld; +}; + +template< typename T > struct gstruct_base_tmpl_decl_not; +template< typename T > struct gstruct_base_tmpl_defn_not +{ int field_base_tmpl_defn_not; }; + +template< typename T > struct gstruct_base_tmpl_decl_ref_base; +template< typename T > struct gstruct_base_tmpl_defn_ref_base +{ int field_base_tmpl_defn_ref_base; }; +template< typename T > struct gstruct_base_tmpl_defn_ptr_base +{ int field_base_tmpl_defn_ptr_base; }; +template< typename T > struct gstruct_base_tmpl_defn_fld_base +{ int field_base_tmpl_defn_fld_base; }; +template< typename T > struct gstruct_base_tmpl_defn_var_base { + gstruct_head_tmpl_decl_ref_base< T > *field1_base_tmpl_defn_var_base_inc; + gstruct_head_tmpl_defn_ref_base< T > *field1_base_tmpl_defn_var_base_ref; + gstruct_head_tmpl_defn_ptr_base< T > *field1_base_tmpl_defn_var_base_ptr; + gstruct_head_tmpl_defn_fld_base< T > field1_base_tmpl_defn_var_base_fld; + gstruct_base_tmpl_decl_ref_base< T > *field2_base_tmpl_defn_var_base_inc; + gstruct_base_tmpl_defn_ref_base< T > *field2_base_tmpl_defn_var_base_ref; + gstruct_base_tmpl_defn_ptr_base< T > *field2_base_tmpl_defn_var_base_ptr; + gstruct_base_tmpl_defn_fld_base< T > field2_base_tmpl_defn_var_base_fld; +}; + diff --git a/gcc/testsuite/g++.dg/other/fesd-reduced.C b/gcc/testsuite/g++.dg/other/fesd-reduced.C new file mode 100644 index 0000000..a93b90f --- /dev/null +++ b/gcc/testsuite/g++.dg/other/fesd-reduced.C @@ -0,0 +1,126 @@ +// { dg-do compile } +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-reduced" } +// { dg-final { scan-assembler "timespec.*DW_AT_name" } } +// { dg-final { scan-assembler "tv_sec.*DW_AT_name" } } +// { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } } +// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } } +// { dg-final { scan-assembler "it_interval.*DW_AT_name" } } +// { dg-final { scan-assembler "it_value.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_fld_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_var_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_decl_ref_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_ref_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_ptr_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_var_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_fld_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_fld_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_tmpl_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_var_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_decl_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_ptr_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_tmpl_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_decl_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_ptr_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_tmpl_defn_ptr_base.*DW_AT_name" } } +# 1 "fesd-reduced.C" +# 1 "<built-in>" +# 1 "<command-line>" +# 1 "fesd-reduced.C" + +//#include "time.h" +# 1 "time.h" 1 3 4 +struct timespec + { + long int tv_sec; + long int tv_nsec; + }; + +struct itimerspec + { + struct timespec it_interval; + struct timespec it_value; + }; + +# 6 "fesd-reduced.C" 2 + +struct timespec base_var8; +struct itimerspec *base_var9; + +#include "fesd-reduced.h" + +struct gstruct_head_ordy_defn_var_base base_var1; +struct gstruct_base_ordy_defn_var_base base_var2; + +struct gstruct_head_tmpl_defn_var_base< int > base_var5; +struct gstruct_base_tmpl_defn_var_base< int > base_var6; + +int base_function() { + return 0 ++ base_var1.field_head_ordy_defn_var_base ++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base ++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base ++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base ++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base ++ base_var5.field_head_tmpl_defn_var_base ++ base_var6.field1_base_tmpl_defn_var_base_ptr->field_head_tmpl_defn_ptr_base ++ base_var6.field1_base_tmpl_defn_var_base_fld.field_head_tmpl_defn_fld_base ++ base_var6.field2_base_tmpl_defn_var_base_ptr->field_base_tmpl_defn_ptr_base ++ base_var6.field2_base_tmpl_defn_var_base_fld.field_base_tmpl_defn_fld_base +; +} + diff --git a/gcc/testsuite/g++.dg/other/fesd-reduced.h b/gcc/testsuite/g++.dg/other/fesd-reduced.h new file mode 100644 index 0000000..762f587 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/fesd-reduced.h @@ -0,0 +1,42 @@ +#include "fesd.h" + +struct gstruct_base_ordy_decl_not; +struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; }; + +struct gstruct_base_ordy_decl_ref_base; +struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; }; +struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; }; +struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; }; +struct gstruct_base_ordy_defn_var_base { + gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc; + gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref; + gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr; + gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld; + gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc; + gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref; + gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr; + gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld; +}; + +template< typename T > struct gstruct_base_tmpl_decl_not; +template< typename T > struct gstruct_base_tmpl_defn_not +{ int field_base_tmpl_defn_not; }; + +template< typename T > struct gstruct_base_tmpl_decl_ref_base; +template< typename T > struct gstruct_base_tmpl_defn_ref_base +{ int field_base_tmpl_defn_ref_base; }; +template< typename T > struct gstruct_base_tmpl_defn_ptr_base +{ int field_base_tmpl_defn_ptr_base; }; +template< typename T > struct gstruct_base_tmpl_defn_fld_base +{ int field_base_tmpl_defn_fld_base; }; +template< typename T > struct gstruct_base_tmpl_defn_var_base { + gstruct_head_tmpl_decl_ref_base< T > *field1_base_tmpl_defn_var_base_inc; + gstruct_head_tmpl_defn_ref_base< T > *field1_base_tmpl_defn_var_base_ref; + gstruct_head_tmpl_defn_ptr_base< T > *field1_base_tmpl_defn_var_base_ptr; + gstruct_head_tmpl_defn_fld_base< T > field1_base_tmpl_defn_var_base_fld; + gstruct_base_tmpl_decl_ref_base< T > *field2_base_tmpl_defn_var_base_inc; + gstruct_base_tmpl_defn_ref_base< T > *field2_base_tmpl_defn_var_base_ref; + gstruct_base_tmpl_defn_ptr_base< T > *field2_base_tmpl_defn_var_base_ptr; + gstruct_base_tmpl_defn_fld_base< T > field2_base_tmpl_defn_var_base_fld; +}; + diff --git a/gcc/testsuite/g++.dg/other/fesd-sys.C b/gcc/testsuite/g++.dg/other/fesd-sys.C new file mode 100644 index 0000000..95a9a31 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/fesd-sys.C @@ -0,0 +1,126 @@ +// { dg-do compile } +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=sys" } +// { dg-final { scan-assembler "timespec.*DW_AT_name" } } +// { dg-final { scan-assembler "tv_sec.*DW_AT_name" } } +// { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } } +// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } } +// { dg-final { scan-assembler "it_interval.*DW_AT_name" } } +// { dg-final { scan-assembler "it_value.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_defn_fld_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_var_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_decl_ref_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_defn_ref_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_tmpl_defn_ptr_head<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_var_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_fld_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_fld_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_tmpl_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_var_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_tmpl_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_tmpl_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_decl_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_tmpl_defn_ptr_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_tmpl_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_decl_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_ref_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_tmpl_defn_ptr_base<int>.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_tmpl_defn_ptr_base.*DW_AT_name" } } +# 1 "fesd-sys.C" +# 1 "<built-in>" +# 1 "<command-line>" +# 1 "fesd-sys.C" + +//#include "time.h" +# 1 "time.h" 1 3 4 +struct timespec + { + long int tv_sec; + long int tv_nsec; + }; + +struct itimerspec + { + struct timespec it_interval; + struct timespec it_value; + }; + +# 6 "fesd-sys.C" 2 + +struct timespec base_var8; +struct itimerspec *base_var9; + +#include "fesd-sys.h" + +struct gstruct_head_ordy_defn_var_base base_var1; +struct gstruct_base_ordy_defn_var_base base_var2; + +struct gstruct_head_tmpl_defn_var_base< int > base_var5; +struct gstruct_base_tmpl_defn_var_base< int > base_var6; + +int base_function() { + return 0 ++ base_var1.field_head_ordy_defn_var_base ++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base ++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base ++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base ++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base ++ base_var5.field_head_tmpl_defn_var_base ++ base_var6.field1_base_tmpl_defn_var_base_ptr->field_head_tmpl_defn_ptr_base ++ base_var6.field1_base_tmpl_defn_var_base_fld.field_head_tmpl_defn_fld_base ++ base_var6.field2_base_tmpl_defn_var_base_ptr->field_base_tmpl_defn_ptr_base ++ base_var6.field2_base_tmpl_defn_var_base_fld.field_base_tmpl_defn_fld_base +; +} + diff --git a/gcc/testsuite/g++.dg/other/fesd-sys.h b/gcc/testsuite/g++.dg/other/fesd-sys.h new file mode 100644 index 0000000..762f587 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/fesd-sys.h @@ -0,0 +1,42 @@ +#include "fesd.h" + +struct gstruct_base_ordy_decl_not; +struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; }; + +struct gstruct_base_ordy_decl_ref_base; +struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; }; +struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; }; +struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; }; +struct gstruct_base_ordy_defn_var_base { + gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc; + gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref; + gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr; + gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld; + gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc; + gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref; + gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr; + gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld; +}; + +template< typename T > struct gstruct_base_tmpl_decl_not; +template< typename T > struct gstruct_base_tmpl_defn_not +{ int field_base_tmpl_defn_not; }; + +template< typename T > struct gstruct_base_tmpl_decl_ref_base; +template< typename T > struct gstruct_base_tmpl_defn_ref_base +{ int field_base_tmpl_defn_ref_base; }; +template< typename T > struct gstruct_base_tmpl_defn_ptr_base +{ int field_base_tmpl_defn_ptr_base; }; +template< typename T > struct gstruct_base_tmpl_defn_fld_base +{ int field_base_tmpl_defn_fld_base; }; +template< typename T > struct gstruct_base_tmpl_defn_var_base { + gstruct_head_tmpl_decl_ref_base< T > *field1_base_tmpl_defn_var_base_inc; + gstruct_head_tmpl_defn_ref_base< T > *field1_base_tmpl_defn_var_base_ref; + gstruct_head_tmpl_defn_ptr_base< T > *field1_base_tmpl_defn_var_base_ptr; + gstruct_head_tmpl_defn_fld_base< T > field1_base_tmpl_defn_var_base_fld; + gstruct_base_tmpl_decl_ref_base< T > *field2_base_tmpl_defn_var_base_inc; + gstruct_base_tmpl_defn_ref_base< T > *field2_base_tmpl_defn_var_base_ref; + gstruct_base_tmpl_defn_ptr_base< T > *field2_base_tmpl_defn_var_base_ptr; + gstruct_base_tmpl_defn_fld_base< T > field2_base_tmpl_defn_var_base_fld; +}; + diff --git a/gcc/testsuite/g++.dg/other/fesd.h b/gcc/testsuite/g++.dg/other/fesd.h new file mode 100644 index 0000000..83bb15a --- /dev/null +++ b/gcc/testsuite/g++.dg/other/fesd.h @@ -0,0 +1,67 @@ +/* +where from: base = matching base; head = other header +what kind: ordy = ordinary struct; tmpl = template struct +definition: decl = incomplete declaration; defn = full definition +how used: not = not used; ref = by ref; ptr = through pointer; + fld = as field; var = as variable +from where: base = from base; head = other header +*/ + +struct gstruct_head_ordy_decl_not; +struct gstruct_head_ordy_defn_not { int field_head_ordy_defn_not; }; + +struct gstruct_head_ordy_decl_ref_head; +struct gstruct_head_ordy_defn_ref_head { int field_head_ordy_defn_ref_head; }; +struct gstruct_head_ordy_defn_ptr_head { int field_head_ordy_defn_ptr_head; }; +struct gstruct_head_ordy_defn_fld_head { int field_head_ordy_defn_fld_head; }; +struct gstruct_head_ordy_defn_var_head { + gstruct_head_ordy_decl_ref_head *field_head_ordy_defn_var_head_inc; + gstruct_head_ordy_defn_ref_head *field_head_ordy_defn_var_head_ref; + gstruct_head_ordy_defn_ptr_head *field_head_ordy_defn_var_head_ptr; + gstruct_head_ordy_defn_fld_head field_head_ordy_defn_var_head_fld; +}; +extern struct gstruct_head_ordy_defn_var_head head_var1; + +struct gstruct_head_ordy_decl_ref_base; +struct gstruct_head_ordy_defn_ref_base { int field_head_ordy_defn_ref_base; }; +struct gstruct_head_ordy_defn_ptr_base { int field_head_ordy_defn_ptr_base; }; +struct gstruct_head_ordy_defn_fld_base { int field_head_ordy_defn_fld_base; }; +struct gstruct_head_ordy_defn_var_base { int field_head_ordy_defn_var_base; }; + +template< typename T > struct gstruct_head_tmpl_decl_not; +template< typename T > struct gstruct_head_tmpl_defn_not +{ T field_head_tmpl_defn_not; }; + +template< typename T > struct gstruct_head_tmpl_decl_ref_head; +template< typename T > struct gstruct_head_tmpl_defn_ref_head +{ T field_head_tmpl_defn_ref_head; }; +template< typename T > struct gstruct_head_tmpl_defn_ptr_head +{ T field_head_tmpl_defn_ptr_head; }; +template< typename T > struct gstruct_head_tmpl_defn_fld_head +{ T field_head_tmpl_defn_fld_head; }; +template< typename T > struct gstruct_head_tmpl_defn_var_head { + gstruct_head_tmpl_decl_ref_head< T > *field_head_tmpl_defn_var_head_inc; + gstruct_head_tmpl_defn_ref_head< T > *field_head_tmpl_defn_var_head_ref; + gstruct_head_tmpl_defn_ptr_head< T > *field_head_tmpl_defn_var_head_ptr; + gstruct_head_tmpl_defn_fld_head< T > field_head_tmpl_defn_var_head_fld; +}; +extern gstruct_head_tmpl_defn_var_head< int > head_var5; + +template< typename T > struct gstruct_head_tmpl_decl_ref_base; +template< typename T > struct gstruct_head_tmpl_defn_ref_base +{ T field_head_tmpl_defn_ref_base; }; +template< typename T > struct gstruct_head_tmpl_defn_ptr_base +{ T field_head_tmpl_defn_ptr_base; }; +template< typename T > struct gstruct_head_tmpl_defn_fld_base +{ T field_head_tmpl_defn_fld_base; }; +template< typename T > struct gstruct_head_tmpl_defn_var_base +{ T field_head_tmpl_defn_var_base; }; + +inline int head_function() { + return 0 ++ head_var1.field_head_ordy_defn_var_head_ptr->field_head_ordy_defn_ptr_head ++ head_var1.field_head_ordy_defn_var_head_fld.field_head_ordy_defn_fld_head ++ head_var5.field_head_tmpl_defn_var_head_ptr->field_head_tmpl_defn_ptr_head ++ head_var5.field_head_tmpl_defn_var_head_fld.field_head_tmpl_defn_fld_head +; +} diff --git a/gcc/testsuite/gcc.dg/fesd-any.c b/gcc/testsuite/gcc.dg/fesd-any.c new file mode 100644 index 0000000..fc51090 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fesd-any.c @@ -0,0 +1,84 @@ +// { dg-do compile } +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=any" } +// { dg-final { scan-assembler "timespec.*DW_AT_name" } } +// { dg-final { scan-assembler "tv_sec.*DW_AT_name" } } +// { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } } +// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } } +// { dg-final { scan-assembler "it_interval.*DW_AT_name" } } +// { dg-final { scan-assembler "it_value.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } } +# 1 "fesd-any.c" +# 1 "<built-in>" +# 1 "<command-line>" +# 1 "fesd-any.c" + +//#include "time.h" +# 1 "time.h" 1 3 4 +struct timespec + { + long int tv_sec; + long int tv_nsec; + }; + +struct itimerspec + { + struct timespec it_interval; + struct timespec it_value; + }; + +# 6 "fesd-any.c" 2 + +struct timespec base_var8; +struct itimerspec *base_var9; + +#include "fesd-any.h" + +struct gstruct_head_ordy_defn_var_base base_var1; +struct gstruct_base_ordy_defn_var_base base_var2; + +int base_function() { + return 0 ++ base_var1.field_head_ordy_defn_var_base ++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base ++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base ++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base ++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base +; +} + diff --git a/gcc/testsuite/gcc.dg/fesd-any.h b/gcc/testsuite/gcc.dg/fesd-any.h new file mode 100644 index 0000000..a7146b6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fesd-any.h @@ -0,0 +1,19 @@ +#include "fesd.h" + +struct gstruct_base_ordy_decl_not; +struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; }; + +struct gstruct_base_ordy_decl_ref_base; +struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; }; +struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; }; +struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; }; +struct gstruct_base_ordy_defn_var_base { + struct gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc; + struct gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref; + struct gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr; + struct gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld; + struct gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc; + struct gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref; + struct gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr; + struct gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld; +}; diff --git a/gcc/testsuite/gcc.dg/fesd-baseonly.c b/gcc/testsuite/gcc.dg/fesd-baseonly.c new file mode 100644 index 0000000..a32abb5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fesd-baseonly.c @@ -0,0 +1,83 @@ +// { dg-do compile } +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-baseonly" } +// { dg-final { scan-assembler "timespec.*DW_AT_name" } } +// { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } } +// { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } } +// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } } +// { dg-final { scan-assembler-not "it_interval.*DW_AT_name" } } +// { dg-final { scan-assembler-not "it_value.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } } +# 1 "fesd-baseonly.c" +# 1 "<built-in>" +# 1 "<command-line>" +# 1 "fesd-baseonly.c" + +//#include "time.h" +# 1 "time.h" 1 3 4 +struct timespec + { + long int tv_sec; + long int tv_nsec; + }; + +struct itimerspec + { + struct timespec it_interval; + struct timespec it_value; + }; + +# 6 "fesd-baseonly.c" 2 + +struct timespec base_var8; +struct itimerspec *base_var9; + +#include "fesd-baseonly.h" + +struct gstruct_head_ordy_defn_var_base base_var1; +struct gstruct_base_ordy_defn_var_base base_var2; + +int base_function() { + return 0 ++ base_var1.field_head_ordy_defn_var_base ++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base ++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base ++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base ++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base +; +} diff --git a/gcc/testsuite/gcc.dg/fesd-baseonly.h b/gcc/testsuite/gcc.dg/fesd-baseonly.h new file mode 100644 index 0000000..a7146b6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fesd-baseonly.h @@ -0,0 +1,19 @@ +#include "fesd.h" + +struct gstruct_base_ordy_decl_not; +struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; }; + +struct gstruct_base_ordy_decl_ref_base; +struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; }; +struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; }; +struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; }; +struct gstruct_base_ordy_defn_var_base { + struct gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc; + struct gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref; + struct gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr; + struct gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld; + struct gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc; + struct gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref; + struct gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr; + struct gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld; +}; diff --git a/gcc/testsuite/gcc.dg/fesd-none.c b/gcc/testsuite/gcc.dg/fesd-none.c new file mode 100644 index 0000000..bd218f8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fesd-none.c @@ -0,0 +1,84 @@ +// { dg-do compile } +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=none" } +// { dg-final { scan-assembler "timespec.*DW_AT_name" } } +// { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } } +// { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } } +// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } } +// { dg-final { scan-assembler-not "it_interval.*DW_AT_name" } } +// { dg-final { scan-assembler-not "it_value.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } } +# 1 "fesd-none.c" +# 1 "<built-in>" +# 1 "<command-line>" +# 1 "fesd-none.c" + +//#include "time.h" +# 1 "time.h" 1 3 4 +struct timespec + { + long int tv_sec; + long int tv_nsec; + }; + +struct itimerspec + { + struct timespec it_interval; + struct timespec it_value; + }; + +# 6 "fesd-none.c" 2 + +struct timespec base_var8; +struct itimerspec *base_var9; + +#include "fesd-none.h" + +struct gstruct_head_ordy_defn_var_base base_var1; +struct gstruct_base_ordy_defn_var_base base_var2; + +int base_function() { + return 0 ++ base_var1.field_head_ordy_defn_var_base ++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base ++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base ++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base ++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base +; +} + diff --git a/gcc/testsuite/gcc.dg/fesd-none.h b/gcc/testsuite/gcc.dg/fesd-none.h new file mode 100644 index 0000000..a7146b6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fesd-none.h @@ -0,0 +1,19 @@ +#include "fesd.h" + +struct gstruct_base_ordy_decl_not; +struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; }; + +struct gstruct_base_ordy_decl_ref_base; +struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; }; +struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; }; +struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; }; +struct gstruct_base_ordy_defn_var_base { + struct gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc; + struct gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref; + struct gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr; + struct gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld; + struct gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc; + struct gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref; + struct gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr; + struct gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld; +}; diff --git a/gcc/testsuite/gcc.dg/fesd-reduced.c b/gcc/testsuite/gcc.dg/fesd-reduced.c new file mode 100644 index 0000000..ac599f4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fesd-reduced.c @@ -0,0 +1,83 @@ +// { dg-do compile } +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-reduced" } +// { dg-final { scan-assembler "timespec.*DW_AT_name" } } +// { dg-final { scan-assembler "tv_sec.*DW_AT_name" } } +// { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } } +// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } } +// { dg-final { scan-assembler "it_interval.*DW_AT_name" } } +// { dg-final { scan-assembler "it_value.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } } +# 1 "fesd-reduced.c" +# 1 "<built-in>" +# 1 "<command-line>" +# 1 "fesd-reduced.c" + +//#include "time.h" +# 1 "time.h" 1 3 4 +struct timespec + { + long int tv_sec; + long int tv_nsec; + }; + +struct itimerspec + { + struct timespec it_interval; + struct timespec it_value; + }; + +# 6 "fesd-reduced.c" 2 + +struct timespec base_var8; +struct itimerspec *base_var9; + +#include "fesd-reduced.h" + +struct gstruct_head_ordy_defn_var_base base_var1; +struct gstruct_base_ordy_defn_var_base base_var2; + +int base_function() { + return 0 ++ base_var1.field_head_ordy_defn_var_base ++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base ++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base ++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base ++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base +; +} diff --git a/gcc/testsuite/gcc.dg/fesd-reduced.h b/gcc/testsuite/gcc.dg/fesd-reduced.h new file mode 100644 index 0000000..a7146b6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fesd-reduced.h @@ -0,0 +1,19 @@ +#include "fesd.h" + +struct gstruct_base_ordy_decl_not; +struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; }; + +struct gstruct_base_ordy_decl_ref_base; +struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; }; +struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; }; +struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; }; +struct gstruct_base_ordy_defn_var_base { + struct gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc; + struct gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref; + struct gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr; + struct gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld; + struct gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc; + struct gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref; + struct gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr; + struct gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld; +}; diff --git a/gcc/testsuite/gcc.dg/fesd-sys.c b/gcc/testsuite/gcc.dg/fesd-sys.c new file mode 100644 index 0000000..3a5c0bf --- /dev/null +++ b/gcc/testsuite/gcc.dg/fesd-sys.c @@ -0,0 +1,83 @@ +// { dg-do compile } +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=sys" } +// { dg-final { scan-assembler "timespec.*DW_AT_name" } } +// { dg-final { scan-assembler "tv_sec.*DW_AT_name" } } +// { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } } +// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } } +// { dg-final { scan-assembler "it_interval.*DW_AT_name" } } +// { dg-final { scan-assembler "it_value.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_inc.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ref.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_fld.*DW_AT_name" } } +// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler-not "field_head_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_ptr_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field_base_ordy_defn_fld_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } } +// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } } +// { dg-final { scan-assembler "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } } +# 1 "fesd-sys.c" +# 1 "<built-in>" +# 1 "<command-line>" +# 1 "fesd-sys.c" + +//#include "time.h" +# 1 "time.h" 1 3 4 +struct timespec + { + long int tv_sec; + long int tv_nsec; + }; + +struct itimerspec + { + struct timespec it_interval; + struct timespec it_value; + }; + +# 6 "fesd-sys.c" 2 + +struct timespec base_var8; +struct itimerspec *base_var9; + +#include "fesd-sys.h" + +struct gstruct_head_ordy_defn_var_base base_var1; +struct gstruct_base_ordy_defn_var_base base_var2; + +int base_function() { + return 0 ++ base_var1.field_head_ordy_defn_var_base ++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base ++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base ++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base ++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base +; +} diff --git a/gcc/testsuite/gcc.dg/fesd-sys.h b/gcc/testsuite/gcc.dg/fesd-sys.h new file mode 100644 index 0000000..a7146b6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fesd-sys.h @@ -0,0 +1,19 @@ +#include "fesd.h" + +struct gstruct_base_ordy_decl_not; +struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; }; + +struct gstruct_base_ordy_decl_ref_base; +struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; }; +struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; }; +struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; }; +struct gstruct_base_ordy_defn_var_base { + struct gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc; + struct gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref; + struct gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr; + struct gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld; + struct gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc; + struct gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref; + struct gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr; + struct gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld; +}; diff --git a/gcc/testsuite/gcc.dg/fesd.h b/gcc/testsuite/gcc.dg/fesd.h new file mode 100644 index 0000000..46b24f5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/fesd.h @@ -0,0 +1,36 @@ +/* +where from: base = matching base; head = other header +what kind: ordy = ordinary struct; tmpl = template struct +definition: decl = incomplete declaration; defn = full definition +how used: not = not used; ref = by ref; ptr = through pointer; + fld = as field; var = as variable +from where: base = from base; head = other header +*/ + +struct gstruct_head_ordy_decl_not; +struct gstruct_head_ordy_defn_not { int field_head_ordy_defn_not; }; + +struct gstruct_head_ordy_decl_ref_head; +struct gstruct_head_ordy_defn_ref_head { int field_head_ordy_defn_ref_head; }; +struct gstruct_head_ordy_defn_ptr_head { int field_head_ordy_defn_ptr_head; }; +struct gstruct_head_ordy_defn_fld_head { int field_head_ordy_defn_fld_head; }; +struct gstruct_head_ordy_defn_var_head { + struct gstruct_head_ordy_decl_ref_head *field_head_ordy_defn_var_head_inc; + struct gstruct_head_ordy_defn_ref_head *field_head_ordy_defn_var_head_ref; + struct gstruct_head_ordy_defn_ptr_head *field_head_ordy_defn_var_head_ptr; + struct gstruct_head_ordy_defn_fld_head field_head_ordy_defn_var_head_fld; +}; +extern struct gstruct_head_ordy_defn_var_head head_var1; + +struct gstruct_head_ordy_decl_ref_base; +struct gstruct_head_ordy_defn_ref_base { int field_head_ordy_defn_ref_base; }; +struct gstruct_head_ordy_defn_ptr_base { int field_head_ordy_defn_ptr_base; }; +struct gstruct_head_ordy_defn_fld_base { int field_head_ordy_defn_fld_base; }; +struct gstruct_head_ordy_defn_var_base { int field_head_ordy_defn_var_base; }; + +inline int head_function() { + return 0 ++ head_var1.field_head_ordy_defn_var_head_ptr->field_head_ordy_defn_ptr_head ++ head_var1.field_head_ordy_defn_var_head_fld.field_head_ordy_defn_fld_head +; +} |