diff options
Diffstat (limited to 'gcc/testsuite/gnat.dg/forward_vla.adb')
-rw-r--r-- | gcc/testsuite/gnat.dg/forward_vla.adb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/forward_vla.adb b/gcc/testsuite/gnat.dg/forward_vla.adb new file mode 100644 index 000000000..515112b83 --- /dev/null +++ b/gcc/testsuite/gnat.dg/forward_vla.adb @@ -0,0 +1,20 @@ +-- { dg-do compile } +-- { dg-options "-O2 -gnatp -Wuninitialized" } + +procedure Forward_Vla is + + function N return Natural is begin return 1; end; + + type Sequence; + type Sequence_Access is access all Sequence; + + Ptr : Sequence_Access := null; -- freeze access type + + Sequence_Length : Natural := N; + type Sequence is array (1 .. Sequence_Length) of Natural; + + Seq : Sequence; +begin + Seq (1) := 0; +end; + |