OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c2/] [c250002.aw] - Diff between revs 294 and 338

Only display areas with differences | Details | Blame | View Log

Rev 294 Rev 338
-- C250002.AW
-- C250002.AW
--
--
--                             Grant of Unlimited Rights
--                             Grant of Unlimited Rights
--
--
--     Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--     Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--     F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--     F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--     unlimited rights in the software and documentation contained herein.
--     unlimited rights in the software and documentation contained herein.
--     Unlimited rights are defined in DFAR 252.227-7013(a)(19).  By making
--     Unlimited rights are defined in DFAR 252.227-7013(a)(19).  By making
--     this public release, the Government intends to confer upon all
--     this public release, the Government intends to confer upon all
--     recipients unlimited rights  equal to those held by the Government.
--     recipients unlimited rights  equal to those held by the Government.
--     These rights include rights to use, duplicate, release or disclose the
--     These rights include rights to use, duplicate, release or disclose the
--     released technical data and computer software in whole or in part, in
--     released technical data and computer software in whole or in part, in
--     any manner and for any purpose whatsoever, and to have or permit others
--     any manner and for any purpose whatsoever, and to have or permit others
--     to do so.
--     to do so.
--
--
--                                    DISCLAIMER
--                                    DISCLAIMER
--
--
--     ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--     ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--     DISCLOSED ARE AS IS.  THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--     DISCLOSED ARE AS IS.  THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--     WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--     WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--     SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--     SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--     OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--     OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--     PARTICULAR PURPOSE OF SAID MATERIAL.
--     PARTICULAR PURPOSE OF SAID MATERIAL.
--*
--*
--
--
-- OBJECTIVE:
-- OBJECTIVE:
--      Check that characters in Latin-1 above ASCII.Del can be used in
--      Check that characters in Latin-1 above ASCII.Del can be used in
--      identifiers, character literals and strings.
--      identifiers, character literals and strings.
--
--
-- TEST DESCRIPTION:
-- TEST DESCRIPTION:
--      This test utilizes the brackets scheme for representing Latin-1
--      This test utilizes the brackets scheme for representing Latin-1
--      character values in transportable 7 bit ASCII as proposed by
--      character values in transportable 7 bit ASCII as proposed by
--      Robert Dewar; this test defines Character and String objects,
--      Robert Dewar; this test defines Character and String objects,
--      assigns and tests several sample values.  Several Identifiers
--      assigns and tests several sample values.  Several Identifiers
--      used in this test also include Characters via the bracket escape
--      used in this test also include Characters via the bracket escape
--      sequence scheme.
--      sequence scheme.
--
--
--      Note that C250001 checks Wide_Characters and Wide_Strings.
--      Note that C250001 checks Wide_Characters and Wide_Strings.
--
--
-- SPECIAL REQUIREMENTS:
-- SPECIAL REQUIREMENTS:
--
--
--      This file must be preprocessed before it can be executed as a test.
--      This file must be preprocessed before it can be executed as a test.
--
--
--      This test requires that all occurrences of the bracket escaped
--      This test requires that all occurrences of the bracket escaped
--      characters be replaced with the corresponding 8 bit character.
--      characters be replaced with the corresponding 8 bit character.
--
--
--      Characters above ASCII.Del are represented by a 6 character sequence:
--      Characters above ASCII.Del are represented by a 6 character sequence:
--
--
--          ["xx"]
--          ["xx"]
--
--
--      where the character code represented is specified by two hexadecimal
--      where the character code represented is specified by two hexadecimal
--      digits () upper case. For example the Latin-1 character with the
--      digits () upper case. For example the Latin-1 character with the
--      code 16#AB# is represented by the six character sequence:
--      code 16#AB# is represented by the six character sequence:
--
--
--          ["AB"]
--          ["AB"]
--
--
--      None of the values used in this test should be interpreted as
--      None of the values used in this test should be interpreted as
--      a control character.
--      a control character.
--
--
--      The following function documents the translation algorithm:
--      The following function documents the translation algorithm:
--
--
--     function To_Char( S:String ) return Character is
--     function To_Char( S:String ) return Character is
--       Numerical : Natural := 0;
--       Numerical : Natural := 0;
--       type Xlate is array(Character range '0'..'F') of Natural;
--       type Xlate is array(Character range '0'..'F') of Natural;
--       Xlation : Xlate
--       Xlation : Xlate
--               := ('0' =>  0, '1' =>  1, '2' =>  2, '3' =>  3, '4' =>  4,
--               := ('0' =>  0, '1' =>  1, '2' =>  2, '3' =>  3, '4' =>  4,
--                   '5' =>  5, '6' =>  6, '7' =>  7, '8' =>  8, '9' =>  9,
--                   '5' =>  5, '6' =>  6, '7' =>  7, '8' =>  8, '9' =>  9,
--                   'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13, 'E' => 14,
--                   'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13, 'E' => 14,
--                   'F' => 15,  others => 0 );
--                   'F' => 15,  others => 0 );
--     begin
--     begin
--       for I in S'Range loop
--       for I in S'Range loop
--         Numerical := Numerical * 16 + Xlation(S(I));
--         Numerical := Numerical * 16 + Xlation(S(I));
--       end loop;
--       end loop;
--       return Character'Val(Numerical);
--       return Character'Val(Numerical);
--     end To_Char;
--     end To_Char;
--
--
--
--
-- CHANGE HISTORY:
-- CHANGE HISTORY:
--      10 JAN 96   SAIC   Initial version
--      10 JAN 96   SAIC   Initial version
--      12 NOV 96   SAIC   Changed file extension to .AW
--      12 NOV 96   SAIC   Changed file extension to .AW
--
--
--!
--!
----------------------------------------------------------------- C250002_0
----------------------------------------------------------------- C250002_0
package C250002_0 is
package C250002_0 is
  -- The extended characters used in this test start with
  -- The extended characters used in this test start with
  -- the character '["A1"]' 16#A1# and increase from there
  -- the character '["A1"]' 16#A1# and increase from there
  type Tagged_["C0"]_Id is tagged record
  type Tagged_["C0"]_Id is tagged record
    Length, Width: Natural;
    Length, Width: Natural;
  end record;
  end record;
  X_Char_A2 : constant Character := '["A2"]';
  X_Char_A2 : constant Character := '["A2"]';
  X_Char_A3_Through_A9 : constant String :=
  X_Char_A3_Through_A9 : constant String :=
               "["A3"]["A4"]["A5"]["A6"]["A7"]["A8"]["A9"]";
               "["A3"]["A4"]["A5"]["A6"]["A7"]["A8"]["A9"]";
  X_Char_AA_AB : constant String := "["AA"]["AB"]";
  X_Char_AA_AB : constant String := "["AA"]["AB"]";
end C250002_0;
end C250002_0;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- no package body C250002_0 is required or allowed
-- no package body C250002_0 is required or allowed
----------------------------------------------------------------- C250002_X
----------------------------------------------------------------- C250002_X
with Ada.Characters.Latin_1;
with Ada.Characters.Latin_1;
package C250002_["C1"] is
package C250002_["C1"] is
  type Enum is ( Item, 'A', '["AD"]', AE_["C6"]["E6"]_ae,
  type Enum is ( Item, 'A', '["AD"]', AE_["C6"]["E6"]_ae,
                 '["2D"]', '["FF"]' );
                 '["2D"]', '["FF"]' );
  task type C2_["C2"] is
  task type C2_["C2"] is
    entry C2_["C3"];
    entry C2_["C3"];
  end C2_["C2"];
  end C2_["C2"];
end C250002_["C1"];
end C250002_["C1"];
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
package body C250002_["C1"] is
package body C250002_["C1"] is
  task body C2_["C2"] is
  task body C2_["C2"] is
  begin
  begin
    accept C2_["C3"];
    accept C2_["C3"];
  end C2_["C2"];
  end C2_["C2"];
end C250002_["C1"];
end C250002_["C1"];
------------------------------------------------------------------- C250002
------------------------------------------------------------------- C250002
with Report;
with Report;
with C250002_0;
with C250002_0;
with C250002_["C1"];
with C250002_["C1"];
with Ada.Tags;
with Ada.Tags;
procedure C250002 is
procedure C250002 is
  use C250002_0;
  use C250002_0;
  My_Task: C250002_["C1"].C2_["C2"];
  My_Task: C250002_["C1"].C2_["C2"];
  function Hex( N: Natural ) return String is
  function Hex( N: Natural ) return String is
    S : String := "xx";
    S : String := "xx";
    T : String := "0123456789ABCDEF";
    T : String := "0123456789ABCDEF";
  begin
  begin
    S(1) := T(N  /  16 +1);
    S(1) := T(N  /  16 +1);
    S(2) := T(N mod 16 +1);
    S(2) := T(N mod 16 +1);
    return S;
    return S;
  end Hex;
  end Hex;
  procedure Match( Check : Character; Matching : Natural ) is
  procedure Match( Check : Character; Matching : Natural ) is
  begin
  begin
    if Check /= Character'Val( Matching ) then
    if Check /= Character'Val( Matching ) then
      Report.Failed( "Didn't match for " & Hex(Matching) );
      Report.Failed( "Didn't match for " & Hex(Matching) );
    end if;
    end if;
  end Match;
  end Match;
  type Value_List is array(Positive range <>) of Natural;
  type Value_List is array(Positive range <>) of Natural;
  procedure Match( Check : String; Matching : Value_List ) is
  procedure Match( Check : String; Matching : Value_List ) is
  begin
  begin
    if Check'Length /= Matching'Length then
    if Check'Length /= Matching'Length then
      Report.Failed( "Check'Length /= Matching'Length" );
      Report.Failed( "Check'Length /= Matching'Length" );
    else
    else
      for I in Check'Range loop
      for I in Check'Range loop
        Match( Check(I), Matching(I - Check'First + Matching'First) );
        Match( Check(I), Matching(I - Check'First + Matching'First) );
      end loop;
      end loop;
    end if;
    end if;
  end Match;
  end Match;
  TC_Count : Natural := 0;
  TC_Count : Natural := 0;
begin  -- Main test procedure.
begin  -- Main test procedure.
  Report.Test ("C250002", "Check that characters above ASCII.Del can be " &
  Report.Test ("C250002", "Check that characters above ASCII.Del can be " &
                          "used in identifiers, character literals and " &
                          "used in identifiers, character literals and " &
                          "strings" );
                          "strings" );
  Report.Comment( Ada.Tags.Expanded_Name(Tagged_["C0"]_Id'Tag) );
  Report.Comment( Ada.Tags.Expanded_Name(Tagged_["C0"]_Id'Tag) );
  for Specials in C250002_["C1"].Enum loop
  for Specials in C250002_["C1"].Enum loop
    TC_Count := TC_Count +1;
    TC_Count := TC_Count +1;
  end loop;
  end loop;
  if TC_Count /= 6 then
  if TC_Count /= 6 then
    Report.Failed("Expected 6 literals in Enum");
    Report.Failed("Expected 6 literals in Enum");
  end if;
  end if;
  Match( X_Char_A2, 16#A2# );
  Match( X_Char_A2, 16#A2# );
  Match(X_Char_A3_Through_A9,
  Match(X_Char_A3_Through_A9,
         (16#A3#,16#A4#,16#A5#,16#A6#,16#A7#,16#A8#,16#A9#) );
         (16#A3#,16#A4#,16#A5#,16#A6#,16#A7#,16#A8#,16#A9#) );
  -- check catenations
  -- check catenations
  Match( X_Char_A2 & X_Char_A2, (16#A2#,16#A2#) );
  Match( X_Char_A2 & X_Char_A2, (16#A2#,16#A2#) );
  Match( X_Char_A2 & X_Char_AA_AB, (16#A2#,16#AA#,16#AB#) );
  Match( X_Char_A2 & X_Char_AA_AB, (16#A2#,16#AA#,16#AB#) );
  Match( X_Char_AA_AB & X_Char_A2, (16#AA#,16#AB#,16#A2#) );
  Match( X_Char_AA_AB & X_Char_A2, (16#AA#,16#AB#,16#A2#) );
  Match( X_Char_AA_AB & X_Char_AA_AB,
  Match( X_Char_AA_AB & X_Char_AA_AB,
         (16#AA#,16#AB#,16#AA#,16#AB#) );
         (16#AA#,16#AB#,16#AA#,16#AB#) );
  My_Task.C2_["C3"];
  My_Task.C2_["C3"];
  Report.Result;
  Report.Result;
end C250002;
end C250002;
 
 

powered by: WebSVN 2.1.0

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