]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.base/enumval.exp
Update copyright year range in all GDB files
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / enumval.exp
CommitLineData
efd4ebc3
JK
1# This testcase is part of GDB, the GNU debugger.
2
3666a048 3# Copyright 2012-2021 Free Software Foundation, Inc.
efd4ebc3
JK
4
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
289f9037 18standard_testfile
efd4ebc3 19
5b362f04 20if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
efd4ebc3
JK
21 return -1
22}
23
24# Check the real contents.
4648e588
JK
25
26set test "print e"
27gdb_test_multiple $test $test {
28 -re " = J\r\n$gdb_prompt $" {
29 pass $test
30 }
31 -re " = 4294967295\r\n$gdb_prompt $" {
32 if {[test_compiler_info {gcc-[0-3]-*}]
33 || [test_compiler_info {gcc-4-[0-6]-*}]} {
34 xfail $test
35 } else {
36 fail $test
37 }
38 }
39}
40
41set test "print f"
42gdb_test_multiple $test $test {
43 -re " = K\r\n$gdb_prompt $" {
44 pass $test
45 }
46 -re " = -1152921504606846976\r\n$gdb_prompt $" {
47 if {[test_compiler_info {gcc-[0-3]-*}]
48 || [test_compiler_info {gcc-4-[0-6]-*}]} {
49 xfail $test
50 } else {
51 fail $test
52 }
53 }
54}
efd4ebc3
JK
55
56gdb_test "print J" "= J"
4648e588
JK
57
58set test "print K"
59gdb_test_multiple $test $test {
60 -re " = K\r\n$gdb_prompt $" {
61 pass $test
62 }
63 -re " = <optimized out>\r\n$gdb_prompt $" {
64 if {[test_compiler_info {gcc-[0-3]-*}]
65 || [test_compiler_info {gcc-4-[0-6]-*}]} {
66 xfail $test
67 } else {
68 fail $test
69 }
70 }
71}
89e63ee4
DE
72
73# gold/15021
74# With -fdebug-types-section, Gold's .gdb_index entry for ZERO refers to the
75# CU, but the CU doesn't use the TU (type unit) that defines ZERO.
76# Thus gdb has to read in every TU for the CU.
77gdb_test "p ZERO" "ZERO"