Wattributes-10.c: Add -fno-common option on hppa*-*-hpux*.
[official-gcc.git] / gcc / testsuite / gnat.dg / array8.adb
blob6e18ecadf94f39dabba73d7b24a3afef0a166ebf
1 -- { dg-do compile }
2 -- { dg-options "-O2" }
4 PROCEDURE Array8 IS
6 function ID (I : Integer) return Integer is
7 begin
8 return I;
9 end;
11 SUBTYPE STB IS INTEGER RANGE ID(-8) .. -5;
13 TYPE TB IS ARRAY (STB RANGE <>) OF INTEGER;
15 GENERIC
16 B1 : TB;
17 PROCEDURE PROC1;
19 PROCEDURE PROC1 IS
20 BEGIN
21 IF B1'FIRST /= -8 THEN
22 raise Program_Error;
23 ELSIF B1'LAST /= ID(-5) THEN
24 raise Program_Error;
25 ELSIF B1 /= (7, 6, 5, 4) THEN
26 raise Program_Error;
27 END IF;
28 END;
30 PROCEDURE PROC2 IS NEW PROC1 ((7, 6, ID(5), 4));
32 BEGIN
33 PROC2;
34 END;