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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c4/] [c41105a.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- C41105A.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
-- OBJECTIVE:
26
--     CHECK THAT CONSTRAINT_ERROR IS RAISED IF THE NAME PART OF AN
27
--     INDEXED COMPONENT DENOTES AN ACCESS OBJECT WHOSE VALUE IS NULL,
28
--     AND ALSO IF THE NAME IS A FUNCTION CALL DELIVERING NULL.
29
 
30
-- HISTORY:
31
--     WKB 07/29/81  CREATED ORIGINAL TEST.
32
--     SPS 10/26/82
33
--     JET 01/05/88  UPDATED HEADER FORMAT AND ADDED CODE TO PREVENT
34
--                   OPTIMIZATION.
35
 
36
WITH REPORT;
37
USE REPORT;
38
PROCEDURE C41105A IS
39
 
40
BEGIN
41
     TEST ("C41105A", "CONSTRAINT_ERROR FROM NAMES DENOTING A NULL " &
42
                      "ACCESS OBJECT AND A FUNCTION CALL DELIVERING " &
43
                      "NULL");
44
 
45
     DECLARE
46
 
47
          TYPE T1 IS ARRAY (1..2) OF INTEGER;
48
          TYPE A1 IS ACCESS T1;
49
          B : A1 := NEW T1' (1,2);
50
          I : INTEGER;
51
 
52
     BEGIN
53
 
54
          IF EQUAL (3,3) THEN
55
               B := NULL;
56
          END IF;
57
 
58
          I := B(1);
59
          FAILED ("CONSTRAINT_ERROR NOT RAISED - 1");
60
 
61
          IF EQUAL (I,I) THEN
62
               COMMENT ("NO EXCEPTION RAISED");
63
          END IF;
64
 
65
     EXCEPTION
66
 
67
          WHEN CONSTRAINT_ERROR => NULL;
68
          WHEN OTHERS           => FAILED ("WRONG EXCEPTION - 1");
69
 
70
     END;
71
 
72
 
73
     DECLARE
74
 
75
          TYPE T2 IS ARRAY (1..2) OF INTEGER;
76
          TYPE A2 IS ACCESS T2;
77
          I : INTEGER;
78
 
79
          FUNCTION F RETURN A2 IS
80
          BEGIN
81
               IF EQUAL (3,3) THEN
82
                    RETURN NULL;
83
               END IF;
84
               RETURN NEW T2' (1,2);
85
          END F;
86
 
87
     BEGIN
88
 
89
          I := F(1);
90
          FAILED ("CONSTRAINT_ERROR NOT RAISED - 2");
91
 
92
          IF EQUAL (I,I) THEN
93
               COMMENT ("NO EXCEPTION RAISED");
94
          END IF;
95
 
96
     EXCEPTION
97
 
98
          WHEN CONSTRAINT_ERROR => NULL;
99
          WHEN OTHERS           => FAILED ("WRONG EXCEPTION - 2");
100
 
101
     END;
102
 
103
     RESULT;
104
END C41105A;

powered by: WebSVN 2.1.0

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