failure.adb 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. -- Copyright 2014-2022 Free Software Foundation, Inc.
  2. --
  3. -- This program is free software; you can redistribute it and/or modify
  4. -- it under the terms of the GNU General Public License as published by
  5. -- the Free Software Foundation; either version 3 of the License, or
  6. -- (at your option) any later version.
  7. --
  8. -- This program is distributed in the hope that it will be useful,
  9. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. -- GNU General Public License for more details.
  12. --
  13. -- You should have received a copy of the GNU General Public License
  14. -- along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. with Pck; use Pck;
  16. procedure Failure is
  17. type Funny_Char is
  18. (NUL, ' ', '"', '#', '$', TMI, '&', ''',
  19. '(', ')', SOT, ND, ',', '-', '.', '/',
  20. '0', '1', '2', '3', '4', '5', '6', '7',
  21. '8', '9', ':', ';', UNS, INF, XMT, '?',
  22. '!', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
  23. 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
  24. 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
  25. 'X', 'Y', 'Z', BEL, SND, CR, LF, DLT);
  26. type Funny_String is array (Positive range <>) of Funny_Char;
  27. pragma Pack (Funny_String);
  28. type Bounded_Funny_String (Size : Natural := 1) is
  29. record
  30. Str : Funny_String (1 .. Size) := (others => '0');
  31. Length : Natural := 4;
  32. end record;
  33. Test : Bounded_Funny_String (100);
  34. begin
  35. Test.Str := (1 => 'A', others => NUL);
  36. Test.Length := 1;
  37. Do_Nothing (Test'Address); -- START
  38. end;