Initial creation of sourceware repository
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / long_long.exp
CommitLineData
c906108c
SS
1# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
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
5# the Free Software Foundation; either version 2 of the License, or
6# (at your option) any later version.
7#
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.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
16
17# Please email any bugs, comments, and/or additions to this file to:
18# bug-gdb@prep.ai.mit.edu
19
20
21# long_long.exp Test printing of 64-bit things in 32-bit gdb.
22# Also test differnet kinds of formats.
23#
24if $tracelevel then {
25 strace $tracelevel
26}
27
28set testfile long_long
29set srcfile ${srcdir}/${subdir}/${testfile}.c
30set binfile ${objdir}/${subdir}/${testfile}
31
32# What compiler are we using?
33#
34if [get_compiler_info ${binfile}] {
35 return -1
36}
37
38if {$gcc_compiled == 0} {
39 if [istarget "hppa*-hp-hpux*"] then {
40 ### FIXME +e only works with HP's compiler
41 set additional_flags "additional_flags=+e -w"
42 } else {
43 # don't know what the compiler is, hope it supports long long!
44 set additional_flags "additional_flags=-w"
45 }
46} else {
47 set additional_flags "additional_flags=-w"
48}
49
50if { [gdb_compile "${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
51 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
52}
53
54# use this to debug:
55#log_user 1
56
57gdb_exit
58gdb_start
59gdb_reinitialize_dir $srcdir/$subdir
60gdb_load ${binfile}
61
62if { ![runto known_types] } then {
63 fail "run to known_types"
64 return
65}
66
67gdb_test "n 4" ".*34.*" "get to known place"
68
69# Check the hack for long long prints.
70#
71gdb_test "p/x hex" ".*0x0.*" "default print hex"
72gdb_test "p/x dec" ".*0xab54a98ceb1f0ad2.*" "default print dec"
73gdb_test "p/x bin" ".*0x123456789abcdef.*" "default print bin"
74gdb_test "p/x oct" ".*0xa72ee53977053977.*" "default print oct"
75
76gdb_test "p/x hex" ".*0x0.*" "hex print"
77gdb_test "p/u dec" ".*12345678901234567890.*" "decimal print"
78gdb_test "p/t bin" ".*100100011010001010110011110001001101010111100110111101111.*" "binary print"
79gdb_test "p/o oct" ".*01234567123456701234567.*" "octal print"
80
81# Try all the combinations to bump up coverage.
82#
83gdb_test "p/d oct" ".*12046818088235383159.*" ""
84gdb_test "p/u oct" ".*0xa72ee53977053977.*" ""
85gdb_test "p/o oct" ".*.*" ""
86gdb_test "p/t oct" ".*1010011100101110111001010011100101110111000001010011100101110111.*" ""
87gdb_test "p/a oct" ".*That operation is not available.*" ""
88gdb_test "p/c oct" ".*0xa72ee53977053977.*" ""
89gdb_test "p/f oct" ".*-5.9822653797615723e-120.*" ""
90
91gdb_test "p/d *(int *)&oct" ".*-1490098887.*" ""
92gdb_test "p/u *(int *)&oct" ".*2804868409.*" ""
93gdb_test "p/o *(int *)&oct" ".*024713562471.*" ""
94gdb_test "p/t *(int *)&oct" ".*10100111001011101110010100111001.*" ""
95gdb_test "p/a *(int *)&oct" ".*0xa72ee539.*" ""
96gdb_test "p/c *(int *)&oct" ".*57 '9'.*" ""
97gdb_test "p/f *(int *)&oct" ".*-2.42716126e-15.*" ""
98
99gdb_test "p/d *(short *)&oct" ".*-22738.*" ""
100gdb_test "p/u *(short *)&oct" ".*42798.*" ""
101gdb_test "p/o *(short *)&oct" ".*0123456.*" ""
102gdb_test "p/t *(short *)&oct" ".*1010011100101110.*" ""
103gdb_test "p/a *(short *)&oct" ".*0xffffa72e.*" ""
104gdb_test "p/c *(short *)&oct" ".* 46 '.'.*" ""
105gdb_test "p/a **short *)&oct" ".*0xffffa72e <.*" ""
106gdb_test "p/f *(short *)&oct" ".*-22738.*" ""
107
108gdb_test "x/x &oct" ".*0xa72ee539.*" ""
109gdb_test "x/d &oct" ".*.-1490098887*" ""
110gdb_test "x/u &oct" ".*2804868409.*" ""
111gdb_test "x/o &oct" ".*024713562471.*" ""
112gdb_test "x/t &oct" ".*10100111001011101110010100111001.*" ""
113gdb_test "x/a &oct" ".*0xa72ee539 <.*" ""
114gdb_test "x/c &oct" ".*-89 'M-''.*" ""
115gdb_test "x/f &oct" ".*-5.9822653797615723e-120.*" ""
116
117gdb_test "x/2x &oct" ".*.*" ""
118gdb_test "x/2d &oct" ".*.*" ""
119gdb_test "x/2u &oct" ".*.*" ""
120gdb_test "x/2o &oct" ".*.*" ""
121gdb_test "x/2t &oct" ".*.*" ""
122gdb_test "x/2a &oct" ".*.*" ""
123gdb_test "x/2c &oct" ".*.*" ""
124gdb_test "x/2f &oct" ".*.*" ""
125
126gdb_test "x/2bx &oct" ".*.*" ""
127gdb_test "x/2bd &oct" ".*.*" ""
128gdb_test "x/2bu &oct" ".*.*" ""
129gdb_test "x/2bo &oct" ".*.*" ""
130gdb_test "x/2bt &oct" ".*.*" ""
131gdb_test "x/2ba &oct" ".*.*" ""
132gdb_test "x/2bc &oct" ".*.*" ""
133gdb_test "x/2bf &oct" ".*.*" ""
134
135gdb_test "x/2hx &oct" ".*.*" ""
136gdb_test "x/2hd &oct" ".*.*" ""
137gdb_test "x/2hu &oct" ".*.*" ""
138gdb_test "x/2ho &oct" ".*.*" ""
139gdb_test "x/2ht &oct" ".*.*" ""
140gdb_test "x/2ha &oct" ".*.*" ""
141gdb_test "x/2hc &oct" ".*.*" ""
142gdb_test "x/2hf &oct" ".*.*" ""
143
144gdb_test "x/2wx &oct" ".*.*" ""
145gdb_test "x/2wd &oct" ".*.*" ""
146gdb_test "x/2wu &oct" ".*.*" ""
147gdb_test "x/2wo &oct" ".*.*" ""
148gdb_test "x/2wt &oct" ".*.*" ""
149gdb_test "x/2wa &oct" ".*.*" ""
150gdb_test "x/2wc &oct" ".*.*" ""
151gdb_test "x/2wf &oct" ".*.*" ""
152
153gdb_test "x/2gx &oct" ".*.*" ""
154gdb_test "x/2gd &oct" ".*.*" ""
155gdb_test "x/2gu &oct" ".*.*" ""
156gdb_test "x/2go &oct" ".*.*" ""
157gdb_test "x/2gt &oct" ".*.*" ""
158gdb_test "x/2ga &oct" ".*.*" ""
159gdb_test "x/2gc &oct" ".*.*" ""
160gdb_test "x/2gf &oct" ".*.*" ""
161
162gdb_exit
163return 0
This page took 0.028352 seconds and 4 git commands to generate.