Files
TheRock/debug-tools/rocgdb/source/gdb/testsuite/gdb.fortran/dot-ops.exp
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

162 lines
4.2 KiB
Plaintext

# Copyright 2019-2024 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This file tests GDB's handling of some of the builtin logical and
# arithmetic dot operators in Fortran, for example `.AND.` and `.LE.`.
load_lib "fortran.exp"
require allow_fortran_tests
proc test_dot_operations {} {
foreach_with_prefix format { "uppercase" "lowercase" } {
if {$format == "uppercase"} {
set true ".TRUE."
set false ".FALSE."
set and ".AND."
set or ".OR."
set not ".NOT."
set eqv ".EQV."
set neqv ".NEQV."
set xor ".XOR."
set eq ".EQ."
set ne ".NE."
set le ".LE."
set ge ".GE."
set lt ".LT."
set gt ".GT."
} else {
set true ".true."
set false ".false."
set and ".and."
set or ".or."
set not ".not."
set eqv ".eqv."
set neqv ".neqv."
set xor ".xor."
set eq ".eq."
set ne ".ne."
set le ".le."
set ge ".ge."
set lt ".lt."
set gt ".gt."
}
# Logical AND
gdb_test "p $true $and $true" " = .TRUE."
gdb_test "p $true $and $false" " = .FALSE."
gdb_test "p $false $and $true" " = .FALSE."
gdb_test "p $false $and $false" " = .FALSE."
# Logical OR
gdb_test "p $true $or $true" " = .TRUE."
gdb_test "p $true $or $false" " = .TRUE."
gdb_test "p $false $or $true" " = .TRUE."
gdb_test "p $false $or $false" " = .FALSE."
# Logical NOT
gdb_test "p $not $true" " = .FALSE."
gdb_test "p $not $false" " = .TRUE."
# Logical EQV
gdb_test "p $true $eqv $true" " = .TRUE."
gdb_test "p $true $eqv $false" " = .FALSE."
gdb_test "p $false $eqv $true" " = .FALSE."
gdb_test "p $false $eqv $false" " = .TRUE."
# Logical NEQV
gdb_test "p $true $neqv $true" " = .FALSE."
gdb_test "p $true $neqv $false" " = .TRUE."
gdb_test "p $false $neqv $true" " = .TRUE."
gdb_test "p $false $neqv $false" " = .FALSE."
# And the legacy alias for NEQV, XOR
gdb_test "p $true $xor $true" " = .FALSE."
gdb_test "p $true $xor $false" " = .TRUE."
gdb_test "p $false $xor $true" " = .TRUE."
gdb_test "p $false $xor $false" " = .FALSE."
# Arithmetic EQ
gdb_test "p 5 $eq 4" " = .FALSE."
gdb_test "p 4 $eq 4" " = .TRUE."
# Arithmetic NE
gdb_test "p 5 $ne 4" " = .TRUE."
gdb_test "p 4 $ne 4" " = .FALSE."
# Arithmetic LE
gdb_test "p 5 $le 4" " = .FALSE."
gdb_test "p 4 $le 4" " = .TRUE."
gdb_test "p 3 $le 4" " = .TRUE."
# Arithmetic LT
gdb_test "p 5 $lt 4" " = .FALSE."
gdb_test "p 4 $lt 4" " = .FALSE."
gdb_test "p 3 $lt 4" " = .TRUE."
# Arithmetic GE
gdb_test "p 5 $ge 4" " = .TRUE."
gdb_test "p 4 $ge 4" " = .TRUE."
gdb_test "p 3 $ge 4" " = .FALSE."
# Arithmetic GT
gdb_test "p 5 $gt 4" " = .TRUE."
gdb_test "p 4 $gt 4" " = .FALSE."
gdb_test "p 3 $gt 4" " = .FALSE."
}
# Now test the symbol based comparison operators.
# Arithmetic EQ
gdb_test "p 5 == 4" " = .FALSE."
gdb_test "p 4 == 4" " = .TRUE."
# Arithmetic NE
gdb_test "p 5 /= 4" " = .TRUE."
gdb_test "p 4 /= 4" " = .FALSE."
# Arithmetic LE
gdb_test "p 5 <= 4" " = .FALSE."
gdb_test "p 4 <= 4" " = .TRUE."
gdb_test "p 3 <= 4" " = .TRUE."
# Arithmetic LT
gdb_test "p 5 < 4" " = .FALSE."
gdb_test "p 4 < 4" " = .FALSE."
gdb_test "p 3 < 4" " = .TRUE."
# Arithmetic GE
gdb_test "p 5 >= 4" " = .TRUE."
gdb_test "p 4 >= 4" " = .TRUE."
gdb_test "p 3 >= 4" " = .FALSE."
# Arithmetic GT
gdb_test "p 5 > 4" " = .TRUE."
gdb_test "p 4 > 4" " = .FALSE."
gdb_test "p 3 > 4" " = .FALSE."
}
# Start of test script.
clean_restart
if {[set_lang_fortran]} {
test_dot_operations
} else {
warning "$test_name tests suppressed." 0
}