From bbc960279d3176051db9d134f74997ae9f0b01a7 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 22 Oct 2018 10:29:57 +0000 Subject: [PATCH] warn19.ad[sb]: New test. * gnat.dg/warn19.ad[sb]: New test. * gnat.dg/warn19_pkg.ads: New helper. From-SVN: r265377 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gnat.dg/warn19.adb | 20 ++++++++++++++++++++ gcc/testsuite/gnat.dg/warn19.ads | 6 ++++++ gcc/testsuite/gnat.dg/warn19_pkg.ads | 6 ++++++ 4 files changed, 37 insertions(+) create mode 100644 gcc/testsuite/gnat.dg/warn19.adb create mode 100644 gcc/testsuite/gnat.dg/warn19.ads create mode 100644 gcc/testsuite/gnat.dg/warn19_pkg.ads diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1ca548120a8..42a33ae0099 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-10-22 Eric Botcazou + + * gnat.dg/warn19.ad[sb]: New test. + * gnat.dg/warn19_pkg.ads: New helper. + 2018-10-22 Richard Biener PR tree-optimization/87640 diff --git a/gcc/testsuite/gnat.dg/warn19.adb b/gcc/testsuite/gnat.dg/warn19.adb new file mode 100644 index 00000000000..593344bdc8e --- /dev/null +++ b/gcc/testsuite/gnat.dg/warn19.adb @@ -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 index 00000000000..e1bd48252ca --- /dev/null +++ b/gcc/testsuite/gnat.dg/warn19.ads @@ -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 index 00000000000..7cce224027b --- /dev/null +++ b/gcc/testsuite/gnat.dg/warn19_pkg.ads @@ -0,0 +1,6 @@ +package Warn19_Pkg is + + type Bits is array (1 .. 4) of Boolean; + procedure Init (X : out Bits); + +end Warn19_Pkg; -- 2.30.2