Debian Codegraph @

gcc/testsuite/gnat.dg/component_value1.adb

raw
1 -- { dg-do run }
2
3 with Ada.Characters.Latin_1;
4
5 procedure Component_Value1 is
6
7 type Y_Array is array (Natural range <>) of Character
8 with Default_Component_Value => Ada.Characters.Latin_1.Space;
9
10 type Y2_Array is new Y_Array
11 with Default_Component_Value => Ada.Characters.Latin_1.HT;
12
13 type X_String is new String
14 with Default_Component_Value => Ada.Characters.Latin_1.Space;
15
16 Y : Y_Array (1..20);
17 Y2 : Y2_Array (1..20);
18 X : X_String (1..20);
19
20 begin
21 if not (for all I in Y'Range => Y(I) = Ada.Characters.Latin_1.Space) then
22 raise Program_Error;
23 end if;
24
25 if not (for all I in Y2'Range => Y2(I) = Ada.Characters.Latin_1.HT) then
26 raise Program_Error;
27 end if;
28
29 if not (for all I in X'Range => X(I) = Ada.Characters.Latin_1.Space) then
30 raise Program_Error;
31 end if;
32 end;