run copyright.sh for 2011.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.pascal / types.exp
1 # Copyright 1994, 1995, 1997, 1998, 2007, 2008, 2009, 2010, 2011
2 # Free Software Foundation, Inc.
3 # Copyright 2007 Free Software Foundation, Inc.
4 #
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.
9 #
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.
14 #
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/>.
17
18 # This file was adapted from old Chill tests by Stan Shebs
19 # (shebs@cygnus.com).
20 # Adapted to pascal by Pierre Muller
21
22 if $tracelevel then {
23 strace $tracelevel
24 }
25
26 load_lib "pascal.exp"
27
28 proc test_integer_literal_types_accepted {} {
29 global gdb_prompt
30
31 # Test various decimal values.
32 # Should be integer*4 probably.
33 gdb_test "pt 123" "type = int"
34 }
35 proc test_character_literal_types_accepted {} {
36 global gdb_prompt
37
38 # Test various character values.
39
40 gdb_test "pt 'a'" "type = char"
41 }
42
43 proc test_string_literal_types_accepted {} {
44 global gdb_prompt
45
46 # Test various character values.
47
48 setup_kfail gdb/2326 *-*-*
49 gdb_test "pt 'a simple string'" "type = string"
50 }
51
52 proc test_logical_literal_types_accepted {} {
53 global gdb_prompt
54
55 # Test the only possible values for a logical, TRUE and FALSE.
56
57 gdb_test "pt TRUE" "type = bool"
58 gdb_test "pt FALSE" "type = bool"
59 }
60
61 proc test_float_literal_types_accepted {} {
62 global gdb_prompt
63
64 # Test various floating point formats
65
66 # this used to guess whether to look for "real*4" or
67 # "real*8" based on a target config variable, but noone
68 # maintained it properly.
69
70 gdb_test "pt .44" "type = double"
71 gdb_test "pt 44.0" "type = double"
72 gdb_test "pt 10e20" "type = double"
73 gdb_test "pt 10E20" "type = double"
74 }
75
76 # Start with a fresh gdb.
77
78 gdb_exit
79 gdb_start
80 gdb_reinitialize_dir $srcdir/$subdir
81
82 if [set_lang_pascal] then {
83 test_integer_literal_types_accepted
84 test_logical_literal_types_accepted
85 test_character_literal_types_accepted
86 test_string_literal_types_accepted
87 test_float_literal_types_accepted
88 } else {
89 warning "$test_name tests suppressed." 0
90 }
This page took 0.032545 seconds and 5 git commands to generate.