1 # Copyright 1994, 1995, 1997, 1998 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 2 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, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 # Please email any bugs, comments, and/or additions to this file to:
18 # bug-gdb@prep.ai.mit.edu
20 # This file was adapted from (OBSOLETE) Chill tests by Stan Shebs (shebs@cygnus.com).
29 # Set the current language to fortran. This counts as a test. If it
30 # fails, then we skip the other tests.
32 proc set_lang_fortran {} {
35 if [gdb_test "set language fortran" ""] {
39 if ![gdb_test "show language" ".* source language is \"fortran\".*"] {
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"
54 proc test_character_literal_types_accepted {} {
57 # Test various character values.
59 gdb_test "pt 'a'" "type = character\\*1"
62 proc test_integer_literal_types_rejected {} {
65 test_print_reject "pt _"
68 proc test_logical_literal_types_accepted {} {
71 # Test the only possible values for a logical, TRUE and FALSE.
73 gdb_test "pt .TRUE." "type = logical\\*2"
74 gdb_test "pt .FALSE." "type = logical\\*2"
77 proc test_float_literal_types_accepted {} {
80 # Test various floating point formats
82 # this used to guess whether to look for "real*4" or
83 # "real*8" based on a target config variable, but noone
84 # maintained it properly.
86 gdb_test "pt .44" "type = real\\*\[0-9\]+"
87 gdb_test "pt 44.0" "type = real\\*\[0-9\]+"
88 gdb_test "pt 10D20" "type = real\\*\[0-9\]+"
89 gdb_test "pt 10D20" "type = real\\*\[0-9\]+"
90 gdb_test "pt 10d20" "type = real\\*\[0-9\]+"
91 gdb_test "pt 10d20" "type = real\\*\[0-9\]+"
92 gdb_test "pt 10E20" "type = real\\*\[0-9\]+"
93 gdb_test "pt 10E20" "type = real\\*\[0-9\]+"
94 gdb_test "pt 10e20" "type = real\\*\[0-9\]+"
95 gdb_test "pt 10e20" "type = real\\*\[0-9\]+"
98 # Start with a fresh gdb.
102 gdb_reinitialize_dir $srcdir/$subdir
104 gdb_test "set print sevenbit-strings" ""
106 if [set_lang_fortran] then {
107 test_integer_literal_types_accepted
108 test_integer_literal_types_rejected
109 test_logical_literal_types_accepted
110 test_character_literal_types_accepted
111 test_float_literal_types_accepted
113 warning "$test_name tests suppressed." 0