OSDN Git Service

* gcc-interface/utils.c (maybe_unconstrained_array): Declare TYPE local
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gnat.dg / unc.adb
1 -- { dg-do compile }
2
3 with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO;
4 procedure Unc is
5    type Arr is array (1..4) of integer;
6    type Bytes is array (positive range <>) of Character;
7    type Buffer (D : Boolean := False) is record
8       case D is 
9         when False =>
10            Chars: Bytes (1..16);
11         when True =>
12            Values : Arr;
13       end case;
14    end record;
15 --
16    pragma Unchecked_Union (Buffer);
17    pragma Warnings (Off);
18    Val : Buffer;
19 --      
20    F : File_Type;
21    S : Stream_Access;
22 begin
23    Create (F, Out_File);
24    S := Stream (F);
25    Buffer'Output (S, Val);
26 end;