* config/tc-arm.c (arm_cpus): Add entry for ARM Cortex-M0.
[binutils-gdb.git] / gdb / testsuite / gdb.fortran / types.exp
blob1eb4c42a469c8a82960763d3ffb62b652d90ec34
1 # Copyright 1994, 1995, 1997, 1998, 2007, 2008, 2009
2 # Free Software Foundation, Inc.
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.
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.
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/>.
17 # This file was adapted from old Chill tests by Stan Shebs
18 # (shebs@cygnus.com).
20 if $tracelevel then {
21         strace $tracelevel
24 set prms_id 0
25 set bug_id 0
27 # Set the current language to fortran.  This counts as a test.  If it
28 # fails, then we skip the other tests.
30 proc set_lang_fortran {} {
31     global gdb_prompt
32     
33     if [gdb_test "set language fortran" ""] {
34         return 0;
35     }
37     if ![gdb_test "show language" ".* source language is \"fortran\".*"] {
38         return 1;
39     } else {
40         return 0;
41     }
44 proc test_integer_literal_types_accepted {} {
45     global gdb_prompt
47     # Test various decimal values.
48     # Should be integer*4 probably.
49     gdb_test "pt 123" "type = int" 
52 proc test_character_literal_types_accepted {} {
53     global gdb_prompt
55     # Test various character values.
57     gdb_test "pt 'a'" "type = character\\*1"
60 proc test_integer_literal_types_rejected {} {
61     global gdb_prompt
63     test_print_reject "pt _"
66 proc test_logical_literal_types_accepted {} {
67     global gdb_prompt
69     # Test the only possible values for a logical, TRUE and FALSE.
71     gdb_test "pt .TRUE." "type = logical\\*2"
72     gdb_test "pt .FALSE." "type = logical\\*2"
75 proc test_float_literal_types_accepted {} {
76     global gdb_prompt
78     # Test various floating point formats
80     # this used to guess whether to look for "real*4" or
81     # "real*8" based on a target config variable, but noone
82     # maintained it properly.
84     gdb_test "pt .44" "type = real\\*\[0-9\]+"
85     gdb_test "pt 44.0" "type = real\\*\[0-9\]+"
86     gdb_test "pt 10D20" "type = real\\*\[0-9\]+"
87     gdb_test "pt 10D20" "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 10E20" "type = real\\*\[0-9\]+"
91     gdb_test "pt 10E20" "type = real\\*\[0-9\]+"
92     gdb_test "pt 10e20" "type = real\\*\[0-9\]+"
93     gdb_test "pt 10e20" "type = real\\*\[0-9\]+"
96 # Start with a fresh gdb.
98 gdb_exit
99 gdb_start
100 gdb_reinitialize_dir $srcdir/$subdir
102 gdb_test "set print sevenbit-strings" ""
104 if [set_lang_fortran] then {
105     test_integer_literal_types_accepted
106     test_integer_literal_types_rejected
107     test_logical_literal_types_accepted
108     test_character_literal_types_accepted
109     test_float_literal_types_accepted
110 } else {
111     warning "$test_name tests suppressed." 0