]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | # Copyright 2007-2024 Free Software Foundation, Inc. |
be444858 DJ |
2 | |
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 | |
e22f8b7c | 5 | # the Free Software Foundation; either version 3 of the License, or |
be444858 | 6 | # (at your option) any later version. |
e22f8b7c | 7 | # |
be444858 DJ |
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. | |
e22f8b7c | 12 | # |
be444858 | 13 | # You should have received a copy of the GNU General Public License |
e22f8b7c | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
be444858 | 15 | |
1db455a7 | 16 | standard_testfile .f90 |
86cd6bc8 | 17 | load_lib fortran.exp |
be444858 | 18 | |
57b7402d | 19 | require allow_fortran_tests |
a54a7f13 | 20 | |
5b362f04 | 21 | if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90 quiet}]} { |
be444858 DJ |
22 | return -1 |
23 | } | |
24 | ||
49bb4744 | 25 | if {![fortran_runto_main]} { |
cdd42066 | 26 | return |
be444858 DJ |
27 | } |
28 | ||
c5cd900e AKS |
29 | # Depending on the compiler being used, the type names can be printed differently. |
30 | set complex4 [fortran_complex4] | |
31 | set complex8 [fortran_complex8] | |
32 | set complex16 [fortran_complex16] | |
be444858 | 33 | |
1db455a7 AB |
34 | gdb_breakpoint [gdb_get_line_number "stop"] |
35 | gdb_continue_to_breakpoint "continue" | |
36 | ||
37 | gdb_test "print c" " = \\(1000,-50\\)" | |
38 | gdb_test "print c4" " = \\(1000,-50\\)" | |
39 | gdb_test "print c8" " = \\(321,-22\\)" | |
40 | gdb_test "print dc" " = \\(321,-22\\)" | |
41 | ||
1db455a7 | 42 | gdb_test "print c16" " = \\(-874,19\\)" |
27e8f72f | 43 | gdb_test "print ci" " = \\(-4,12\\)" |
1db455a7 | 44 | |
c5cd900e | 45 | gdb_test "whatis c" "type = $complex4" |
1db455a7 | 46 | gdb_test "print \$_creal (c)" " = 1000" |
7549fed8 | 47 | with_test_prefix "c" { |
87abd982 | 48 | gdb_test "whatis \$" " = real\\*4" |
7549fed8 | 49 | } |
1db455a7 | 50 | |
c5cd900e | 51 | gdb_test "whatis c4" "type = $complex4" |
1db455a7 | 52 | gdb_test "print \$_creal (c4)" " = 1000" |
7549fed8 | 53 | with_test_prefix "c4" { |
87abd982 | 54 | gdb_test "whatis \$" " = real\\*4" |
7549fed8 | 55 | } |
c5cd900e | 56 | gdb_test "whatis c8" "type = $complex8" |
1db455a7 | 57 | gdb_test "print \$_creal (c8)" " = 321" |
7549fed8 TV |
58 | with_test_prefix "c8" { |
59 | gdb_test "whatis \$" " = real\\*8" | |
60 | } | |
c5cd900e | 61 | gdb_test "whatis dc" "type = $complex8" |
1db455a7 | 62 | gdb_test "print \$_creal (dc)" " = 321" |
7549fed8 TV |
63 | with_test_prefix "dc" { |
64 | gdb_test "whatis \$" " = real\\*8" | |
65 | } | |
1db455a7 | 66 | |
c5cd900e | 67 | gdb_test "whatis c16" "type = $complex16" |
1db455a7 | 68 | gdb_test "print \$_creal (c16)" " = -874" |
7549fed8 TV |
69 | with_test_prefix "c16" { |
70 | gdb_test "whatis \$" " = real\\*16" | |
71 | } | |
be444858 | 72 | |
27e8f72f NCK |
73 | gdb_test "whatis ci" "type = $complex4" |
74 | gdb_test "print \$_creal (ci)" " = -4" | |
75 | with_test_prefix "ci" { | |
76 | gdb_test "whatis \$" " = real\\*4" | |
77 | } |