]>
Commit | Line | Data |
---|---|---|
b811d2c2 | 1 | # Copyright 2007-2020 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 | |
5b362f04 | 19 | if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90 quiet}]} { |
be444858 DJ |
20 | return -1 |
21 | } | |
22 | ||
86cd6bc8 AKS |
23 | if ![fortran_runto_main] then { |
24 | perror "Couldn't run to main" | |
be444858 DJ |
25 | continue |
26 | } | |
27 | ||
be444858 | 28 | |
1db455a7 AB |
29 | gdb_breakpoint [gdb_get_line_number "stop"] |
30 | gdb_continue_to_breakpoint "continue" | |
31 | ||
32 | gdb_test "print c" " = \\(1000,-50\\)" | |
33 | gdb_test "print c4" " = \\(1000,-50\\)" | |
34 | gdb_test "print c8" " = \\(321,-22\\)" | |
35 | gdb_test "print dc" " = \\(321,-22\\)" | |
36 | ||
1db455a7 AB |
37 | gdb_test "print c16" " = \\(-874,19\\)" |
38 | ||
39 | gdb_test "whatis c" "type = complex\\(kind=4\\)" | |
40 | gdb_test "print \$_creal (c)" " = 1000" | |
7549fed8 TV |
41 | with_test_prefix "c" { |
42 | gdb_test "whatis \$" " = real" | |
43 | } | |
1db455a7 AB |
44 | |
45 | gdb_test "whatis c4" "type = complex\\(kind=4\\)" | |
46 | gdb_test "print \$_creal (c4)" " = 1000" | |
7549fed8 TV |
47 | with_test_prefix "c4" { |
48 | gdb_test "whatis \$" " = real" | |
49 | } | |
1db455a7 AB |
50 | gdb_test "whatis c8" "type = complex\\(kind=8\\)" |
51 | gdb_test "print \$_creal (c8)" " = 321" | |
7549fed8 TV |
52 | with_test_prefix "c8" { |
53 | gdb_test "whatis \$" " = real\\*8" | |
54 | } | |
1db455a7 AB |
55 | gdb_test "whatis dc" "type = complex\\(kind=8\\)" |
56 | gdb_test "print \$_creal (dc)" " = 321" | |
7549fed8 TV |
57 | with_test_prefix "dc" { |
58 | gdb_test "whatis \$" " = real\\*8" | |
59 | } | |
1db455a7 AB |
60 | |
61 | gdb_test "whatis c16" "type = complex\\(kind=16\\)" | |
1db455a7 | 62 | gdb_test "print \$_creal (c16)" " = -874" |
7549fed8 TV |
63 | with_test_prefix "c16" { |
64 | gdb_test "whatis \$" " = real\\*16" | |
65 | } | |
be444858 | 66 |