1 # Copyright 2019 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 3 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, see <http://www.gnu.org/licenses/>.
16 # This file tests GDB's handling of some of the builtin logical and
17 # arithmetic dot operators in Fortran, for example `.AND.` and `.LE.`.
19 load_lib "fortran.exp"
21 if { [skip_fortran_tests] } { continue }
23 proc test_dot_operations {} {
25 foreach_with_prefix format { "uppercase" "lowercase" } {
26 if {$format == "uppercase"} {
57 gdb_test "p $true $and $true" " = .TRUE."
58 gdb_test "p $true $and $false" " = .FALSE."
59 gdb_test "p $false $and $true" " = .FALSE."
60 gdb_test "p $false $and $false" " = .FALSE."
63 gdb_test "p $true $or $true" " = .TRUE."
64 gdb_test "p $true $or $false" " = .TRUE."
65 gdb_test "p $false $or $true" " = .TRUE."
66 gdb_test "p $false $or $false" " = .FALSE."
69 gdb_test "p $not $true" " = .FALSE."
70 gdb_test "p $not $false" " = .TRUE."
73 gdb_test "p $true $eqv $true" " = .TRUE."
74 gdb_test "p $true $eqv $false" " = .FALSE."
75 gdb_test "p $false $eqv $true" " = .FALSE."
76 gdb_test "p $false $eqv $false" " = .TRUE."
79 gdb_test "p $true $neqv $true" " = .FALSE."
80 gdb_test "p $true $neqv $false" " = .TRUE."
81 gdb_test "p $false $neqv $true" " = .TRUE."
82 gdb_test "p $false $neqv $false" " = .FALSE."
85 gdb_test "p 5 $eq 4" " = .FALSE."
86 gdb_test "p 4 $eq 4" " = .TRUE."
89 gdb_test "p 5 $ne 4" " = .TRUE."
90 gdb_test "p 4 $ne 4" " = .FALSE."
93 gdb_test "p 5 $le 4" " = .FALSE."
94 gdb_test "p 4 $le 4" " = .TRUE."
95 gdb_test "p 3 $le 4" " = .TRUE."
98 gdb_test "p 5 $lt 4" " = .FALSE."
99 gdb_test "p 4 $lt 4" " = .FALSE."
100 gdb_test "p 3 $lt 4" " = .TRUE."
103 gdb_test "p 5 $ge 4" " = .TRUE."
104 gdb_test "p 4 $ge 4" " = .TRUE."
105 gdb_test "p 3 $ge 4" " = .FALSE."
108 gdb_test "p 5 $gt 4" " = .TRUE."
109 gdb_test "p 4 $gt 4" " = .FALSE."
110 gdb_test "p 3 $gt 4" " = .FALSE."
114 # Start of test script.
118 if [set_lang_fortran] then {
121 warning "$test_name tests suppressed." 0