From: Eric Botcazou Date: Sat, 29 Jul 2017 09:52:04 +0000 (+0000) Subject: c-ada-spec.c (dump_generic_ada_node): Take into account signedness for enumeral types. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=942047f22f64013b9f481a6390a25c345b265d66;p=gcc.git c-ada-spec.c (dump_generic_ada_node): Take into account signedness for enumeral types. * c-ada-spec.c (dump_generic_ada_node): Take into account signedness for enumeral types. (print_ada_declaration): Add missing guard for record types. From-SVN: r250714 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index c05ca124ddc..88752a88c22 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2017-07-29 Eric Botcazou + + * c-ada-spec.c (dump_generic_ada_node): Take into account signedness + for enumeral types. + (print_ada_declaration): Add missing guard for record types. + 2017-07-27 Jakub Jelinek PR c/45784 diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index d39501c7b91..de549501440 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -2055,7 +2055,10 @@ dump_generic_ada_node (pretty_printer *buffer, tree node, tree type, int spc, } else { - pp_string (buffer, "unsigned"); + if (TYPE_UNSIGNED (node)) + pp_string (buffer, "unsigned"); + else + pp_string (buffer, "int"); for (; value; value = TREE_CHAIN (value)) { pp_semicolon (buffer); @@ -3097,7 +3100,7 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc) if (TYPE_NAME (TREE_TYPE (t))) dump_generic_ada_node (buffer, TREE_TYPE (t), t, spc, false, true); - else + else if (type) dump_ada_double_name (buffer, type, t); } else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8e83a732a5f..20ea9de7555 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2017-07-29 Eric Botcazou + + * c-c++-common/dump-ada-spec-7.c: New test. + 2017-07-29 Jakub Jelinek * g++.dg/debug/dwarf2/inline-ns-1.C: New test. diff --git a/gcc/testsuite/c-c++-common/dump-ada-spec-7.c b/gcc/testsuite/c-c++-common/dump-ada-spec-7.c new file mode 100644 index 00000000000..515d2597662 --- /dev/null +++ b/gcc/testsuite/c-c++-common/dump-ada-spec-7.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-ada-spec" } */ + +enum E1 { + A1 = -1L, + A2 = 0, + A3 = 1 +}; + +static enum {B1 = -1L, B2, B3} Obj1; + +static struct { int i; } Obj2; + +/* { dg-final { scan-ada-spec-not "unsigned" } } */ +/* { dg-final { cleanup-ada-spec } } */