]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.pascal/types.exp
GDB copyright headers update after running GDB's copyright.py script.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.pascal / types.exp
CommitLineData
618f726f 1# Copyright 1994-2016 Free Software Foundation, Inc.
a912286e
DJ
2# Copyright 2007 Free Software Foundation, Inc.
3#
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
a912286e
DJ
17# This file was adapted from old Chill tests by Stan Shebs
18# (shebs@cygnus.com).
19# Adapted to pascal by Pierre Muller
20
f1208f9e 21load_lib "pascal.exp"
a912286e
DJ
22
23proc test_integer_literal_types_accepted {} {
24 global gdb_prompt
25
26 # Test various decimal values.
27 # Should be integer*4 probably.
28 gdb_test "pt 123" "type = int"
29}
30proc test_character_literal_types_accepted {} {
31 global gdb_prompt
32
33 # Test various character values.
34
35 gdb_test "pt 'a'" "type = char"
36}
37
38proc test_string_literal_types_accepted {} {
39 global gdb_prompt
40
41 # Test various character values.
42
bbc8b958 43 setup_kfail gdb/2326 *-*-*
a912286e
DJ
44 gdb_test "pt 'a simple string'" "type = string"
45}
46
47proc test_logical_literal_types_accepted {} {
48 global gdb_prompt
49
50 # Test the only possible values for a logical, TRUE and FALSE.
51
52 gdb_test "pt TRUE" "type = bool"
53 gdb_test "pt FALSE" "type = bool"
54}
55
56proc test_float_literal_types_accepted {} {
57 global gdb_prompt
58
59 # Test various floating point formats
60
61 # this used to guess whether to look for "real*4" or
62 # "real*8" based on a target config variable, but noone
63 # maintained it properly.
64
65 gdb_test "pt .44" "type = double"
66 gdb_test "pt 44.0" "type = double"
67 gdb_test "pt 10e20" "type = double"
68 gdb_test "pt 10E20" "type = double"
69}
70
71# Start with a fresh gdb.
72
73gdb_exit
74gdb_start
75gdb_reinitialize_dir $srcdir/$subdir
76
77if [set_lang_pascal] then {
78 test_integer_literal_types_accepted
79 test_logical_literal_types_accepted
80 test_character_literal_types_accepted
81 test_string_literal_types_accepted
82 test_float_literal_types_accepted
83} else {
84 warning "$test_name tests suppressed." 0
85}