DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: B T

⟦12f1ce67d⟧ TextFile

    Length: 2454 (0x996)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Instrument;
use Instrument;

---------------------
-- Record Representation
---------------------

-- This test evaluates the code efficiency of elaborating an object
-- declaration of a simple record type that has an associated record
-- representation clause.

-- The test and noise versions for this evaluation are structurally
-- identical and consist of a procedure that encloses and calls the
-- function that declares and initializes a record variable, Local.
-- The function returns the size of the record variable, although
-- this is not used in the evaluation.

procedure Srtea2 is


    type Enum is (Monday, Tuesday, Wednesday,
                  Thursday, Friday, Saturday, Sunday);
    type Fixed is delta 0.01 range -100.0 .. 100.0;
    subtype Int is Integer range -1000 .. 1000;

    type Representation_Record is

        record
            Enum_Comp : Enum := Enum'Last;
            Int_Comp : Int := Int'Last;
            Fixed_Comp : Fixed := 0.0;
            Bool_Comp : Boolean := True;
        end record;

    type Conventional_Record is

        record
            Enum_Comp : Enum := Enum'Last;
            Int_Comp : Int := Int'Last;
            Fixed_Comp : Fixed := 0.0;
            Bool_Comp : Boolean := True;
        end record;

    -- Representation clause is commented out because it is not
    -- currently supported by a validated compiler.

    --  Storage_Unit : constant := 8;
    --  Word         : constant POSITIVE := 2 * Storage_Unit;
    --
    --  for  REPRESENTATION_RECORD use
    --
    --    record at mod Storage_Unit;
    --      Enum_Comp  at 0 * Word range  0 .. 2;
    --      Int_Comp   at 0 * Word range  3 .. 14;
    --      Fixed_Comp at <storage allocated by compiler>
    --      Bool_Comp  at 1 * Word range 15 .. 15;
    --    end record;

    package New_Procs is new Procs (Boolean);
    use New_Procs;

    Local : Integer;

    function Elaborate_Record_Declaration return Integer is

        Local : Representation_Record;        -- included in test version
        --    Local : CONVENTIONAL_RECORD;          -- included in control version

    begin

        Let (Global, Ident (Global));
        return Local'Size;

    end Elaborate_Record_Declaration;

begin

    Start ("SRTEA2", "Simple Record Type Elaboration (test)");
    for I in 1 .. 10000 loop

        Local := Elaborate_Record_Declaration;
        Let (Global, Ident (Global));

    end loop;
    Stop;

end Srtea2;