aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/specs/controlled1.ads
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2010-05-19 17:53:58 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-05-19 17:53:58 +0000
commit616f1431bf3ad91356460164fcd7d4d8a6f3bd3f (patch)
treee941e9d3872b8da1472eb83529eb4f4677ae6331 /gcc/testsuite/gnat.dg/specs/controlled1.ads
parentdaf8c6f03b7b7ae33e2e8e301d367eb8cce80e5c (diff)
downloadgcc-616f1431bf3ad91356460164fcd7d4d8a6f3bd3f.zip
gcc-616f1431bf3ad91356460164fcd7d4d8a6f3bd3f.tar.gz
gcc-616f1431bf3ad91356460164fcd7d4d8a6f3bd3f.tar.bz2
langhooks.h (struct lang_hooks): Add new field deep_unsharing.
* langhooks.h (struct lang_hooks): Add new field deep_unsharing. * langhooks-def.h (LANG_HOOKS_DEEP_UNSHARING): New macro. (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_DEEP_UNSHARING. * gimplify.c: (mostly_copy_tree_r): Copy trees under SAVE_EXPR and TARGET_EXPR nodes, but only once, if instructed to do so. Do not propagate the 'data' argument to copy_tree_r. (copy_if_shared_r): Remove bogus ATTRIBUTE_UNUSED marker. Propagate 'data' argument to walk_tree. (copy_if_shared): New function. (unmark_visited_r): Remove bogus ATTRIBUTE_UNUSED marker. (unmark_visited): New function. (unshare_body): Call copy_if_shared instead of doing it manually. (unvisit_body): Call unmark_visited instead of doing it manually. ada/ * gcc-interface/misc.c (LANG_HOOKS_DEEP_UNSHARING): Redefine. * gcc-interface/trans.c (unshare_save_expr): Delete. (gigi): Do not unshare trees under SAVE_EXPRs here. From-SVN: r159592
Diffstat (limited to 'gcc/testsuite/gnat.dg/specs/controlled1.ads')
-rw-r--r--gcc/testsuite/gnat.dg/specs/controlled1.ads35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/specs/controlled1.ads b/gcc/testsuite/gnat.dg/specs/controlled1.ads
new file mode 100644
index 0000000..1ceedaf
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/controlled1.ads
@@ -0,0 +1,35 @@
+-- { dg-do compile }
+
+with Ada.Finalization;
+with Controlled1_Pkg; use Controlled1_Pkg;
+
+package Controlled1 is
+
+ type Collection is new Ada.Finalization.Controlled with null record;
+
+ type Object_Kind_Type is (One, Two);
+
+ type Byte_Array is array (Natural range <>) of Integer;
+
+ type Bounded_Byte_Array_Type is record
+ A : Byte_Array (1 .. Value);
+ end record;
+
+ type Object_Type is tagged record
+ A : Bounded_Byte_Array_Type;
+ end record;
+
+ type R_Object_Type is new Object_Type with record
+ L : Collection;
+ end record;
+
+ type Obj_Type (Kind : Object_Kind_Type := One) is record
+ case Kind is
+ when One => R : R_Object_Type;
+ when others => null;
+ end case;
+ end record;
+
+ type Obj_Array_Type is array (Positive range <>) of Obj_Type;
+
+end Controlled1;