char_enum_unicode.exp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Copyright 2011-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. load_lib "ada.exp"
  16. if { [skip_ada_tests] } { return -1 }
  17. standard_ada_testfile foo
  18. set flags [list debug additional_flags=-gnatW8]
  19. if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != "" } {
  20. return -1
  21. }
  22. clean_restart ${testfile}
  23. set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
  24. runto "foo.adb:$bp_location"
  25. set y "'\\\[\"0178\"\\\]'"
  26. set king "'\\\[\"01fa00\"\\\]'"
  27. set thorn "'\\\[\"de\"\\\]'"
  28. gdb_test "ptype Char_Enum_Type" "type = \\(alpha, 'x', $y, $king, $thorn\\)"
  29. gdb_test "print Char_Alpha" " = alpha"
  30. gdb_test "print Char_X" " = 1 'x'"
  31. gdb_test "print Char_Y" " = 2 $y"
  32. gdb_test "print Char_King" " = 3 $king"
  33. gdb_test "print Char_Thorn" " = 4 $thorn"
  34. gdb_test "print Char_Enum_Type'('x')" " = 1 'x'"
  35. gdb_test "print Char_Enum_Type'('\[\"0178\"\]')" " = 2 $y"
  36. gdb_test "print Char_Enum_Type'('\[\"1fa00\"\]')" " = 3 $king"
  37. gdb_test "print Char_Enum_Type'('\[\"de\"\]')" " = 4 $thorn"
  38. gdb_test "print '\[\"0178\"\]'" " = 376 $y"
  39. gdb_test "print '\[\"01fa00\"\]'" " = 129536 $king"
  40. gdb_test "print '\[\"de\"\]'" " = 222 $thorn"
  41. gdb_test "print \"\[\"0178\"\]\"" "wide strings are not yet supported"
  42. gdb_test "print \"\[\"de\"\]\"" " = \"\\\[\"de\"\\\]\""