Back to home page

LXR

 
 

    


Warning, /testsuites/ada/support/integer.inc is written in an unsupported language. File is not indexed.

0001 -- SPDX-License-Identifier: BSD-2-Clause
0002 
0003 --
0004 --  integer.inc
0005 --
0006 --  Macros to produce a large number of LOCAL integer variables.  This
0007 --  preprocessing is necessary to insure that the variables are
0008 --  scoped properly and to avoid duplicating hundreds of lines
0009 --  of code.
0010 --
0011 --  COPYRIGHT (c) 1989-1997.
0012 --  On-Line Applications Research Corporation (OAR). 
0013 --
0014 --  Redistribution and use in source and binary forms, with or without
0015 --  modification, are permitted provided that the following conditions
0016 --  are met:
0017 --  1. Redistributions of source code must retain the above copyright
0018 --     notice, this list of conditions and the following disclaimer.
0019 --  2. Redistributions in binary form must reproduce the above copyright
0020 --     notice, this list of conditions and the following disclaimer in the
0021 --     documentation and/or other materials provided with the distribution.
0022 --
0023 --  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0024 --  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0025 --  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0026 --  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0027 --  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0028 --  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0029 --  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0030 --  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0031 --  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0032 --  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0033 --  POSSIBILITY OF SUCH DAMAGE.
0034 
0035 --
0036 -- private definitions for macro use
0037 --
0038 
0039 -- macro usage INTEGER_CHECK_ONE( value, base, factor )
0040 define(`INTEGER_CHECK_ONE',`
0041   if $1 /= ($2 + $3) then
0042      UNSIGNED32_IO.PUT( TASK_INDEX );
0043      TEXT_IO.PUT( ": $1 wrong -- (" );
0044      UNSIGNED32_IO.PUT( $1, BASE => 16);
0045      TEXT_IO.PUT( " not " );
0046      UNSIGNED32_IO.PUT( $2, BASE => 16 );
0047      TEXT_IO.PUT_LINE( ")" );
0048   end if
0049 '
0050 )
0051 
0052 -- macro usage INTEGER_DECLARE
0053 define(`INTEGER_DECLARE', `
0054   INT01 : RTEMS.UNSIGNED32 :=  1;
0055   INT02 : RTEMS.UNSIGNED32 :=  2;
0056   INT03 : RTEMS.UNSIGNED32 :=  3;
0057   INT04 : RTEMS.UNSIGNED32 :=  4;
0058   INT05 : RTEMS.UNSIGNED32 :=  5;
0059   INT06 : RTEMS.UNSIGNED32 :=  6;
0060   INT07 : RTEMS.UNSIGNED32 :=  7;
0061   INT08 : RTEMS.UNSIGNED32 :=  8;
0062   INT09 : RTEMS.UNSIGNED32 :=  9;
0063   INT10 : RTEMS.UNSIGNED32 := 10;
0064   INT11 : RTEMS.UNSIGNED32 := 11;
0065   INT12 : RTEMS.UNSIGNED32 := 12;
0066   INT13 : RTEMS.UNSIGNED32 := 13;
0067   INT14 : RTEMS.UNSIGNED32 := 14;
0068   INT15 : RTEMS.UNSIGNED32 := 15;
0069   INT16 : RTEMS.UNSIGNED32 := 16;
0070   INT17 : RTEMS.UNSIGNED32 := 17;
0071   INT18 : RTEMS.UNSIGNED32 := 18;
0072   INT19 : RTEMS.UNSIGNED32 := 19;
0073   INT20 : RTEMS.UNSIGNED32 := 20;
0074   INT21 : RTEMS.UNSIGNED32 := 21;
0075   INT22 : RTEMS.UNSIGNED32 := 22;
0076   INT23 : RTEMS.UNSIGNED32 := 23;
0077   INT24 : RTEMS.UNSIGNED32 := 24;
0078   INT25 : RTEMS.UNSIGNED32 := 25;
0079   INT26 : RTEMS.UNSIGNED32 := 26;
0080   INT27 : RTEMS.UNSIGNED32 := 27;
0081   INT28 : RTEMS.UNSIGNED32 := 28;
0082   INT29 : RTEMS.UNSIGNED32 := 29;
0083   INT30 : RTEMS.UNSIGNED32 := 30;
0084   INT31 : RTEMS.UNSIGNED32 := 31;
0085   INT32 : RTEMS.UNSIGNED32 := 32
0086 '
0087 )
0088 
0089 
0090 -- macro usage INTEGER_LOAD( factor )
0091 define(`INTEGER_LOAD',`
0092   INT01 := INT01 + $1;
0093   INT02 := INT02 + $1;
0094   INT03 := INT03 + $1;
0095   INT04 := INT04 + $1;
0096   INT05 := INT05 + $1;
0097   INT06 := INT06 + $1;
0098   INT07 := INT07 + $1;
0099   INT08 := INT08 + $1;
0100   INT09 := INT09 + $1;
0101   INT10 := INT10 + $1;
0102   INT11 := INT11 + $1;
0103   INT12 := INT12 + $1;
0104   INT13 := INT13 + $1;
0105   INT14 := INT14 + $1;
0106   INT15 := INT15 + $1;
0107   INT16 := INT16 + $1;
0108   INT17 := INT17 + $1;
0109   INT18 := INT18 + $1;
0110   INT19 := INT19 + $1;
0111   INT20 := INT20 + $1;
0112   INT21 := INT21 + $1;
0113   INT22 := INT22 + $1;
0114   INT23 := INT23 + $1;
0115   INT24 := INT24 + $1;
0116   INT25 := INT25 + $1;
0117   INT26 := INT26 + $1;
0118   INT27 := INT27 + $1;
0119   INT28 := INT28 + $1;
0120   INT29 := INT29 + $1;
0121   INT30 := INT30 + $1;
0122   INT31 := INT31 + $1;
0123   INT32 := INT32 + $1
0124 ')
0125 
0126 -- macro usage INTEGER_CHECK( factor )
0127 define(`INTEGER_CHECK',`
0128   INTEGER_CHECK_ONE( INT01,  1, $1 );
0129   INTEGER_CHECK_ONE( INT02,  2, $1 );
0130   INTEGER_CHECK_ONE( INT03,  3, $1 );
0131   INTEGER_CHECK_ONE( INT04,  4, $1 );
0132   INTEGER_CHECK_ONE( INT05,  5, $1 );
0133   INTEGER_CHECK_ONE( INT06,  6, $1 );
0134   INTEGER_CHECK_ONE( INT07,  7, $1 );
0135   INTEGER_CHECK_ONE( INT08,  8, $1 );
0136   INTEGER_CHECK_ONE( INT09,  9, $1 );
0137   INTEGER_CHECK_ONE( INT10, 10, $1 );
0138   INTEGER_CHECK_ONE( INT11, 11, $1 );
0139   INTEGER_CHECK_ONE( INT12, 12, $1 );
0140   INTEGER_CHECK_ONE( INT13, 13, $1 );
0141   INTEGER_CHECK_ONE( INT14, 14, $1 );
0142   INTEGER_CHECK_ONE( INT15, 15, $1 );
0143   INTEGER_CHECK_ONE( INT16, 16, $1 );
0144   INTEGER_CHECK_ONE( INT17, 17, $1 );
0145   INTEGER_CHECK_ONE( INT18, 18, $1 );
0146   INTEGER_CHECK_ONE( INT19, 19, $1 );
0147   INTEGER_CHECK_ONE( INT20, 20, $1 );
0148   INTEGER_CHECK_ONE( INT21, 21, $1 );
0149   INTEGER_CHECK_ONE( INT22, 22, $1 );
0150   INTEGER_CHECK_ONE( INT23, 23, $1 );
0151   INTEGER_CHECK_ONE( INT24, 24, $1 );
0152   INTEGER_CHECK_ONE( INT25, 25, $1 );
0153   INTEGER_CHECK_ONE( INT26, 26, $1 );
0154   INTEGER_CHECK_ONE( INT27, 27, $1 );
0155   INTEGER_CHECK_ONE( INT28, 28, $1 );
0156   INTEGER_CHECK_ONE( INT29, 29, $1 );
0157   INTEGER_CHECK_ONE( INT30, 30, $1 );
0158   INTEGER_CHECK_ONE( INT31, 31, $1 );
0159   INTEGER_CHECK_ONE( INT32, 32, $1 )
0160 '
0161 )