1pragma Ada_2012;
2separate (T_derivations)
3procedure From is
4   -- Check plain types
5   type T1 is new Integer;                -- From: Standard.Integer, category RANGE
6   type T2 is new T1 range 1 .. 10;       -- From: Standard.Integer, category RANGE
7
8   type T3 is tagged
9      record
10         F : Float;
11      end record;
12   type T4 is new T3 with null record;    -- From: T3
13   type T5 is new T4                      -- From: T4, T3
14     with record
15      I : Integer;
16   end record;
17
18   type T6 is range 1 .. 10;
19   type T7 is new T6;                     -- From: category RANGE
20   type T8 is (One, Two, Three);
21   type T9 is new T8;                     -- From: category ()
22
23   type T10 is new Float;                 -- From: package Standard
24
25   generic
26      type F1 is new Integer;             -- From: Standard.Integer, category RANGE
27      type F2 is new T2;                  -- From: Standard.Integer, category RANGE
28      type F3 is new T5 with private;     -- From: T4, T3
29   procedure P;
30   procedure P is
31      type DF1 is new F1;                 -- From: Standard.Integer, category RANGE
32      type DF2 is new F2;                 -- From: Standard.Integer, category RANGE
33   begin null; end P;
34
35   -- Check subtypes
36   subtype S1 is Integer range 1 .. 10;
37   type S2 is new S1;                     -- From: Standard.Integer, category RANGE
38   subtype S3 is S2 range 1 .. 5;
39   type S4 is new S3;                     -- From: S3, Standard.Integer, category RANGE
40   type S5 is new S3'Base;                -- From: Standard.Integer, category RANGE
41   type S6 is new S4;                     -- From: S3, Standard.Integer, category RANGE
42
43   -- Check interfaces and progenitors
44   type I1 is interface;
45   type I2 is interface;
46   type II1 is new I1 and I2 with null record;    -- From: I1, I2; Max_Parents: more than 1
47   type II2 is interface and I1 and I2;           -- From: I1, I2; Max_Parents: more than 1
48
49   type MI1 is new T5  and I1  with null record;  -- From: T4, T3, I1;     Max_Parents: more than 1
50   type MI2 is new MI1 and I2  with null record;  -- From: T4, T3, I1, I2; Max_Parents: more than 1
51   type MI3 is new MI1         with null record;  -- From: T4, T3, I1
52   type MI4 is new MI2 and II2 with null record;  -- From: T4, T3, I1, I2; Max_Parents: more than 1
53
54   -- Check tasks and POs
55   task type Task1 is
56   end Task1;
57   task body Task1 is begin null; end;
58   type Task_D1 is new Task1;                     -- From: category TASK
59
60   type Ilim is limited interface;
61   type Itask is task interface;
62   task type Task2 is new Ilim and Itask with     -- From: Ilim; Max_Parents: more than 1
63   end Task2;
64   task body Task2 is begin null; end;
65
66   protected type PO1 is
67      procedure P;
68   end PO1;
69   protected body PO1 Is
70      procedure P is begin null; end;
71   end PO1;
72   type PO_D1 is new PO1;                         -- From: category PROTECTED
73
74   protected type PO2 is new Ilim with            -- From: Ilim;
75        procedure P;
76   end PO2;
77   protected body PO2 Is
78      procedure P is begin null; end;
79   end PO2;
80begin
81   null;
82end From;
83