1 # Copyright 1994, 1995, 1997, 1998, 2007, 2008, 2009
2 # Free Software Foundation, Inc.
3 # Copyright 2007 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # This file was adapted from old Chill tests by Stan Shebs
20 # Adapted to pascal by Pierre Muller
29 # Set the current language to pascal. This counts as a test. If it
30 # fails, then we skip the other tests.
32 proc set_lang_pascal {} {
35 if [gdb_test "set language pascal" ""] {
39 if ![gdb_test "show language" ".* source language is \"pascal\".*"] {
46 proc test_integer_literal_types_accepted {} {
49 # Test various decimal values.
50 # Should be integer*4 probably.
51 gdb_test "pt 123" "type = int"
53 proc test_character_literal_types_accepted {} {
56 # Test various character values.
58 gdb_test "pt 'a'" "type = char"
61 proc test_string_literal_types_accepted {} {
64 # Test various character values.
66 setup_kfail *-*-* gdb/2326
67 gdb_test "pt 'a simple string'" "type = string"
70 proc test_logical_literal_types_accepted {} {
73 # Test the only possible values for a logical, TRUE and FALSE.
75 gdb_test "pt TRUE" "type = bool"
76 gdb_test "pt FALSE" "type = bool"
79 proc test_float_literal_types_accepted {} {
82 # Test various floating point formats
84 # this used to guess whether to look for "real*4" or
85 # "real*8" based on a target config variable, but noone
86 # maintained it properly.
88 gdb_test "pt .44" "type = double"
89 gdb_test "pt 44.0" "type = double"
90 gdb_test "pt 10e20" "type = double"
91 gdb_test "pt 10E20" "type = double"
94 # Start with a fresh gdb.
98 gdb_reinitialize_dir $srcdir/$subdir
100 if [set_lang_pascal] then {
101 test_integer_literal_types_accepted
102 test_logical_literal_types_accepted
103 test_character_literal_types_accepted
104 test_string_literal_types_accepted
105 test_float_literal_types_accepted
107 warning "$test_name tests suppressed." 0