1 # Copyright
2007-2022 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 standard_testfile .f90
19 if {[skip_fortran_tests
]} { return -1 }
21 if {[prepare_for_testing
"failed to prepare" $testfile $srcfile {debug f90 quiet}]} {
25 if ![fortran_runto_main
] then {
26 perror
"Couldn't run to main"
30 # Depending
on the compiler being used
, the type names can be printed differently.
31 set complex4
[fortran_complex4
]
32 set complex8
[fortran_complex8
]
33 set complex16
[fortran_complex16
]
35 gdb_breakpoint
[gdb_get_line_number
"stop"]
36 gdb_continue_to_breakpoint
"continue"
38 gdb_test
"print c" " = \\(1000,-50\\)"
39 gdb_test
"print c4" " = \\(1000,-50\\)"
40 gdb_test
"print c8" " = \\(321,-22\\)"
41 gdb_test
"print dc" " = \\(321,-22\\)"
43 gdb_test
"print c16" " = \\(-874,19\\)"
44 gdb_test
"print ci" " = \\(-4,12\\)"
46 gdb_test
"whatis c" "type = $complex4"
47 gdb_test
"print \$_creal (c)" " = 1000"
48 with_test_prefix
"c" {
49 gdb_test
"whatis \$" " = real\\*4"
52 gdb_test
"whatis c4" "type = $complex4"
53 gdb_test
"print \$_creal (c4)" " = 1000"
54 with_test_prefix
"c4" {
55 gdb_test
"whatis \$" " = real\\*4"
57 gdb_test
"whatis c8" "type = $complex8"
58 gdb_test
"print \$_creal (c8)" " = 321"
59 with_test_prefix
"c8" {
60 gdb_test
"whatis \$" " = real\\*8"
62 gdb_test
"whatis dc" "type = $complex8"
63 gdb_test
"print \$_creal (dc)" " = 321"
64 with_test_prefix
"dc" {
65 gdb_test
"whatis \$" " = real\\*8"
68 gdb_test
"whatis c16" "type = $complex16"
69 gdb_test
"print \$_creal (c16)" " = -874"
70 with_test_prefix
"c16" {
71 gdb_test
"whatis \$" " = real\\*16"
74 gdb_test
"whatis ci" "type = $complex4"
75 gdb_test
"print \$_creal (ci)" " = -4"
76 with_test_prefix
"ci" {
77 gdb_test
"whatis \$" " = real\\*4"