OSDN Git Service

PR tree-optimization/51580
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Dec 2011 19:17:10 +0000 (19:17 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Dec 2011 19:17:10 +0000 (19:17 +0000)
* gnat.dg/specs/loop_optimization1.ads: New test.
* gnat.dg/specs/loop_optimization1_pkg.ad[sb]: New helper.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182491 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/specs/loop_optimization1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/specs/loop_optimization1_pkg.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/specs/loop_optimization1_pkg.ads [new file with mode: 0644]

index fcbed1e..f74bad7 100644 (file)
@@ -1,3 +1,9 @@
+2011-12-19  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR tree-optimization/51580
+       * gnat.dg/specs/loop_optimization1.ads: New test.
+       * gnat.dg/specs/loop_optimization1_pkg.ad[sb]: New helper.
+
 2011-12-19  Richard Guenther  <rguenther@suse.de>
 
        PR lto/51573
diff --git a/gcc/testsuite/gnat.dg/specs/loop_optimization1.ads b/gcc/testsuite/gnat.dg/specs/loop_optimization1.ads
new file mode 100644 (file)
index 0000000..020ddcd
--- /dev/null
@@ -0,0 +1,14 @@
+-- { dg-do compile }
+-- { dg-options "-O3" }
+
+with Loop_Optimization1_Pkg;
+
+package Loop_Optimization1 is
+
+  type Kind_Type is (One, Two, Three, Four);
+  type Array_Type is array (Kind_Type) of Boolean;
+  pragma Pack (Array_Type);
+
+  package Q is new Loop_Optimization1_Pkg (Boolean, Kind_Type, Array_Type);
+
+end Loop_Optimization1;
diff --git a/gcc/testsuite/gnat.dg/specs/loop_optimization1_pkg.adb b/gcc/testsuite/gnat.dg/specs/loop_optimization1_pkg.adb
new file mode 100644 (file)
index 0000000..f55dbb0
--- /dev/null
@@ -0,0 +1,16 @@
+package body Loop_Optimization1_Pkg is
+
+  type Unconstrained_Array_Type
+    is array (Index_Type range <>) of Element_Type;
+
+  procedure Local (UA : in out Unconstrained_Array_Type) is
+  begin
+    null;
+  end;
+
+  procedure Proc (CA : in out Constrained_Array_Type) is
+  begin
+    Local (Unconstrained_Array_Type (CA));
+  end;
+
+end Loop_Optimization1_Pkg;
diff --git a/gcc/testsuite/gnat.dg/specs/loop_optimization1_pkg.ads b/gcc/testsuite/gnat.dg/specs/loop_optimization1_pkg.ads
new file mode 100644 (file)
index 0000000..577b3a2
--- /dev/null
@@ -0,0 +1,13 @@
+-- { dg-excess-errors "no code generated" }
+
+generic
+
+  type Element_Type is private;
+  type Index_Type is (<>);
+  type Constrained_Array_Type is array (Index_Type) of Element_Type;
+
+package Loop_Optimization1_Pkg is
+
+  procedure Proc (CA : in out Constrained_Array_Type);
+
+end Loop_Optimization1_Pkg;