OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c3/] [c37103a.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C37103A.ADA
2
 
3
--                             Grant of Unlimited Rights
4
--
5
--     Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
6
--     F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained 
7
--     unlimited rights in the software and documentation contained herein.
8
--     Unlimited rights are defined in DFAR 252.227-7013(a)(19).  By making 
9
--     this public release, the Government intends to confer upon all 
10
--     recipients unlimited rights  equal to those held by the Government.  
11
--     These rights include rights to use, duplicate, release or disclose the 
12
--     released technical data and computer software in whole or in part, in 
13
--     any manner and for any purpose whatsoever, and to have or permit others 
14
--     to do so.
15
--
16
--                                    DISCLAIMER
17
--
18
--     ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19
--     DISCLOSED ARE AS IS.  THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED 
20
--     WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
21
--     SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE 
22
--     OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
23
--     PARTICULAR PURPOSE OF SAID MATERIAL.
24
--*
25
-- CHECK THAT DISCRIMINANTS MAY BE BOOLEAN, CHARACTER, USER_ENUM,
26
-- INTEGER, DERIVED CHARACTER, DERIVED USER_ENUM, DERIVED INTEGER,
27
-- AND DERIVED DERIVED USER_ENUM.
28
 
29
-- DAT 5/18/81
30
-- SPS 10/25/82
31
 
32
WITH REPORT; USE REPORT;
33
 
34
PROCEDURE C37103A IS
35
BEGIN
36
     TEST ("C37103A", "MANY DIFFERENT DISCRIMINANT TYPES");
37
     DECLARE
38
          PACKAGE P1 IS
39
               TYPE ENUM IS (A, Z, Q, 'W', 'A');
40
          END P1;
41
 
42
          PACKAGE P2 IS
43
               TYPE E2 IS NEW P1.ENUM;
44
          END P2;
45
 
46
          PACKAGE P3 IS
47
               TYPE E3 IS NEW P2.E2;
48
          END P3;
49
 
50
          USE P1, P2, P3;
51
          TYPE INT IS NEW INTEGER RANGE -3 .. 7;
52
          TYPE CHAR IS NEW CHARACTER;
53
          TYPE R1 (D : ENUM) IS RECORD NULL; END RECORD;
54
          TYPE R2 (D : INTEGER) IS RECORD NULL; END RECORD;
55
          TYPE R3 (D : BOOLEAN) IS RECORD NULL; END RECORD;
56
          TYPE R4 (D : CHARACTER) IS RECORD NULL; END RECORD;
57
          TYPE R5 (D : CHAR) IS RECORD NULL; END RECORD;
58
          TYPE R6 (D : E2) IS RECORD NULL; END RECORD;
59
          TYPE R7 (D : E3) IS RECORD NULL; END RECORD;
60
          TYPE R8 (D : INT) IS RECORD NULL; END RECORD;
61
          O1 : R1(A) := (D => A);
62
          O2 : R2(3) := (D => 3);
63
          O3 : R3(TRUE) := (D => TRUE);
64
          O4 : R4(ASCII.NUL) := (D => ASCII.NUL);
65
          O5 : R5('A') := (D => 'A');
66
          O6 : R6('A') := (D => 'A');
67
          O7 : R7(A) := (D => A);
68
          O8 : R8(2) := (D => 2);
69
     BEGIN
70
          IF O1.D /= A
71
          OR O2.D /= 3
72
          OR NOT O3.D
73
          OR O4.D IN 'A' .. 'Z'
74
          OR O5.D /= 'A'
75
          OR O6.D /= 'A'
76
          OR O7.D /= A
77
          OR O8.D /= 2
78
          THEN FAILED ("WRONG DISCRIMINANT VALUE");
79
          END IF;
80
     END;
81
 
82
     RESULT;
83
END C37103A;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.