summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-30 12:20:06 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-30 12:20:06 +0000
commited92a4610ee284e1af24064c9043017c209d1e11 (patch)
tree8ad814cbf8efa1134e6c6e30477eecc09ac41bf9 /gcc/testsuite/c-c++-common
parent49a601a2d082130242e87c784ff1484902795bc9 (diff)
downloadgcc-ed92a4610ee284e1af24064c9043017c209d1e11.tar.gz
* c-ada-spec.c (print_ada_macros): Remove redundant blank line.
(decl_sloc_common): Delete and move bulk of processing to... (decl_sloc): ...here. (pp_ada_tree_identifier): Remove reference to QUAL_UNION_TYPE. (dump_ada_double_name): Remove S parameter and compute the suffix. (dump_ada_array_type): Add PARENT parameter. Simplify computation of element type and deal with an anonymous one. (dump_ada_template): Use RECORD_OR_UNION_TYPE_P macro. (dump_generic_ada_node): Tweak. Adjust call to dump_ada_array_type and remove reference to QUAL_UNION_TYPE. (dump_nested_types): Make 2 passes on the fields and move bulk to... (dump_nested_type): ...here. New function extracted from above. Generate a full declaration for anonymous element type of arrays. (print_ada_declaration): Really skip anonymous declarations. Remove references to QUAL_UNION_TYPE. Adjust call to dump_ada_array_type. Clean up processing of declarations of array types and objects. (print_ada_struct_decl): Remove reference to QUAL_UNION_TYPE. Remove obsolete code and tidy up. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231069 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/c-c++-common')
-rw-r--r--gcc/testsuite/c-c++-common/dump-ada-spec-1.c10
-rw-r--r--gcc/testsuite/c-c++-common/dump-ada-spec-2.c49
2 files changed, 59 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/dump-ada-spec-1.c b/gcc/testsuite/c-c++-common/dump-ada-spec-1.c
new file mode 100644
index 00000000000..eb249e79854
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/dump-ada-spec-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-ada-spec" } */
+
+struct S
+{
+ int i;
+};
+
+/* { dg-final { scan-ada-spec "type S is record" } } */
+/* { dg-final { cleanup-ada-spec } } */
diff --git a/gcc/testsuite/c-c++-common/dump-ada-spec-2.c b/gcc/testsuite/c-c++-common/dump-ada-spec-2.c
new file mode 100644
index 00000000000..46eedb582bb
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/dump-ada-spec-2.c
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-ada-spec" } */
+
+struct S1 {
+ struct {
+ int i;
+ } F;
+};
+
+struct S2 {
+ union {
+ int i;
+ } F;
+};
+
+struct S3 {
+ struct {
+ int i;
+ } F[2];
+};
+
+struct S4 {
+ struct {
+ struct S4 *next;
+ } F;
+};
+
+struct S5 {
+ struct {
+ struct S5 *next;
+ } F[2];
+};
+
+struct S6 {
+ struct {
+ struct S6 *next[2];
+ } F;
+};
+
+struct S7 {
+ struct {
+ int i;
+ } F1[2];
+ struct {
+ float f;
+ } F2[2];
+};
+
+/* { dg-final { cleanup-ada-spec } } */