warn19.ad[sb]: New test.
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 22 Oct 2018 10:29:57 +0000 (10:29 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 22 Oct 2018 10:29:57 +0000 (10:29 +0000)
* gnat.dg/warn19.ad[sb]: New test.
* gnat.dg/warn19_pkg.ads: New helper.

From-SVN: r265377

gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/warn19.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/warn19.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/warn19_pkg.ads [new file with mode: 0644]

index 1ca5481..42a33ae 100644 (file)
@@ -1,3 +1,8 @@
+2018-10-22  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/warn19.ad[sb]: New test.
+       * gnat.dg/warn19_pkg.ads: New helper.
+
 2018-10-22  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/87640
diff --git a/gcc/testsuite/gnat.dg/warn19.adb b/gcc/testsuite/gnat.dg/warn19.adb
new file mode 100644 (file)
index 0000000..593344b
--- /dev/null
@@ -0,0 +1,20 @@
+--  { dg-do compile }
+--  { dg-options "-O2 -Wuninitialized" }
+
+package body Warn19 is
+
+   procedure P_Init (X : out Bits) is
+   begin
+      Init (X);
+   end;
+   
+   procedure Setup is
+      Data : Bits;
+   begin
+      P_Init (Data);
+      for I in Data'Range loop
+         P_Data (I) := Data (I);
+      end loop;
+   end;
+
+end Warn19;
diff --git a/gcc/testsuite/gnat.dg/warn19.ads b/gcc/testsuite/gnat.dg/warn19.ads
new file mode 100644 (file)
index 0000000..e1bd482
--- /dev/null
@@ -0,0 +1,6 @@
+with Warn19_Pkg; use Warn19_Pkg;
+
+package Warn19 is
+   P_Data : Bits;   
+   procedure Setup;
+end Warn19;
diff --git a/gcc/testsuite/gnat.dg/warn19_pkg.ads b/gcc/testsuite/gnat.dg/warn19_pkg.ads
new file mode 100644 (file)
index 0000000..7cce224
--- /dev/null
@@ -0,0 +1,6 @@
+package Warn19_Pkg is
+
+   type Bits is array (1 .. 4) of Boolean;
+   procedure Init (X : out Bits);
+
+end Warn19_Pkg;