
-- 1: -- CXA4011.A
-- 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: --
-- 26: -- OBJECTIVE:
-- 27: --      Check that the subprograms defined in package Ada.Strings.Unbounded
-- 28: --      are available, and that they produce correct results. Specifically,
-- 29: --      check the subprograms To_Unbounded_String, "&", ">", "<", Element,
-- 30: --      Replace_Element, Count, Find_Token, Translate, Trim, Delete, and
-- 31: --      "*".
-- 32: --
-- 33: -- TEST DESCRIPTION:
-- 34: --      This test demonstrates the uses of many of the subprograms defined
-- 35: --      in package Ada.Strings.Unbounded for use with unbounded strings.
-- 36: --      The test simulates how unbounded strings could be processed in a
-- 37: --      user environment, using the subprograms provided in this package.
-- 38: --
-- 39: --      This test uses a variety of the subprograms defined in the unbounded
-- 40: --      string package in ways typical of common usage, with different
-- 41: --      combinations of available subprograms being used to accomplish
-- 42: --      similar unbounded string processing goals.
-- 43: --
-- 44: --
-- 45: -- CHANGE HISTORY:
-- 46: --      06 Dec 94   SAIC    ACVC 2.0
-- 47: --      27 Feb 95   SAIC    Test description modification.
-- 48: --      01 Nov 95   SAIC    Update and repair for ACVC 2.0.1.
-- 49: --
-- 50: --!

-- 51:

-- 52: with Report;

-- 53: with Ada.Strings.Maps;

-- 54: with Jwa.Strings;
with jwa;
with ada;
with ada.ada__strings;
with report;
with ada.ada__strings.ada__strings__maps;
with jwa.jwa__strings;
with ada.ada__tags;
with system.system__finalization_root;
with system.system__finalization_implementation;
with system;
with ada.ada__finalization.ada__finalization__list_controller;
with system.system__soft_links;
with system.system__standard_library;
with system.system__secondary_stack;
with interfaces;
with ada.ada__exceptions;
with system.system__storage_elements;
with system.system__img_int;
with system.system__concat_2;

-- 55:

-- 56: procedure Test_Jwa_CXA4011 is
procedure test_jwa_cxa4011 is
   test_block : label

-- 57: begin
begin

-- 58:

-- 59:    Report.Test ("CXA4011", "Check that the subprograms defined in "        &
   report.report__test ("CXA4011",

-- 60:                            "package Ada.Strings.Unbounded are available, " &
     "Check that the subprograms defined in package Ada.Strings.Unbounded are available, and that they produce correct results");

-- 61:                            "and that they produce correct results");

-- 62:

-- 63:    Test_Block:

-- 64:    declare
   test_block : declare
      M427b : system__secondary_stack__mark_id :=
        $system__secondary_stack__ss_mark;
      F9b : system__finalization_root__finalizable_ptr := null;
      procedure test_jwa_cxa4011__test_block___clean is
      begin
         system__soft_links__abort_defer.all;
         $system__finalization_implementation__finalize_list (F9b);
         $system__secondary_stack__ss_release (M427b);
         system__soft_links__abort_undefer.all;
         return;
      end test_jwa_cxa4011__test_block___clean;
   begin
      L48b : ada__finalization__list_controller__simple_list_controller;

-- 65:

-- 66:       package JS renames Jwa.Strings;
      $ada__finalization__list_controller__simple_list_controllerIP (
        L48b, P6s => true);
      $ada__finalization__initialize__2 (L48b);
      $system__finalization_implementation__attach_to_final_list (F9b,
        system__finalization_root__finalizable?(L48b), 1);
      F47b___XR_L48b___XEXRf : _renaming_type;
      F47b : system__finalization_root__finalizable_ptr renames L48b.f;
      L41b : ada__finalization__list_controller__simple_list_controller;
      $ada__finalization__list_controller__simple_list_controllerIP (
        L41b, P6s => true);
      $ada__finalization__initialize__2 (L41b);
      $system__finalization_implementation__attach_to_final_list (F9b,
        system__finalization_root__finalizable?(L41b), 1);
      F40b___XR_L41b___XEXRf : _renaming_type;
      F40b : system__finalization_root__finalizable_ptr renames L41b.f;
      L34b : ada__finalization__list_controller__simple_list_controller;
      $ada__finalization__list_controller__simple_list_controllerIP (
        L34b, P6s => true);
      $ada__finalization__initialize__2 (L34b);
      $system__finalization_implementation__attach_to_final_list (F9b,
        system__finalization_root__finalizable?(L34b), 1);
      F33b___XR_L34b___XEXRf : _renaming_type;
      F33b : system__finalization_root__finalizable_ptr renames L34b.f;
      L27b : ada__finalization__list_controller__simple_list_controller;
      $ada__finalization__list_controller__simple_list_controllerIP (
        L27b, P6s => true);
      $ada__finalization__initialize__2 (L27b);
      $system__finalization_implementation__attach_to_final_list (F9b,
        system__finalization_root__finalizable?(L27b), 1);
      F16b___XR_L27b___XEXRf : _renaming_type;
      F16b : system__finalization_root__finalizable_ptr renames L27b.f;
      L10b : ada__finalization__list_controller__simple_list_controller;
      $ada__finalization__list_controller__simple_list_controllerIP (
        L10b, P6s => true);
      $ada__finalization__initialize__2 (L10b);
      $system__finalization_implementation__attach_to_final_list (F9b,
        system__finalization_root__finalizable?(L10b), 1);
      F8b___XR_L10b___XEXRf : _renaming_type;
      F8b : system__finalization_root__finalizable_ptr renames L10b.f;
      js___XRP_jwa__strings___XE : _renaming_type;
      package js renames jwa.jwa__strings;

-- 67:       use Ada.Strings;
      use ada.ada__strings;

-- 68:       use type Maps.Character_Set;
      use type ada__strings__maps.ada__strings__maps__character_set;

-- 69:       use type JS.String_8;
      use type jwa__strings.jwa__strings__string_8;

-- 70:

-- 71:       Cad_String        : JS.String_8 :=

-- 72:                             JS.To_String_8("cad");
      type test_jwa_cxa4011__test_block__A5b is access all
        jwa__strings__string_8;
      freeze test_jwa_cxa4011__test_block__A5b []
      R6b : test_jwa_cxa4011__test_block__A5b := jwa__strings.
        jwa__strings__create__2 ("cad")'reference;
      $system__finalization_implementation__deep_tag_attach (F8b, R6b.all'
        address, 1);
      cad_string : jwa__strings.jwa__strings__string_8 := R6b.all;
      jwa__strings__adjust__2 (cad_string);
      $system__finalization_implementation__attach_to_final_list (F9b,
        system__finalization_root__finalizable?(cad_string), 1);
      $ada__finalization__list_controller__finalize (L10b);
      cad_string._tag := jwa__strings__string_8P;

-- 73:

-- 74:       Complete_String   : JS.String_8 :=

-- 75:                             JS.To_String_8("Incomplete") &
      type test_jwa_cxa4011__test_block__A13b is access all
        jwa__strings__string_8;
      freeze test_jwa_cxa4011__test_block__A13b []
      R14b : test_jwa_cxa4011__test_block__A13b := jwa__strings.
        jwa__strings__create__2 ("Incomplete")'reference;
      $system__finalization_implementation__deep_tag_attach (F16b, R14b.all'
        address, 1);
      type test_jwa_cxa4011__test_block__A17b is access all
        jwa__strings__string_8;
      freeze test_jwa_cxa4011__test_block__A17b []
      R18b : test_jwa_cxa4011__test_block__A17b :=
        jwa__strings__Oconcat__4 (R14b.all, ada.ada__strings.
        ada__strings__space)'reference;
      $system__finalization_implementation__deep_tag_attach (F16b, R18b.all'
        address, 1);

-- 76:                             Ada.Strings.Space &

-- 77:                             JS.To_String_8("String");
      type test_jwa_cxa4011__test_block__A21b is access all
        jwa__strings__string_8;
      freeze test_jwa_cxa4011__test_block__A21b []
      R22b : test_jwa_cxa4011__test_block__A21b := jwa__strings.
        jwa__strings__create__2 ("String")'reference;
      $system__finalization_implementation__deep_tag_attach (F16b, R22b.all'
        address, 1);
      type test_jwa_cxa4011__test_block__A24b is access all
        jwa__strings__string_8;
      freeze test_jwa_cxa4011__test_block__A24b []
      R25b : test_jwa_cxa4011__test_block__A24b :=
        jwa__strings__Oconcat (R18b.all, R22b.all)'reference;
      $system__finalization_implementation__deep_tag_attach (F16b, R25b.all'
        address, 1);
      complete_string : jwa__strings.jwa__strings__string_8 := R25b.all;
      jwa__strings__adjust__2 (complete_string);
      $system__finalization_implementation__attach_to_final_list (F9b,
        system__finalization_root__finalizable?(complete_string), 1);
      $ada__finalization__list_controller__finalize (L27b);
      complete_string._tag := jwa__strings__string_8P;

-- 78:

-- 79:       Incomplete_String  : JS.String_8 :=

-- 80:                              JS.To_String_8("ncomplete Strin");
      type test_jwa_cxa4011__test_block__A30b is access all
        jwa__strings__string_8;
      freeze test_jwa_cxa4011__test_block__A30b []
      R31b : test_jwa_cxa4011__test_block__A30b := jwa__strings.
        jwa__strings__create__2 ("ncomplete Strin")'reference;
      $system__finalization_implementation__deep_tag_attach (F33b, R31b.all'
        address, 1);
      incomplete_string : jwa__strings.jwa__strings__string_8 := R31b.all;
      jwa__strings__adjust__2 (incomplete_string);
      $system__finalization_implementation__attach_to_final_list (F9b,
        system__finalization_root__finalizable?(incomplete_string),
        1);
      $ada__finalization__list_controller__finalize (L34b);
      incomplete_string._tag := jwa__strings__string_8P;

-- 81:

-- 82:       Incorrect_Spelling : JS.String_8 :=

-- 83:                              JS.To_String_8("Guob Dai");
      type test_jwa_cxa4011__test_block__A37b is access all
        jwa__strings__string_8;
      freeze test_jwa_cxa4011__test_block__A37b []
      R38b : test_jwa_cxa4011__test_block__A37b := jwa__strings.
        jwa__strings__create__2 ("Guob Dai")'reference;
      $system__finalization_implementation__deep_tag_attach (F40b, R38b.all'
        address, 1);
      incorrect_spelling : jwa__strings.jwa__strings__string_8 := R38b.all;
      jwa__strings__adjust__2 (incorrect_spelling);
      $system__finalization_implementation__attach_to_final_list (F9b,
        system__finalization_root__finalizable?(incorrect_spelling),
        1);
      $ada__finalization__list_controller__finalize (L41b);
      incorrect_spelling._tag := jwa__strings__string_8P;

-- 84:

-- 85:       Magic_String       : JS.String_8 :=

-- 86:                              JS.To_String_8("abracadabra");
      type test_jwa_cxa4011__test_block__A44b is access all
        jwa__strings__string_8;
      freeze test_jwa_cxa4011__test_block__A44b []
      R45b : test_jwa_cxa4011__test_block__A44b := jwa__strings.
        jwa__strings__create__2 ("abracadabra")'reference;
      $system__finalization_implementation__deep_tag_attach (F47b, R45b.all'
        address, 1);
      magic_string : jwa__strings.jwa__strings__string_8 := R45b.all;
      jwa__strings__adjust__2 (magic_string);
      $system__finalization_implementation__attach_to_final_list (F9b,
        system__finalization_root__finalizable?(magic_string), 1);
      $ada__finalization__list_controller__finalize (L48b);
      magic_string._tag := jwa__strings__string_8P;
      incantation : jwa__strings.jwa__strings__string_8 := magic_string;

-- 87:

-- 88:       Incantation        : JS.String_8 := Magic_String;
      incantation._tag := jwa__strings__string_8P;
      jwa__strings__adjust__2 (incantation);
      $system__finalization_implementation__attach_to_final_list (F9b,
        system__finalization_root__finalizable?(incantation), 1);
      a_small_g : character := 'g';
      a_small_d : character := 'd';
      abcd_set : ada__strings__maps.ada__strings__maps__character_set :=
        ada__strings__maps.ada__strings__maps__to_set__3 ("abcd");
      b_set : ada__strings__maps.ada__strings__maps__character_set :=
        ada__strings__maps.ada__strings__maps__to_set__4 ('b');
      ab_set : ada__strings__maps.ada__strings__maps__character_set :=
        ada__strings__maps.Oor (ada__strings__maps.
        ada__strings__maps__to_set__4 ('a'), b_set);
      code_map : ada__strings__maps.
        ada__strings__maps__character_mapping := ada__strings__maps.
        ada__strings__maps__to_mapping (from => "abcd", to => "wxyz");
      reverse_code_map : ada__strings__maps.
        ada__strings__maps__character_mapping := ada__strings__maps.
        ada__strings__maps__to_mapping (from => "wxyz", to => "abcd");
      non_existent_map : ada__strings__maps.
        ada__strings__maps__character_mapping := ada__strings__maps.
        ada__strings__maps__to_mapping (from => "jkl", to => "mno");
      token_start : positive;
      token_end : natural := 0;
      matching_letters : natural := 0;
      trim_block : label
      constructor_block : label
      begin

-- 89:

-- 90:

-- 91:       A_Small_G : Character := 'g';

-- 92:       A_Small_D : Character := 'd';

-- 93:

-- 94:       ABCD_Set : Maps.Character_Set := Maps.To_Set("abcd");

-- 95:       B_Set    : Maps.Character_Set := Maps.To_Set('b');

-- 96:       AB_Set   : Maps.Character_Set := Maps."OR"(Maps.To_Set('a'), B_Set);

-- 97:

-- 98:       Code_Map         : Maps.Character_Mapping :=

-- 99:                            Maps.To_Mapping(From => "abcd", To => "wxyz");

-- 100:       Reverse_Code_Map : Maps.Character_Mapping :=

-- 101:                            Maps.To_Mapping(From => "wxyz", To => "abcd");

-- 102:       Non_Existent_Map : Maps.Character_Mapping :=

-- 103:                            Maps.To_Mapping(From => "jkl",  To => "mno");

-- 104:

-- 105:

-- 106:       Token_Start      : Positive;

-- 107:       Token_End        : Natural := 0;

-- 108:       Matching_Letters : Natural := 0;

-- 109:

-- 110:

-- 111:    begin

-- 112:
-- 113:       -- "&"

-- 114:
-- 115:       -- Prepend an 'I' and append a 'g' to the string.

-- 116:       Incomplete_String := JS."&"('I', Incomplete_String);  -- Char & Unb
         B56b : declare
            M62b : system__secondary_stack__mark_id :=
              $system__secondary_stack__ss_mark;
            F60b : system__finalization_root__finalizable_ptr := null;
            procedure test_jwa_cxa4011__test_block__B56b___clean is
            begin
               system__soft_links__abort_defer.all;
               $system__finalization_implementation__finalize_list (
                 F60b);
               $system__secondary_stack__ss_release (M62b);
               system__soft_links__abort_undefer.all;
               return;
            end test_jwa_cxa4011__test_block__B56b___clean;
         begin
            type test_jwa_cxa4011__test_block__B56b__A57b is access
              all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__B56b__A57b []
            R58b : test_jwa_cxa4011__test_block__B56b__A57b :=
              jwa__strings.Oconcat ('I', incomplete_string)'reference;
            $system__finalization_implementation__deep_tag_attach (F60b,
              R58b.all'address, 1);
            B61b : begin
               system__soft_links__abort_defer.all;
               jwa__strings___assign__2 (incomplete_string, R58b.all);
            at end
               system__standard_library__abort_undefer_direct;
            end B61b;
         at end
            test_jwa_cxa4011__test_block__B56b___clean;
         end B56b;

-- 117:       Incomplete_String := JS."&"(Incomplete_String,
         B63b : declare
            M69b : system__secondary_stack__mark_id :=
              $system__secondary_stack__ss_mark;
            F67b : system__finalization_root__finalizable_ptr := null;
            procedure test_jwa_cxa4011__test_block__B63b___clean is
            begin
               system__soft_links__abort_defer.all;
               $system__finalization_implementation__finalize_list (
                 F67b);
               $system__secondary_stack__ss_release (M69b);
               system__soft_links__abort_undefer.all;
               return;
            end test_jwa_cxa4011__test_block__B63b___clean;
         begin
            type test_jwa_cxa4011__test_block__B63b__A64b is access
              all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__B63b__A64b []
            R65b : test_jwa_cxa4011__test_block__B63b__A64b :=
              jwa__strings.Oconcat (incomplete_string, a_small_g)
              'reference;
            $system__finalization_implementation__deep_tag_attach (F67b,
              R65b.all'address, 1);
            B68b : begin
               system__soft_links__abort_defer.all;
               jwa__strings___assign__2 (incomplete_string, R65b.all);
            at end
               system__standard_library__abort_undefer_direct;
            end B68b;
         at end
            test_jwa_cxa4011__test_block__B63b___clean;
         end B63b;
         R70b : constant boolean := jwa__strings__Olt (
           incomplete_string, complete_string);

-- 118:                                      A_Small_G);               -- Unb & Char

-- 119:

-- 120:       if Incomplete_String  < Complete_String  or
         [constraint_error when
           not (interfaces__unsigned_32!(R70b) >=
             interfaces__unsigned_32!(false) and then
             interfaces__unsigned_32!(R70b) <= interfaces__unsigned_32!
             (true))
           "invalid data"]
         R71b : constant boolean := jwa__strings__Ogt (
           incomplete_string, complete_string);

-- 121:          Incomplete_String  > Complete_String  or
         [constraint_error when
           not (interfaces__unsigned_32!(R71b) >=
             interfaces__unsigned_32!(false) and then
             interfaces__unsigned_32!(R71b) <= interfaces__unsigned_32!
             (true))
           "invalid data"]
         if R70b or R71b or not (jwa__strings__Oeq (incomplete_string,
           complete_string)) then

-- 122:          Incomplete_String /= Complete_String

-- 123:       then

-- 124:          Report.Failed("Incorrect result from use of ""&"" operator");
            report.report__failed (
              "Incorrect result from use of ""&"" operator");

-- 125:       end if;
         end if;
         C73b : natural;

-- 126:

-- 127:
-- 128:       -- Element

-- 129:
-- 130:       -- Last element of the unbounded string should be a 'g'.

-- 131:       if JS.Element(Incomplete_String, JS.Length(Incomplete_String)) /=
         B75b : declare
            L74b : label
         begin
            if incomplete_string.ptr = null then
               C73b := 0;
               goto L74b;
            else
               R77b : jwa__strings__string_8_internal_ptr renames
                 incomplete_string.ptr;
               [constraint_error when
                 R77b = null
                 "access check failed"]
               R78b : constant natural := R77b.all.capacity;
               subtype test_jwa_cxa4011__test_block__B75b__S76b is
                 jwa__strings__string_8_data (R78b);
               R80b : jwa__strings__string_8_internal_ptr renames
                 incomplete_string.ptr;
               [constraint_error when
                 R80b = null
                 "access check failed"]
               [constraint_error when
                 not (interfaces__unsigned_32!(R80b.all.data.length) <=
                   16#7FFF_FFFF#)
                 "invalid data"]
               C73b := R80b.all.data.length;
               goto L74b;
            end if;
            <<L74b>>
         end B75b;
         [constraint_error when
           not (C73b >= 1)
           "range check failed"]
         if jwa__strings.jwa__strings__get (incomplete_string, C73b) /=
           a_small_g then

-- 132:          A_Small_G

-- 133:       then

-- 134:          Report.Failed("Incorrect result from use of Function Element - 1");
            report.report__failed (
              "Incorrect result from use of Function Element - 1");

-- 135:       end if;
         end if;
         E94b : boolean;

-- 136:

-- 137:       if JS.Element(Incomplete_String, 2)                 /=

-- 138:          JS.Element(JS.Tail(Incomplete_String, 2), 1)     or
         B82b : declare
            M95b : system__secondary_stack__mark_id :=
              $system__secondary_stack__ss_mark;
            F86b : system__finalization_root__finalizable_ptr := null;
            procedure test_jwa_cxa4011__test_block__B82b___clean is
            begin
               system__soft_links__abort_defer.all;
               $system__finalization_implementation__finalize_list (
                 F86b);
               $system__secondary_stack__ss_release (M95b);
               system__soft_links__abort_undefer.all;
               return;
            end test_jwa_cxa4011__test_block__B82b___clean;
         begin
            type test_jwa_cxa4011__test_block__B82b__A83b is access
              all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__B82b__A83b []
            R84b : test_jwa_cxa4011__test_block__B82b__A83b :=
              jwa__strings.jwa__strings__tail (incomplete_string, 2,
              pad => ada__strings__space)'reference;
            $system__finalization_implementation__deep_tag_attach (F86b,
              R84b.all'address, 1);

-- 139:          JS.Element(JS.Head(Incomplete_String, 4), 2)  /=
            type test_jwa_cxa4011__test_block__B82b__A87b is access
              all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__B82b__A87b []
            R88b : test_jwa_cxa4011__test_block__B82b__A87b :=
              jwa__strings.jwa__strings__head (incomplete_string, 4,
              pad => ada__strings__space)'reference;
            $system__finalization_implementation__deep_tag_attach (F86b,
              R88b.all'address, 1);

-- 140:          JS.Element(JS.To_String_8("wnqz"), 2)
            type test_jwa_cxa4011__test_block__B82b__A91b is access
              all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__B82b__A91b []
            R92b : test_jwa_cxa4011__test_block__B82b__A91b :=
              jwa__strings.jwa__strings__create__2 ("wnqz")'reference;
            $system__finalization_implementation__deep_tag_attach (F86b,
              R92b.all'address, 1);
            E94b := jwa__strings.jwa__strings__get (incomplete_string,
              2) /= jwa__strings.jwa__strings__get (R84b.all, 1) or
              jwa__strings.jwa__strings__get (R88b.all, 2) /=
              jwa__strings.jwa__strings__get (R92b.all, 2);
         at end
            test_jwa_cxa4011__test_block__B82b___clean;
         end B82b;
         if E94b then

-- 141:       then

-- 142:          Report.Failed("Incorrect result from use of Function Element - 2");
            report.report__failed (
              "Incorrect result from use of Function Element - 2");

-- 143:       end if;
         end if;

-- 144:

-- 145:
-- 146:       -- Replace_Element

-- 147:
-- 148:       -- The unbounded string Incorrect_Spelling starts as "Guob Dai", and
-- 149:       -- is transformed by the following three procedure calls to "Good Day".

-- 150:

-- 151:       JS.Replace_Element(Incorrect_Spelling, 2, 'o');
         jwa__strings.jwa__strings__set__4 (incorrect_spelling, 2, 'o');
         R97b : constant natural := jwa__strings.jwa__strings__index__3
           (incorrect_spelling, b_set, test => ada__strings__inside,
           going => ada__strings__forward);

-- 152:

-- 153:       JS.Replace_Element(Incorrect_Spelling,

-- 154:                             JS.Index(Incorrect_Spelling, B_Set),
         [constraint_error when
           not (R97b >= 1)
           "range check failed"]
         jwa__strings.jwa__strings__set__4 (incorrect_spelling, R97b,
           a_small_d);
         C98b : natural;

-- 155:                             A_Small_D);

-- 156:

-- 157:       JS.Replace_Element(Source => Incorrect_Spelling,

-- 158:                             Index  => JS.Length(Incorrect_Spelling),
         B100b : declare
            L99b : label
         begin
            if incorrect_spelling.ptr = null then
               C98b := 0;
               goto L99b;
            else
               R102b : jwa__strings__string_8_internal_ptr renames
                 incorrect_spelling.ptr;
               [constraint_error when
                 R102b = null
                 "access check failed"]
               R103b : constant natural := R102b.all.capacity;
               subtype test_jwa_cxa4011__test_block__B100b__S101b is
                 jwa__strings__string_8_data (R103b);
               R105b : jwa__strings__string_8_internal_ptr renames
                 incorrect_spelling.ptr;
               [constraint_error when
                 R105b = null
                 "access check failed"]
               [constraint_error when
                 not (interfaces__unsigned_32!(R105b.all.data.length) <=
                   16#7FFF_FFFF#)
                 "invalid data"]
               C98b := R105b.all.data.length;
               goto L99b;
            end if;
            <<L99b>>
         end B100b;
         [constraint_error when
           not (C98b >= 1)
           "range check failed"]
         jwa__strings.jwa__strings__set__4 (source =>
           incorrect_spelling, index => C98b, by => 'y');
         E112b : boolean;

-- 159:                             By     => 'y');

-- 160:

-- 161:       if Incorrect_Spelling /= JS.To_String_8("Good Day") then
         B106b : declare
            M113b : system__secondary_stack__mark_id :=
              $system__secondary_stack__ss_mark;
            F111b : system__finalization_root__finalizable_ptr := null;
            procedure test_jwa_cxa4011__test_block__B106b___clean is
            begin
               system__soft_links__abort_defer.all;
               $system__finalization_implementation__finalize_list (
                 F111b);
               $system__secondary_stack__ss_release (M113b);
               system__soft_links__abort_undefer.all;
               return;
            end test_jwa_cxa4011__test_block__B106b___clean;
         begin
            type test_jwa_cxa4011__test_block__B106b__A108b is access
              all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__B106b__A108b []
            R109b : test_jwa_cxa4011__test_block__B106b__A108b :=
              jwa__strings.jwa__strings__create__2 ("Good Day")
              'reference;
            $system__finalization_implementation__deep_tag_attach (
              F111b, R109b.all'address, 1);
            E112b := not (jwa__strings__Oeq (incorrect_spelling, R109b.all));
         at end
            test_jwa_cxa4011__test_block__B106b___clean;
         end B106b;
         if E112b then

-- 162:          Report.Failed("Incorrect result from Procedure Replace_Element");
            report.report__failed (
              "Incorrect result from Procedure Replace_Element");

-- 163:       end if;
         end if;
         R115b : constant natural := jwa__strings.
           jwa__strings__count__3 (source => magic_string, set =>
           abcd_set);

-- 164:

-- 165:
-- 166:       -- Count

-- 167:
-- 168:       -- Determine the number of characters in the unbounded string that
-- 169:       -- are contained in the set.

-- 170:

-- 171:       Matching_Letters := JS.Count(Source => Magic_String,
         [constraint_error when
           not (interfaces__unsigned_32!(R115b) <= 16#7FFF_FFFF#)
           "invalid data"]
         matching_letters := R115b;

-- 172:                                       Set    => ABCD_Set);

-- 173:

-- 174:       if Matching_Letters /= 9 then
         if matching_letters /= 9 then

-- 175:          Report.Failed
            report.report__failed (

-- 176:             ("Incorrect result from Function Count with Set parameter");
              "Incorrect result from Function Count with Set parameter");

-- 177:       end if;
         end if;
         R120b : constant natural := jwa__strings.jwa__strings__count (
           magic_string, "ac", mapping => ada__strings__maps.
           ada__strings__maps__identity);

-- 178:
-- 179:       -- Determine the number of occurrences of the following pattern strings
-- 180:       -- in the unbounded string Magic_String.

-- 181:

-- 182:       if JS.Count(Magic_String, "ab") /=

-- 183:          (JS.Count(Magic_String, "ac") + JS.Count(Magic_String, "ad")) or
         [constraint_error when
           not (interfaces__unsigned_32!(R120b) <= 16#7FFF_FFFF#)
           "invalid data"]
         R121b : constant natural := jwa__strings.jwa__strings__count (
           magic_string, "ad", mapping => ada__strings__maps.
           ada__strings__maps__identity);
         [constraint_error when
           not (interfaces__unsigned_32!(R121b) <= 16#7FFF_FFFF#)
           "invalid data"]
         R122b : constant natural := jwa__strings.jwa__strings__count (
           magic_string, "ab", mapping => ada__strings__maps.
           ada__strings__maps__identity);
         [constraint_error when
           not (interfaces__unsigned_32!(R122b) <= 16#7FFF_FFFF#)
           "invalid data"]
         R124b : constant natural := jwa__strings.jwa__strings__count (
           magic_string, "ab", mapping => ada__strings__maps.
           ada__strings__maps__identity);

-- 184:          JS.Count(Magic_String, "ab") /= 2
         [constraint_error when
           not (interfaces__unsigned_32!(R124b) <= 16#7FFF_FFFF#)
           "invalid data"]
         if R122b /= (R120b {+} R121b) or R124b /= 2 then

-- 185:       then

-- 186:          Report.Failed
            report.report__failed (

-- 187:             ("Incorrect result from Function Count with String parameter");
              "Incorrect result from Function Count with String parameter");

-- 188:       end if;
         end if;

-- 189:

-- 190:
-- 191:       -- Find_Token

-- 192:

-- 193:       JS.Find_Token(Magic_String,      -- Find location of first "ab".
         jwa__strings.jwa__strings__find_token (magic_string, ab_set,
           ada.ada__strings.ada__strings__inside, token_start,
           token_end);
         E128b : boolean;

-- 194:                        AB_Set,            -- Should be (1..2).

-- 195:                        Ada.Strings.Inside,

-- 196:                        Token_Start,

-- 197:                        Token_End);

-- 198:

-- 199:       if Natural(Token_Start) /= JS.To_String(Magic_String)'First  or
         B126b : declare
         begin
            [constraint_error when
              not (interfaces__unsigned_32!(token_start) >= 1 and then
                interfaces__unsigned_32!(token_start) <=
                16#7FFF_FFFF#)
              "invalid data"]
            [constraint_error when
              not (interfaces__unsigned_32!(token_start) >= 1 and then
                interfaces__unsigned_32!(token_start) <=
                16#7FFF_FFFF#)
              "invalid data"]

-- 200:          Token_End            /= JS.Index(Magic_String, B_Set)
            [constraint_error when
              not (interfaces__unsigned_32!(token_end) <=
                16#7FFF_FFFF#)
              "invalid data"]
            R127b : constant natural := jwa__strings.
              jwa__strings__index__3 (magic_string, b_set, test =>
              ada__strings__inside, going => ada__strings__forward);
            [constraint_error when
              not (interfaces__unsigned_32!(R127b) <= 16#7FFF_FFFF#)
              "invalid data"]
            E128b := natural(token_start) /= jwa__strings.
              jwa__strings__to_ada (magic_string)'first or token_end /=
              R127b;
         end B126b;
         if E128b then

-- 201:       then

-- 202:          Report.Failed("Incorrect result from Procedure Find_Token - 1");
            report.report__failed (
              "Incorrect result from Procedure Find_Token - 1");

-- 203:       end if;
         end if;

-- 204:

-- 205:

-- 206:       JS.Find_Token(Source => Magic_String, -- Find location of char 'r'
         jwa__strings.jwa__strings__find_token (source => magic_string,
           set => abcd_set, test => ada.ada__strings.
           ada__strings__outside, first => token_start, last =>
           token_end);

-- 207:                        Set    => ABCD_Set,     -- in string, should be (3..3)

-- 208:                        Test   => Ada.Strings.Outside,

-- 209:                        First  => Token_Start,

-- 210:                        Last   => Token_End);

-- 211:

-- 212:       if Natural(Token_Start) /= 3 or
         [constraint_error when
           not (interfaces__unsigned_32!(token_start) >= 1 and then
             interfaces__unsigned_32!(token_start) <= 16#7FFF_FFFF#)
           "invalid data"]
         [constraint_error when
           not (interfaces__unsigned_32!(token_start) >= 1 and then
             interfaces__unsigned_32!(token_start) <= 16#7FFF_FFFF#)
           "invalid data"]

-- 213:          Token_End            /= 3 then
         [constraint_error when
           not (interfaces__unsigned_32!(token_end) <= 16#7FFF_FFFF#)
           "invalid data"]
         if natural(token_start) /= 3 or token_end /= 3 then

-- 214:          Report.Failed("Incorrect result from Procedure Find_Token - 2");
            report.report__failed (
              "Incorrect result from Procedure Find_Token - 2");

-- 215:       end if;
         end if;

-- 216:

-- 217:

-- 218:       JS.Find_Token(Magic_String,           -- No 'g' is in the string, so
         jwa__strings.jwa__strings__find_token (magic_string,
           ada__strings__maps.ada__strings__maps__to_set__4 (a_small_g),
           ada.ada__strings.ada__strings__inside, first => token_start,
           last => token_end);
         E132b : boolean;

-- 219:                        Maps.To_Set(A_Small_G), -- the result parameters should

-- 220:                        Ada.Strings.Inside,     -- be First = Source'First and

-- 221:                        First => Token_Start,   -- Last = 0.

-- 222:                        Last  => Token_End);

-- 223:

-- 224:       if Token_Start /= JS.To_String(Magic_String)'First  or
         B131b : declare
         begin
            [constraint_error when
              not (interfaces__unsigned_32!(token_start) >= 1 and then
                interfaces__unsigned_32!(token_start) <=
                16#7FFF_FFFF#)
              "invalid data"]

-- 225:          Token_End   /= 0
            [constraint_error when
              not (interfaces__unsigned_32!(token_end) <=
                16#7FFF_FFFF#)
              "invalid data"]
            E132b := token_start /= jwa__strings.jwa__strings__to_ada (
              magic_string)'first or token_end /= 0;
         end B131b;
         if E132b then

-- 226:       then

-- 227:          Report.Failed("Incorrect result from Procedure Find_Token - 3");
            report.report__failed (
              "Incorrect result from Procedure Find_Token - 3");

-- 228:       end if;
         end if;

-- 229:

-- 230:
-- 231:       -- Translate

-- 232:
-- 233:       -- Use a mapping ("abcd" -> "wxyz") to transform the contents of
-- 234:       -- the unbounded string.
-- 235:       -- Magic_String = "abracadabra"

-- 236:

-- 237:       Incantation := JS.Translate(Magic_String, Code_Map);
         B134b : declare
            M140b : system__secondary_stack__mark_id :=
              $system__secondary_stack__ss_mark;
            F138b : system__finalization_root__finalizable_ptr := null;
            procedure test_jwa_cxa4011__test_block__B134b___clean is
            begin
               system__soft_links__abort_defer.all;
               $system__finalization_implementation__finalize_list (
                 F138b);
               $system__secondary_stack__ss_release (M140b);
               system__soft_links__abort_undefer.all;
               return;
            end test_jwa_cxa4011__test_block__B134b___clean;
         begin
            type test_jwa_cxa4011__test_block__B134b__A135b is access
              all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__B134b__A135b []
            R136b : test_jwa_cxa4011__test_block__B134b__A135b :=
              jwa__strings.jwa__strings__translate (magic_string,
              code_map)'reference;
            $system__finalization_implementation__deep_tag_attach (
              F138b, R136b.all'address, 1);
            B139b : begin
               system__soft_links__abort_defer.all;
               jwa__strings___assign__2 (incantation, R136b.all);
            at end
               system__standard_library__abort_undefer_direct;
            end B139b;
         at end
            test_jwa_cxa4011__test_block__B134b___clean;
         end B134b;
         E147b : boolean;

-- 238:

-- 239:       if Incantation /= JS.To_String_8("wxrwywzwxrw") then
         B141b : declare
            M148b : system__secondary_stack__mark_id :=
              $system__secondary_stack__ss_mark;
            F146b : system__finalization_root__finalizable_ptr := null;
            procedure test_jwa_cxa4011__test_block__B141b___clean is
            begin
               system__soft_links__abort_defer.all;
               $system__finalization_implementation__finalize_list (
                 F146b);
               $system__secondary_stack__ss_release (M148b);
               system__soft_links__abort_undefer.all;
               return;
            end test_jwa_cxa4011__test_block__B141b___clean;
         begin
            type test_jwa_cxa4011__test_block__B141b__A143b is access
              all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__B141b__A143b []
            R144b : test_jwa_cxa4011__test_block__B141b__A143b :=
              jwa__strings.jwa__strings__create__2 ("wxrwywzwxrw")
              'reference;
            $system__finalization_implementation__deep_tag_attach (
              F146b, R144b.all'address, 1);
            E147b := not (jwa__strings__Oeq (incantation, R144b.all));
         at end
            test_jwa_cxa4011__test_block__B141b___clean;
         end B141b;
         if E147b then

-- 240:          Report.Failed("Incorrect result from Function Translate");
            report.report__failed (
              "Incorrect result from Function Translate");

-- 241:       end if;
         end if;

-- 242:
-- 243:       -- Use the inverse mapping of the one above to return the "translated"
-- 244:       -- unbounded string to its original form.

-- 245:

-- 246:       JS.Translate(Incantation, Reverse_Code_Map);
         jwa__strings.jwa__strings__translate__2 (incantation,
           reverse_code_map);
         E155b : boolean;

-- 247:
-- 248:       -- The map contained in the following call to Translate contains one
-- 249:       -- element, and this element is not found in the unbounded string, so
-- 250:       -- this call to Translate should have no effect on the unbounded string.

-- 251:

-- 252:       if Incantation /= JS.Translate(Magic_String, Non_Existent_Map) then
         B150b : declare
            M156b : system__secondary_stack__mark_id :=
              $system__secondary_stack__ss_mark;
            F154b : system__finalization_root__finalizable_ptr := null;
            procedure test_jwa_cxa4011__test_block__B150b___clean is
            begin
               system__soft_links__abort_defer.all;
               $system__finalization_implementation__finalize_list (
                 F154b);
               $system__secondary_stack__ss_release (M156b);
               system__soft_links__abort_undefer.all;
               return;
            end test_jwa_cxa4011__test_block__B150b___clean;
         begin
            type test_jwa_cxa4011__test_block__B150b__A151b is access
              all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__B150b__A151b []
            R152b : test_jwa_cxa4011__test_block__B150b__A151b :=
              jwa__strings.jwa__strings__translate (magic_string,
              non_existent_map)'reference;
            $system__finalization_implementation__deep_tag_attach (
              F154b, R152b.all'address, 1);
            E155b := not (jwa__strings__Oeq (incantation, R152b.all));
         at end
            test_jwa_cxa4011__test_block__B150b___clean;
         end B150b;
         if E155b then

-- 253:          Report.Failed("Incorrect result from Procedure Translate");
            report.report__failed (
              "Incorrect result from Procedure Translate");

-- 254:       end if;
         end if;

-- 255:

-- 256:
-- 257:       -- Trim

-- 258:

-- 259:       Trim_Block:

-- 260:       declare
         trim_block : declare
            M342b : system__secondary_stack__mark_id :=
              $system__secondary_stack__ss_mark;
            F166b : system__finalization_root__finalizable_ptr := null;
            procedure test_jwa_cxa4011__test_block__trim_block___clean is
            begin
               system__soft_links__abort_defer.all;
               $system__finalization_implementation__finalize_list (
                 F166b);
               $system__secondary_stack__ss_release (M342b);
               system__soft_links__abort_undefer.all;
               return;
            end test_jwa_cxa4011__test_block__trim_block___clean;
         begin
            L301b :
              ada__finalization__list_controller__simple_list_controller;

-- 261:

-- 262:          XYZ_Set     : Maps.Character_Set := Maps.To_Set("xyz");

              $
              ada__finalization__list_controller__simple_list_controllerIP
              (L301b, P6s => true);
            $ada__finalization__initialize__2 (L301b);
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(L301b),
              1);
            F281b___XR_L301b___XEXRf : _renaming_type;
            F281b : system__finalization_root__finalizable_ptr renames
              L301b.f;
            L235b :
              ada__finalization__list_controller__simple_list_controller;

              $
              ada__finalization__list_controller__simple_list_controllerIP
              (L235b, P6s => true);
            $ada__finalization__initialize__2 (L235b);
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(L235b),
              1);
            F220b___XR_L235b___XEXRf : _renaming_type;
            F220b : system__finalization_root__finalizable_ptr renames
              L235b.f;
            L174b :
              ada__finalization__list_controller__simple_list_controller;

              $
              ada__finalization__list_controller__simple_list_controllerIP
              (L174b, P6s => true);
            $ada__finalization__initialize__2 (L174b);
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(L174b),
              1);
            F173b___XR_L174b___XEXRf : _renaming_type;
            F173b : system__finalization_root__finalizable_ptr renames
              L174b.f;
            L167b :
              ada__finalization__list_controller__simple_list_controller;

              $
              ada__finalization__list_controller__simple_list_controllerIP
              (L167b, P6s => true);
            $ada__finalization__initialize__2 (L167b);
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(L167b),
              1);
            F165b___XR_L167b___XEXRf : _renaming_type;
            F165b : system__finalization_root__finalizable_ptr renames
              L167b.f;
            xyz_set : ada__strings__maps.
              ada__strings__maps__character_set := ada__strings__maps.
              ada__strings__maps__to_set__3 ("xyz");
            pqr_set : ada__strings__maps.
              ada__strings__maps__character_set := ada__strings__maps.
              ada__strings__maps__to_set__3 ("pqr");

-- 263:          PQR_Set     : Maps.Character_Set := Maps.To_Set("pqr");

-- 264:

-- 265:          Pad         : constant JS.String_8 :=

-- 266:                                   JS.To_String_8("Pad");
            type test_jwa_cxa4011__test_block__trim_block__A162b is
              access all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__trim_block__A162b []
            R163b : test_jwa_cxa4011__test_block__trim_block__A162b :=
              jwa__strings.jwa__strings__create__2 ("Pad")'reference;
            $system__finalization_implementation__deep_tag_attach (
              F165b, R163b.all'address, 1);
            pad : constant jwa__strings.jwa__strings__string_8 := R163b.all;
            jwa__strings__adjust__2 (pad);
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(pad),
              1);
            $ada__finalization__list_controller__finalize (L167b);
            pad._tag := jwa__strings__string_8P;

-- 267:

-- 268:          The_New_Ada : constant JS.String_8 :=

-- 269:                                   JS.To_String_8("Ada9X");
            type test_jwa_cxa4011__test_block__trim_block__A170b is
              access all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__trim_block__A170b []
            R171b : test_jwa_cxa4011__test_block__trim_block__A170b :=
              jwa__strings.jwa__strings__create__2 ("Ada9X")'reference;
            $system__finalization_implementation__deep_tag_attach (
              F173b, R171b.all'address, 1);
            the_new_ada : constant jwa__strings.jwa__strings__string_8 :=
              R171b.all;
            jwa__strings__adjust__2 (the_new_ada);
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(
              the_new_ada), 1);
            $ada__finalization__list_controller__finalize (L174b);
            the_new_ada._tag := jwa__strings__string_8P;

-- 270:

-- 271:          Space_Array : array (1..4) of JS.String_8 :=
            [type
              test_jwa_cxa4011__test_block__trim_block__Tspace_arrayB is array (
              1 .. 4 range <>) of jwa__strings__string_8]
            freeze
              test_jwa_cxa4011__test_block__trim_block__Tspace_arrayB [
               procedure
                 test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBDI
                 (l : in out system__finalization_root__finalizable_ptr;
                 v : in out
                 test_jwa_cxa4011__test_block__trim_block__Tspace_arrayB;
                 b : short_short_integer) is
                  subtype
                    test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBDI__S186b is
                    test_jwa_cxa4011__test_block__trim_block__Tspace_arrayB
                    (v'first(1) .. v'last(1));
               begin
                  for J1 in v'first(1) .. v'last(1) loop
                     $ada__finalization__initialize (v (J1));

                       $
                       system__finalization_implementation__attach_to_final_list
                       (l, system__finalization_root__finalizable?(v (
                       J1)), b);
                  end loop;
                  return;
               end
                 test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBDI;
               procedure
                 test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBDA
                 (l : in out system__finalization_root__finalizable_ptr;
                 v : in out
                 test_jwa_cxa4011__test_block__trim_block__Tspace_arrayB;
                 b : short_short_integer) is
                  subtype
                    test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBDA__S189b is
                    test_jwa_cxa4011__test_block__trim_block__Tspace_arrayB
                    (v'first(1) .. v'last(1));
               begin
                  for J1 in v'first(1) .. v'last(1) loop
                     jwa__strings__adjust__2 (v (J1));

                       $
                       system__finalization_implementation__attach_to_final_list
                       (l, system__finalization_root__finalizable?(v (
                       J1)), b);
                  end loop;
                  return;
               exception
                  when others =>
                     system__soft_links__abort_undefer.all;
                     B193b : declare
                        e : ada__exceptions__exception_occurrence;
                     begin
                        $ada__exceptions__save_occurrence (e,
                          system__soft_links__get_current_excep.all.all);

                          $
                          ada__exceptions__raise_from_controlled_operation
                          (e);
                     end B193b;
                     return;
               end
                 test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBDA;
               procedure
                 test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBDF
                 (v : in out
                 test_jwa_cxa4011__test_block__trim_block__Tspace_arrayB;
                 b : boolean) is
                  subtype
                    test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBDF__S194b is
                    test_jwa_cxa4011__test_block__trim_block__Tspace_arrayB
                    (v'first(1) .. v'last(1));
               begin
                  for J1 in reverse v'first(1) .. v'last(1) loop
                     if b then

                          $
                          system__finalization_implementation__finalize_one
                          (system__finalization_root__finalizable?(v (
                          J1)));
                     else
                        jwa__strings__finalize__2 (v (J1));
                     end if;
                  end loop;
                  return;
               exception
                  when others =>
                     system__soft_links__abort_undefer.all;
                     B198b : declare
                        e : ada__exceptions__exception_occurrence;
                     begin
                        $ada__exceptions__save_occurrence (e,
                          system__soft_links__get_current_excep.all.all);

                          $
                          ada__exceptions__raise_from_controlled_operation
                          (e);
                     end B198b;
                     return;
               end
                 test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBDF;
               procedure
                 test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBSA
                 (A177b : out
                 test_jwa_cxa4011__test_block__trim_block__Tspace_arrayB;
                 R178b :
                 test_jwa_cxa4011__test_block__trim_block__Tspace_arrayB;
                 L179b : integer; L180b : integer; R181b : integer;
                 R182b : integer; D183b : boolean) is
                  subtype
                    test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBSA__S200b is
                    test_jwa_cxa4011__test_block__trim_block__Tspace_arrayB
                    (R178b'first(1) .. R178b'last(1));
                  subtype
                    test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBSA__S199b is
                    test_jwa_cxa4011__test_block__trim_block__Tspace_arrayB
                    (A177b'first(1) .. A177b'last(1));
                  L184b : integer;
                  R185b : integer;
               begin
                  if L180b < L179b then
                     return;
                  end if;
                  if D183b then
                     L184b := L180b;
                     R185b := R182b;
                  else
                     L184b := L179b;
                     R185b := R181b;
                  end if;
                  loop
                     L202b__B207b : begin
                        system__soft_links__abort_defer.all;
                        B208b : begin
                           if not (A177b (L184b)'address = R178b (R185b)'
                             address) then
                              jwa__strings__finalize__2 (A177b (L184b));
                              A203b : ada__tags__tag := A177b (L184b).
                                _tag;
                              subtype
                                test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBSA__L202b__B207b__B208b__G204b is
                                system__storage_elements__storage_offset
                                range 1 .. (jwa__strings__string_8'size +
                                7) / 8;
                              subtype
                                test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBSA__L202b__B207b__B208b__S205b is
                                system__storage_elements__storage_array
                                (
                                test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBSA__L202b__B207b__B208b__G204b);
                              type
                                test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBSA__L202b__B207b__B208b__A206b
                                is access
                                test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBSA__L202b__B207b__B208b__S205b;
                              freeze
                                test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBSA__L202b__B207b__B208b__A206b []

                                test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBSA__L202b__B207b__B208b__A206b!
                                (A177b (L184b)'address).all (1 +
                                system__finalization_root__root_controlled'
                                size / 8 ..
                                test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBSA__L202b__B207b__B208b__G204b'
                                last) :=
                                test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBSA__L202b__B207b__B208b__A206b!
                                (R178b (R185b)'address).all (1 +
                                system__finalization_root__root_controlled'
                                size / 8 ..
                                test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBSA__L202b__B207b__B208b__G204b'
                                last);
                              A177b (L184b)._tag := A203b;
                              jwa__strings__adjust__2 (A177b (L184b));
                              null;
                           end if;
                        exception
                           when others =>
                              system__soft_links__abort_undefer.all;
                              B214b : declare
                                 e :
                                   ada__exceptions__exception_occurrence;
                              begin
                                 $ada__exceptions__save_occurrence (e,
                                   system__soft_links__get_current_excep.all.all);

                                   $
                                   ada__exceptions__raise_from_controlled_operation
                                   (e);
                              end B214b;
                        end B208b;
                     at end
                        system__standard_library__abort_undefer_direct;
                     end L202b__B207b;
                     if D183b then
                        exit when L184b = L179b;
                        L184b := integer'pred(L184b);
                        R185b := integer'pred(R185b);
                     else
                        exit when L184b = L180b;
                        L184b := integer'succ(L184b);
                        R185b := integer'succ(R185b);
                     end if;
                  end loop;
                  return;
               end
                 test_jwa_cxa4011__test_block__trim_block__Tspace_arrayBSA;
            ]
            [subtype
              test_jwa_cxa4011__test_block__trim_block__Tspace_arrayT is
              test_jwa_cxa4011__test_block__trim_block__Tspace_arrayB (
              1 .. 4)]
            freeze
              test_jwa_cxa4011__test_block__trim_block__Tspace_arrayT []

-- 272:                          (JS.To_String_8("  Pad    "),
            type test_jwa_cxa4011__test_block__trim_block__A217b is
              access all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__trim_block__A217b []
            R218b : test_jwa_cxa4011__test_block__trim_block__A217b :=
              jwa__strings.jwa__strings__create__2 ("  Pad    ")
              'reference;
            $system__finalization_implementation__deep_tag_attach (
              F220b, R218b.all'address, 1);

-- 273:                           JS.To_String_8("Pad   "),
            type test_jwa_cxa4011__test_block__trim_block__A222b is
              access all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__trim_block__A222b []
            R223b : test_jwa_cxa4011__test_block__trim_block__A222b :=
              jwa__strings.jwa__strings__create__2 ("Pad   ")'reference;
            $system__finalization_implementation__deep_tag_attach (
              F220b, R223b.all'address, 1);

-- 274:                           JS.To_String_8("     Pad"),
            type test_jwa_cxa4011__test_block__trim_block__A226b is
              access all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__trim_block__A226b []
            R227b : test_jwa_cxa4011__test_block__trim_block__A226b :=
              jwa__strings.jwa__strings__create__2 ("     Pad")
              'reference;
            $system__finalization_implementation__deep_tag_attach (
              F220b, R227b.all'address, 1);
            null;
            space_array : array (1 .. 4) of jwa__strings.
              jwa__strings__string_8 := (R218b.all, R223b.all, R227b.all,
              pad);
            B231b : begin
               space_array (1) := R218b.all;
            end B231b;
            space_array (1)._tag := jwa__strings__string_8P;
            jwa__strings__adjust__2 (space_array (1));
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(
              space_array (1)), 1);
            B232b : begin
               space_array (2) := R223b.all;
            end B232b;
            space_array (2)._tag := jwa__strings__string_8P;
            jwa__strings__adjust__2 (space_array (2));
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(
              space_array (2)), 1);
            B233b : begin
               space_array (3) := R227b.all;
            end B233b;
            space_array (3)._tag := jwa__strings__string_8P;
            jwa__strings__adjust__2 (space_array (3));
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(
              space_array (3)), 1);
            B234b : begin
               space_array (4) := pad;
            end B234b;
            space_array (4)._tag := jwa__strings__string_8P;
            jwa__strings__adjust__2 (space_array (4));
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(
              space_array (4)), 1);
            $ada__finalization__list_controller__finalize (L235b);

-- 275:                           Pad);

-- 276:

-- 277:          String_Array : array (1..5) of JS.String_8 :=
            [type
              test_jwa_cxa4011__test_block__trim_block__Tstring_arrayB is array (
              1 .. 5 range <>) of jwa__strings__string_8]
            freeze
              test_jwa_cxa4011__test_block__trim_block__Tstring_arrayB [
               procedure
                 test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBDI
                 (l : in out system__finalization_root__finalizable_ptr;
                 v : in out
                 test_jwa_cxa4011__test_block__trim_block__Tstring_arrayB;
                 b : short_short_integer) is
                  subtype
                    test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBDI__S247b is
                    test_jwa_cxa4011__test_block__trim_block__Tstring_arrayB
                    (v'first(1) .. v'last(1));
               begin
                  for J1 in v'first(1) .. v'last(1) loop
                     $ada__finalization__initialize (v (J1));

                       $
                       system__finalization_implementation__attach_to_final_list
                       (l, system__finalization_root__finalizable?(v (
                       J1)), b);
                  end loop;
                  return;
               end
                 test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBDI;
               procedure
                 test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBDA
                 (l : in out system__finalization_root__finalizable_ptr;
                 v : in out
                 test_jwa_cxa4011__test_block__trim_block__Tstring_arrayB;
                 b : short_short_integer) is
                  subtype
                    test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBDA__S250b is
                    test_jwa_cxa4011__test_block__trim_block__Tstring_arrayB
                    (v'first(1) .. v'last(1));
               begin
                  for J1 in v'first(1) .. v'last(1) loop
                     jwa__strings__adjust__2 (v (J1));

                       $
                       system__finalization_implementation__attach_to_final_list
                       (l, system__finalization_root__finalizable?(v (
                       J1)), b);
                  end loop;
                  return;
               exception
                  when others =>
                     system__soft_links__abort_undefer.all;
                     B254b : declare
                        e : ada__exceptions__exception_occurrence;
                     begin
                        $ada__exceptions__save_occurrence (e,
                          system__soft_links__get_current_excep.all.all);

                          $
                          ada__exceptions__raise_from_controlled_operation
                          (e);
                     end B254b;
                     return;
               end
                 test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBDA;
               procedure
                 test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBDF
                 (v : in out
                 test_jwa_cxa4011__test_block__trim_block__Tstring_arrayB;
                 b : boolean) is
                  subtype
                    test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBDF__S255b is
                    test_jwa_cxa4011__test_block__trim_block__Tstring_arrayB
                    (v'first(1) .. v'last(1));
               begin
                  for J1 in reverse v'first(1) .. v'last(1) loop
                     if b then

                          $
                          system__finalization_implementation__finalize_one
                          (system__finalization_root__finalizable?(v (
                          J1)));
                     else
                        jwa__strings__finalize__2 (v (J1));
                     end if;
                  end loop;
                  return;
               exception
                  when others =>
                     system__soft_links__abort_undefer.all;
                     B259b : declare
                        e : ada__exceptions__exception_occurrence;
                     begin
                        $ada__exceptions__save_occurrence (e,
                          system__soft_links__get_current_excep.all.all);

                          $
                          ada__exceptions__raise_from_controlled_operation
                          (e);
                     end B259b;
                     return;
               end
                 test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBDF;
               procedure
                 test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBSA
                 (A238b : out
                 test_jwa_cxa4011__test_block__trim_block__Tstring_arrayB;
                 R239b :
                 test_jwa_cxa4011__test_block__trim_block__Tstring_arrayB;
                 L240b : integer; L241b : integer; R242b : integer;
                 R243b : integer; D244b : boolean) is
                  subtype
                    test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBSA__S261b is
                    test_jwa_cxa4011__test_block__trim_block__Tstring_arrayB
                    (R239b'first(1) .. R239b'last(1));
                  subtype
                    test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBSA__S260b is
                    test_jwa_cxa4011__test_block__trim_block__Tstring_arrayB
                    (A238b'first(1) .. A238b'last(1));
                  L245b : integer;
                  R246b : integer;
               begin
                  if L241b < L240b then
                     return;
                  end if;
                  if D244b then
                     L245b := L241b;
                     R246b := R243b;
                  else
                     L245b := L240b;
                     R246b := R242b;
                  end if;
                  loop
                     L263b__B268b : begin
                        system__soft_links__abort_defer.all;
                        B269b : begin
                           if not (A238b (L245b)'address = R239b (R246b)'
                             address) then
                              jwa__strings__finalize__2 (A238b (L245b));
                              A264b : ada__tags__tag := A238b (L245b).
                                _tag;
                              subtype
                                test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBSA__L263b__B268b__B269b__G265b is
                                system__storage_elements__storage_offset
                                range 1 .. (jwa__strings__string_8'size +
                                7) / 8;
                              subtype
                                test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBSA__L263b__B268b__B269b__S266b is
                                system__storage_elements__storage_array
                                (
                                test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBSA__L263b__B268b__B269b__G265b);
                              type
                                test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBSA__L263b__B268b__B269b__A267b
                                is access
                                test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBSA__L263b__B268b__B269b__S266b;
                              freeze
                                test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBSA__L263b__B268b__B269b__A267b []

                                test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBSA__L263b__B268b__B269b__A267b!
                                (A238b (L245b)'address).all (1 +
                                system__finalization_root__root_controlled'
                                size / 8 ..
                                test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBSA__L263b__B268b__B269b__G265b'
                                last) :=
                                test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBSA__L263b__B268b__B269b__A267b!
                                (R239b (R246b)'address).all (1 +
                                system__finalization_root__root_controlled'
                                size / 8 ..
                                test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBSA__L263b__B268b__B269b__G265b'
                                last);
                              A238b (L245b)._tag := A264b;
                              jwa__strings__adjust__2 (A238b (L245b));
                              null;
                           end if;
                        exception
                           when others =>
                              system__soft_links__abort_undefer.all;
                              B275b : declare
                                 e :
                                   ada__exceptions__exception_occurrence;
                              begin
                                 $ada__exceptions__save_occurrence (e,
                                   system__soft_links__get_current_excep.all.all);

                                   $
                                   ada__exceptions__raise_from_controlled_operation
                                   (e);
                              end B275b;
                        end B269b;
                     at end
                        system__standard_library__abort_undefer_direct;
                     end L263b__B268b;
                     if D244b then
                        exit when L245b = L240b;
                        L245b := integer'pred(L245b);
                        R246b := integer'pred(R246b);
                     else
                        exit when L245b = L241b;
                        L245b := integer'succ(L245b);
                        R246b := integer'succ(R246b);
                     end if;
                  end loop;
                  return;
               end
                 test_jwa_cxa4011__test_block__trim_block__Tstring_arrayBSA;
            ]
            [subtype
              test_jwa_cxa4011__test_block__trim_block__Tstring_arrayT is
              test_jwa_cxa4011__test_block__trim_block__Tstring_arrayB (
              1 .. 5)]
            freeze
              test_jwa_cxa4011__test_block__trim_block__Tstring_arrayT []

-- 278:                           (JS.To_String_8("xyzxAda9Xpqr"),
            type test_jwa_cxa4011__test_block__trim_block__A278b is
              access all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__trim_block__A278b []
            R279b : test_jwa_cxa4011__test_block__trim_block__A278b :=
              jwa__strings.jwa__strings__create__2 ("xyzxAda9Xpqr")
              'reference;
            $system__finalization_implementation__deep_tag_attach (
              F281b, R279b.all'address, 1);

-- 279:                            JS.To_String_8("Ada9Xqqrp"),
            type test_jwa_cxa4011__test_block__trim_block__A283b is
              access all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__trim_block__A283b []
            R284b : test_jwa_cxa4011__test_block__trim_block__A283b :=
              jwa__strings.jwa__strings__create__2 ("Ada9Xqqrp")
              'reference;
            $system__finalization_implementation__deep_tag_attach (
              F281b, R284b.all'address, 1);

-- 280:                            JS.To_String_8("zxyxAda9Xqpqr"),
            type test_jwa_cxa4011__test_block__trim_block__A287b is
              access all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__trim_block__A287b []
            R288b : test_jwa_cxa4011__test_block__trim_block__A287b :=
              jwa__strings.jwa__strings__create__2 ("zxyxAda9Xqpqr")
              'reference;
            $system__finalization_implementation__deep_tag_attach (
              F281b, R288b.all'address, 1);

-- 281:                            JS.To_String_8("xxxyAda9X"),
            type test_jwa_cxa4011__test_block__trim_block__A291b is
              access all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__trim_block__A291b []
            R292b : test_jwa_cxa4011__test_block__trim_block__A291b :=
              jwa__strings.jwa__strings__create__2 ("xxxyAda9X")
              'reference;
            $system__finalization_implementation__deep_tag_attach (
              F281b, R292b.all'address, 1);
            null;
            string_array : array (1 .. 5) of jwa__strings.
              jwa__strings__string_8 := (R279b.all, R284b.all, R288b.all,
              R292b.all, the_new_ada);
            B296b : begin
               string_array (1) := R279b.all;
            end B296b;
            string_array (1)._tag := jwa__strings__string_8P;
            jwa__strings__adjust__2 (string_array (1));
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(
              string_array (1)), 1);
            B297b : begin
               string_array (2) := R284b.all;
            end B297b;
            string_array (2)._tag := jwa__strings__string_8P;
            jwa__strings__adjust__2 (string_array (2));
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(
              string_array (2)), 1);
            B298b : begin
               string_array (3) := R288b.all;
            end B298b;
            string_array (3)._tag := jwa__strings__string_8P;
            jwa__strings__adjust__2 (string_array (3));
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(
              string_array (3)), 1);
            B299b : begin
               string_array (4) := R292b.all;
            end B299b;
            string_array (4)._tag := jwa__strings__string_8P;
            jwa__strings__adjust__2 (string_array (4));
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(
              string_array (4)), 1);
            B300b : begin
               string_array (5) := the_new_ada;
            end B300b;
            string_array (5)._tag := jwa__strings__string_8P;
            jwa__strings__adjust__2 (string_array (5));
            $system__finalization_implementation__attach_to_final_list
              (F166b, system__finalization_root__finalizable?(
              string_array (5)), 1);
            $ada__finalization__list_controller__finalize (L301b);
            L_1 : label
            L_2 : label

-- 282:                            The_New_Ada);

-- 283:

-- 284:       begin

-- 285:
-- 286:          -- Examine the version of Trim that removes blanks from
-- 287:          -- the left and/or right of a string.

-- 288:

-- 289:          for i in 1..4 loop
            L_1 : for i in 1 .. 4 loop
               E308b : boolean;

-- 290:             if JS.Trim(Space_Array(i), Ada.Strings.Both) /= Pad then
               L_1__B303b : declare
                  M309b : system__secondary_stack__mark_id :=
                    $system__secondary_stack__ss_mark;
                  F307b : system__finalization_root__finalizable_ptr :=
                    null;
                  procedure
                    test_jwa_cxa4011__test_block__trim_block__L_1__B303b___clean is
                  begin
                     system__soft_links__abort_defer.all;
                     $
                       system__finalization_implementation__finalize_list
                       (F307b);
                     $system__secondary_stack__ss_release (M309b);
                     system__soft_links__abort_undefer.all;
                     return;
                  end
                    test_jwa_cxa4011__test_block__trim_block__L_1__B303b___clean;
               begin
                  type
                    test_jwa_cxa4011__test_block__trim_block__L_1__B303b__A304b
                    is access all jwa__strings__string_8;
                  freeze
                    test_jwa_cxa4011__test_block__trim_block__L_1__B303b__A304b []
                  R305b :
                    test_jwa_cxa4011__test_block__trim_block__L_1__B303b__A304b :=
                    jwa__strings.jwa__strings__trim (space_array (i),
                    ada.ada__strings.ada__strings__both)'reference;
                  $system__finalization_implementation__deep_tag_attach
                    (F307b, R305b.all'address, 1);
                  E308b := not (jwa__strings__Oeq (R305b.all, pad));
               at end

                    test_jwa_cxa4011__test_block__trim_block__L_1__B303b___clean;
               end L_1__B303b;
               if E308b then

-- 291:                Report.Failed("Incorrect result from Trim for spaces - " &
                  L_1__B310b : declare
                  begin

-- 292:                              Integer'Image(i));
                     subtype
                       test_jwa_cxa4011__test_block__trim_block__L_1__B310b__TS311bS is
                       string (1 .. 11);
                     S311b : string (1 .. 11);
                     P312b : natural;
                     $system__img_int__image_integer (integer(i), S311b,
                       P312b);
                     R313b : constant natural := P312b;
                     L318b : constant integer := S311b (1 .. R313b)'
                       length;
                     L320b : constant integer := 40 + L318b;
                     subtype
                       test_jwa_cxa4011__test_block__trim_block__L_1__B310b__TS321bS is
                       string (1 .. 1 + (L320b - 1));
                     S321b : string (1 .. 1 + (L320b - 1));
                     $system__concat_2__str_concat_2 (S321b,
                       "Incorrect result from Trim for spaces - ",
                       S311b (1 .. R313b));
                     report.report__failed (S321b);

-- 293:             end if;
                  end L_1__B310b;
               end if;

-- 294:          end loop;
            end loop L_1;

-- 295:
-- 296:          -- Examine the version of Trim that removes set characters from
-- 297:          -- the left and right of a string.

-- 298:

-- 299:          for i in 1..5 loop
            L_2 : for i in 1 .. 5 loop
               E328b : boolean;

-- 300:             if JS.Trim(String_Array(i),

-- 301:                           Left   => XYZ_Set,

-- 302:                           Right  => PQR_Set) /= The_New_Ada then
               L_2__B323b : declare
                  M329b : system__secondary_stack__mark_id :=
                    $system__secondary_stack__ss_mark;
                  F327b : system__finalization_root__finalizable_ptr :=
                    null;
                  procedure
                    test_jwa_cxa4011__test_block__trim_block__L_2__B323b___clean is
                  begin
                     system__soft_links__abort_defer.all;
                     $
                       system__finalization_implementation__finalize_list
                       (F327b);
                     $system__secondary_stack__ss_release (M329b);
                     system__soft_links__abort_undefer.all;
                     return;
                  end
                    test_jwa_cxa4011__test_block__trim_block__L_2__B323b___clean;
               begin
                  type
                    test_jwa_cxa4011__test_block__trim_block__L_2__B323b__A324b
                    is access all jwa__strings__string_8;
                  freeze
                    test_jwa_cxa4011__test_block__trim_block__L_2__B323b__A324b []
                  R325b :
                    test_jwa_cxa4011__test_block__trim_block__L_2__B323b__A324b :=
                    jwa__strings.jwa__strings__trim__3 (string_array (i),
                    left => xyz_set, right => pqr_set)'reference;
                  $system__finalization_implementation__deep_tag_attach
                    (F327b, R325b.all'address, 1);
                  E328b := not (jwa__strings__Oeq (R325b.all,
                    the_new_ada));
               at end

                    test_jwa_cxa4011__test_block__trim_block__L_2__B323b___clean;
               end L_2__B323b;
               if E328b then

-- 303:                Report.Failed
                  L_2__B330b : declare
                  begin

-- 304:                  ("Incorrect result from Trim for set characters - " &

-- 305:                   Integer'Image(i));
                     subtype
                       test_jwa_cxa4011__test_block__trim_block__L_2__B330b__TS331bS is
                       string (1 .. 11);
                     S331b : string (1 .. 11);
                     P332b : natural;
                     $system__img_int__image_integer (integer(i), S331b,
                       P332b);
                     R333b : constant natural := P332b;
                     L338b : constant integer := S331b (1 .. R333b)'
                       length;
                     L340b : constant integer := 48 + L338b;
                     subtype
                       test_jwa_cxa4011__test_block__trim_block__L_2__B330b__TS341bS is
                       string (1 .. 1 + (L340b - 1));
                     S341b : string (1 .. 1 + (L340b - 1));
                     $system__concat_2__str_concat_2 (S341b,
                       "Incorrect result from Trim for set characters - ",
                       S331b (1 .. R333b));
                     report.report__failed (S341b);

-- 306:             end if;
                  end L_2__B330b;
               end if;

-- 307:          end loop;
            end loop L_2;
         at end
            test_jwa_cxa4011__test_block__trim_block___clean;

-- 308:

-- 309:       end Trim_Block;
         end trim_block;
         E360b : boolean;

-- 310:

-- 311:
-- 312:       -- Delete

-- 313:
-- 314:       -- Use the Delete function to remove the first four and last four
-- 315:       -- characters from the string.

-- 316:

-- 317:       if JS.Delete(Source  => JS.Delete(Magic_String,

-- 318:                                               8,

-- 319:                                               JS.Length(Magic_String)),

-- 320:                       From    => JS.To_String(Magic_String)'First,

-- 321:                       Through => 4)   /=
         B343b : declare
            M361b : system__secondary_stack__mark_id :=
              $system__secondary_stack__ss_mark;
            F355b : system__finalization_root__finalizable_ptr := null;
            procedure test_jwa_cxa4011__test_block__B343b___clean is
            begin
               system__soft_links__abort_defer.all;
               $system__finalization_implementation__finalize_list (
                 F355b);
               $system__secondary_stack__ss_release (M361b);
               system__soft_links__abort_undefer.all;
               return;
            end test_jwa_cxa4011__test_block__B343b___clean;
         begin
            C344b : natural;
            B346b : declare
               L345b : label
            begin
               if magic_string.ptr = null then
                  C344b := 0;
                  goto L345b;
               else
                  R348b : jwa__strings__string_8_internal_ptr renames
                    magic_string.ptr;
                  [constraint_error when
                    R348b = null
                    "access check failed"]
                  R349b : constant natural := R348b.all.capacity;
                  subtype
                    test_jwa_cxa4011__test_block__B343b__B346b__S347b is
                    jwa__strings__string_8_data (R349b);
                  R351b : jwa__strings__string_8_internal_ptr renames
                    magic_string.ptr;
                  [constraint_error when
                    R351b = null
                    "access check failed"]
                  [constraint_error when
                    not (interfaces__unsigned_32!(R351b.all.data.length) <=
                      16#7FFF_FFFF#)
                    "invalid data"]
                  C344b := R351b.all.data.length;
                  goto L345b;
               end if;
               <<L345b>>
            end B346b;
            type test_jwa_cxa4011__test_block__B343b__A352b is access
              all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__B343b__A352b []
            R353b : test_jwa_cxa4011__test_block__B343b__A352b :=
              jwa__strings.jwa__strings__delete (magic_string, 8, C344b)
              'reference;
            $system__finalization_implementation__deep_tag_attach (
              F355b, R353b.all'address, 1);
            R356b : constant integer := jwa__strings.
              jwa__strings__to_ada (magic_string)'first;
            [constraint_error when
              not (R356b >= 1)
              "range check failed"]
            type test_jwa_cxa4011__test_block__B343b__A357b is access
              all jwa__strings__string_8;
            freeze test_jwa_cxa4011__test_block__B343b__A357b []
            R358b : test_jwa_cxa4011__test_block__B343b__A357b :=
              jwa__strings.jwa__strings__delete (source => R353b.all,
              from => R356b, through => 4)'reference;
            $system__finalization_implementation__deep_tag_attach (
              F355b, R358b.all'address, 1);
            E360b := not (jwa__strings__Oeq (R358b.all, cad_string));
         at end
            test_jwa_cxa4011__test_block__B343b___clean;
         end B343b;
         if E360b then

-- 322:          Cad_String

-- 323:       then

-- 324:          Report.Failed("Incorrect results from Function Delete");
            report.report__failed (
              "Incorrect results from Function Delete");

-- 325:       end if;
         end if;

-- 326:

-- 327:
-- 328:       -- Constructors ("*")

-- 329:

-- 330:       Constructor_Block:

-- 331:       declare
         constructor_block : declare
            M425b : system__secondary_stack__mark_id :=
              $system__secondary_stack__ss_mark;
            F363b : system__finalization_root__finalizable_ptr := null;
            procedure
              test_jwa_cxa4011__test_block__constructor_block___clean is
            begin
               system__soft_links__abort_defer.all;
               $system__finalization_implementation__finalize_list (
                 F363b);
               $system__secondary_stack__ss_release (M425b);
               system__soft_links__abort_undefer.all;
               return;
            end test_jwa_cxa4011__test_block__constructor_block___clean;
         begin
            L393b :
              ada__finalization__list_controller__simple_list_controller;

-- 332:

-- 333:          SOS      : JS.String_8;

              $
              ada__finalization__list_controller__simple_list_controllerIP
              (L393b, P6s => true);
            $ada__finalization__initialize__2 (L393b);
            $system__finalization_implementation__attach_to_final_list
              (F363b, system__finalization_root__finalizable?(L393b),
              1);
            F378b___XR_L393b___XEXRf : _renaming_type;
            F378b : system__finalization_root__finalizable_ptr renames
              L393b.f;
            L371b :
              ada__finalization__list_controller__simple_list_controller;

              $
              ada__finalization__list_controller__simple_list_controllerIP
              (L371b, P6s => true);
            $ada__finalization__initialize__2 (L371b);
            $system__finalization_implementation__attach_to_final_list
              (F363b, system__finalization_root__finalizable?(L371b),
              1);
            F370b___XR_L371b___XEXRf : _renaming_type;
            F370b : system__finalization_root__finalizable_ptr renames
              L371b.f;
            sos : jwa__strings.jwa__strings__string_8;
            jwa__strings__string_8IP (sos, P20s => true);
            B364b : begin
               system__soft_links__abort_defer.all;
               $ada__finalization__initialize (sos);

                 $
                 system__finalization_implementation__attach_to_final_list
                 (F363b, system__finalization_root__finalizable?(sos),
                 1);
            at end
               system__standard_library__abort_undefer_direct;
            end B364b;

-- 334:

-- 335:          Dot      : constant JS.String_8 :=

-- 336:                                JS.To_String_8("Dot_");
            type test_jwa_cxa4011__test_block__constructor_block__A367b
              is access all jwa__strings__string_8;
            freeze
              test_jwa_cxa4011__test_block__constructor_block__A367b []
            R368b :
              test_jwa_cxa4011__test_block__constructor_block__A367b :=
              jwa__strings.jwa__strings__create__2 ("Dot_")'reference;
            $system__finalization_implementation__deep_tag_attach (
              F370b, R368b.all'address, 1);
            dot : constant jwa__strings.jwa__strings__string_8 := R368b.all;
            jwa__strings__adjust__2 (dot);
            $system__finalization_implementation__attach_to_final_list
              (F363b, system__finalization_root__finalizable?(dot),
              1);
            $ada__finalization__list_controller__finalize (L371b);
            dot._tag := jwa__strings__string_8P;

-- 337:          Dash     : constant String := "Dash_";
            subtype
              test_jwa_cxa4011__test_block__constructor_block__TdashS is
              string (1 .. 5);
            dash : constant string (1 .. 5) := "Dash_";

-- 338:

-- 339:          Distress : JS.String_8 :=

-- 340:                       JS.To_String_8("Dot_Dot_Dot_")    &
            type test_jwa_cxa4011__test_block__constructor_block__A375b
              is access all jwa__strings__string_8;
            freeze
              test_jwa_cxa4011__test_block__constructor_block__A375b []
            R376b :
              test_jwa_cxa4011__test_block__constructor_block__A375b :=
              jwa__strings.jwa__strings__create__2 ("Dot_Dot_Dot_")
              'reference;
            $system__finalization_implementation__deep_tag_attach (
              F378b, R376b.all'address, 1);

-- 341:                       JS.To_String_8("Dash_Dash_Dash_") &
            type test_jwa_cxa4011__test_block__constructor_block__A380b
              is access all jwa__strings__string_8;
            freeze
              test_jwa_cxa4011__test_block__constructor_block__A380b []
            R381b :
              test_jwa_cxa4011__test_block__constructor_block__A380b :=
              jwa__strings.jwa__strings__create__2 ("Dash_Dash_Dash_")
              'reference;
            $system__finalization_implementation__deep_tag_attach (
              F378b, R381b.all'address, 1);
            type test_jwa_cxa4011__test_block__constructor_block__A383b
              is access all jwa__strings__string_8;
            freeze
              test_jwa_cxa4011__test_block__constructor_block__A383b []
            R384b :
              test_jwa_cxa4011__test_block__constructor_block__A383b :=
              jwa__strings__Oconcat (R376b.all, R381b.all)'reference;
            $system__finalization_implementation__deep_tag_attach (
              F378b, R384b.all'address, 1);

-- 342:                       JS.To_String_8("Dot_Dot_Dot");
            type test_jwa_cxa4011__test_block__constructor_block__A387b
              is access all jwa__strings__string_8;
            freeze
              test_jwa_cxa4011__test_block__constructor_block__A387b []
            R388b :
              test_jwa_cxa4011__test_block__constructor_block__A387b :=
              jwa__strings.jwa__strings__create__2 ("Dot_Dot_Dot")
              'reference;
            $system__finalization_implementation__deep_tag_attach (
              F378b, R388b.all'address, 1);
            type test_jwa_cxa4011__test_block__constructor_block__A390b
              is access all jwa__strings__string_8;
            freeze
              test_jwa_cxa4011__test_block__constructor_block__A390b []
            R391b :
              test_jwa_cxa4011__test_block__constructor_block__A390b :=
              jwa__strings__Oconcat (R384b.all, R388b.all)'reference;
            $system__finalization_implementation__deep_tag_attach (
              F378b, R391b.all'address, 1);
            distress : jwa__strings.jwa__strings__string_8 := R391b.all;
            jwa__strings__adjust__2 (distress);
            $system__finalization_implementation__attach_to_final_list
              (F363b, system__finalization_root__finalizable?(distress),
              1);
            $ada__finalization__list_controller__finalize (L393b);
            distress._tag := jwa__strings__string_8P;
            repeat : constant natural := 3;
            separator : constant character := '_';
            separator_set : ada__strings__maps.
              ada__strings__maps__character_set := ada__strings__maps.
              ada__strings__maps__to_set__4 (separator);

-- 343:

-- 344:          Repeat        : constant Natural   := 3;

-- 345:          Separator     : constant Character := '_';

-- 346:

-- 347:          Separator_Set : Maps.Character_Set := Maps.To_Set(Separator);

-- 348:

-- 349:       begin

-- 350:
-- 351:          -- Use the following constructor forms to construct the string
-- 352:          -- "Dot_Dot_Dot_Dash_Dash_Dash_Dot_Dot_Dot".  Note that the
-- 353:          -- trailing underscore in the string is removed in the call to
-- 354:          -- Trim in the If statement condition.

-- 355:

-- 356:          SOS := JS."*"(Repeat, Dot);        -- "*"(#, Unb Str)
            B394b : declare
               M400b : system__secondary_stack__mark_id :=
                 $system__secondary_stack__ss_mark;
               F398b : system__finalization_root__finalizable_ptr :=
                 null;
               procedure
                 test_jwa_cxa4011__test_block__constructor_block__B394b___clean is
               begin
                  system__soft_links__abort_defer.all;
                  $system__finalization_implementation__finalize_list (
                    F398b);
                  $system__secondary_stack__ss_release (M400b);
                  system__soft_links__abort_undefer.all;
                  return;
               end
                 test_jwa_cxa4011__test_block__constructor_block__B394b___clean;
            begin
               type
                 test_jwa_cxa4011__test_block__constructor_block__B394b__A395b
                 is access all jwa__strings__string_8;
               freeze
                 test_jwa_cxa4011__test_block__constructor_block__B394b__A395b []
               R396b :
                 test_jwa_cxa4011__test_block__constructor_block__B394b__A395b :=
                 jwa__strings.Omultiply (repeat, dot)'reference;
               $system__finalization_implementation__deep_tag_attach (
                 F398b, R396b.all'address, 1);
               B399b : begin
                  system__soft_links__abort_defer.all;
                  jwa__strings___assign__2 (sos, R396b.all);
               at end
                  system__standard_library__abort_undefer_direct;
               end B399b;
            at end

                 test_jwa_cxa4011__test_block__constructor_block__B394b___clean;
            end B394b;

-- 357:

-- 358:          SOS := SOS                     &
            B401b : declare
               M416b : system__secondary_stack__mark_id :=
                 $system__secondary_stack__ss_mark;
               F405b : system__finalization_root__finalizable_ptr :=

-- 359:                 JS."*"(Repeat, Dash) &      -- "*"(#, Str)
                 null;
               procedure
                 test_jwa_cxa4011__test_block__constructor_block__B401b___clean is
               begin
                  system__soft_links__abort_defer.all;
                  $system__finalization_implementation__finalize_list (
                    F405b);
                  $system__secondary_stack__ss_release (M416b);
                  system__soft_links__abort_undefer.all;
                  return;
               end
                 test_jwa_cxa4011__test_block__constructor_block__B401b___clean;
            begin
               type
                 test_jwa_cxa4011__test_block__constructor_block__B401b__A402b
                 is access all jwa__strings__string_8;
               freeze
                 test_jwa_cxa4011__test_block__constructor_block__B401b__A402b []
               R403b :
                 test_jwa_cxa4011__test_block__constructor_block__B401b__A402b :=
                 jwa__strings.Omultiply (repeat, dash)'reference;
               $system__finalization_implementation__deep_tag_attach (
                 F405b, R403b.all'address, 1);
               type
                 test_jwa_cxa4011__test_block__constructor_block__B401b__A406b
                 is access all jwa__strings__string_8;
               freeze
                 test_jwa_cxa4011__test_block__constructor_block__B401b__A406b []
               R407b :
                 test_jwa_cxa4011__test_block__constructor_block__B401b__A406b :=
                 jwa__strings__Oconcat (sos, R403b.all)'reference;
               $system__finalization_implementation__deep_tag_attach (
                 F405b, R407b.all'address, 1);

-- 360:                 JS."*"(Repeat, Dot);        -- "*"(#, Unb Str)
               type
                 test_jwa_cxa4011__test_block__constructor_block__B401b__A409b
                 is access all jwa__strings__string_8;
               freeze
                 test_jwa_cxa4011__test_block__constructor_block__B401b__A409b []
               R410b :
                 test_jwa_cxa4011__test_block__constructor_block__B401b__A409b :=
                 jwa__strings.Omultiply (repeat, dot)'reference;
               $system__finalization_implementation__deep_tag_attach (
                 F405b, R410b.all'address, 1);
               type
                 test_jwa_cxa4011__test_block__constructor_block__B401b__A412b
                 is access all jwa__strings__string_8;
               freeze
                 test_jwa_cxa4011__test_block__constructor_block__B401b__A412b []
               R413b :
                 test_jwa_cxa4011__test_block__constructor_block__B401b__A412b :=
                 jwa__strings__Oconcat (R407b.all, R410b.all)'reference;
               $system__finalization_implementation__deep_tag_attach (
                 F405b, R413b.all'address, 1);
               B415b : begin
                  system__soft_links__abort_defer.all;
                  jwa__strings___assign__2 (sos, R413b.all);
               at end
                  system__standard_library__abort_undefer_direct;
               end B415b;
            at end

                 test_jwa_cxa4011__test_block__constructor_block__B401b___clean;
            end B401b;
            E422b : boolean;

-- 361:

-- 362:          if JS.Trim(SOS, Maps.Null_Set, Separator_Set) /= Distress then
            B417b : declare
               M423b : system__secondary_stack__mark_id :=
                 $system__secondary_stack__ss_mark;
               F421b : system__finalization_root__finalizable_ptr :=
                 null;
               procedure
                 test_jwa_cxa4011__test_block__constructor_block__B417b___clean is
               begin
                  system__soft_links__abort_defer.all;
                  $system__finalization_implementation__finalize_list (
                    F421b);
                  $system__secondary_stack__ss_release (M423b);
                  system__soft_links__abort_undefer.all;
                  return;
               end
                 test_jwa_cxa4011__test_block__constructor_block__B417b___clean;
            begin
               type
                 test_jwa_cxa4011__test_block__constructor_block__B417b__A418b
                 is access all jwa__strings__string_8;
               freeze
                 test_jwa_cxa4011__test_block__constructor_block__B417b__A418b []
               R419b :
                 test_jwa_cxa4011__test_block__constructor_block__B417b__A418b :=
                 jwa__strings.jwa__strings__trim__3 (sos,
                 ada__strings__maps.ada__strings__maps__null_set,
                 separator_set)'reference;
               $system__finalization_implementation__deep_tag_attach (
                 F421b, R419b.all'address, 1);
               E422b := not (jwa__strings__Oeq (R419b.all, distress));
            at end

                 test_jwa_cxa4011__test_block__constructor_block__B417b___clean;
            end B417b;
            if E422b then

-- 363:             Report.Failed("Incorrect results from Function ""*""");
               report.report__failed (
                 "Incorrect results from Function ""*""");

-- 364:          end if;
            end if;
         at end
            test_jwa_cxa4011__test_block__constructor_block___clean;

-- 365:

-- 366:       end Constructor_Block;
         end constructor_block;

-- 367:

-- 368:

-- 369:    exception
      exception

-- 370:       when others => Report.Failed ("Exception raised in Test_Block");
         when others =>
            system__soft_links__abort_undefer.all;
            report.report__failed ("Exception raised in Test_Block");

-- 371:    end Test_Block;
      end;
   at end
      test_jwa_cxa4011__test_block___clean;
   end test_block;

-- 372:

-- 373:

-- 374:    Report.Result;
   report.report__result;

-- 375:

-- 376: end Test_Jwa_CXA4011;
   return;
end test_jwa_cxa4011;
