1 # Copyright 2011-2023 Free Software Foundation, Inc.
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.
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.
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/>.
18 if { [skip_ada_tests] } { return -1 }
20 standard_ada_testfile foo
22 set flags [list debug additional_flags=-gnatW8]
23 if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != "" } {
27 clean_restart ${testfile}
29 set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
30 runto "foo.adb:$bp_location"
32 set y "'\\\[\"0178\"\\\]'"
33 set king "'\\\[\"01fa00\"\\\]'"
34 set thorn "'\\\[\"de\"\\\]'"
36 gdb_test "ptype Char_Enum_Type" "type = \\(alpha, 'x', $y, $king, $thorn\\)"
37 gdb_test "print Char_Alpha" " = alpha"
38 gdb_test "print Char_X" " = 1 'x'"
39 gdb_test "print Char_Y" " = 2 $y"
40 gdb_test "print Char_King" " = 3 $king"
41 gdb_test "print Char_Thorn" " = 4 $thorn"
42 gdb_test "print Char_Enum_Type'('x')" " = 1 'x'"
43 gdb_test "print Char_Enum_Type'('\[\"0178\"\]')" " = 2 $y"
44 gdb_test "print Char_Enum_Type'('\[\"1fa00\"\]')" " = 3 $king"
45 gdb_test "print Char_Enum_Type'('\[\"de\"\]')" " = 4 $thorn"
47 gdb_test "print '\[\"0178\"\]'" " = 376 $y"
48 gdb_test "print '\[\"01fa00\"\]'" " = 129536 $king"
49 gdb_test "print '\[\"de\"\]'" " = 222 $thorn"
51 gdb_test "print \"\[\"0178\"\]\"" "wide strings are not yet supported"
52 gdb_test "print \"\[\"de\"\]\"" " = \"\\\[\"de\"\\\]\""