* lib/gdb.exp (skip_altivec_tests, skip_vsx_tests)
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / all-bin.exp
CommitLineData
0b302171 1# Copyright 1998-1999, 2007-2012 Free Software Foundation, Inc.
c906108c
SS
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
c906108c 6# (at your option) any later version.
e22f8b7c 7#
c906108c
SS
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#
c906108c 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/>.
c906108c 15
c906108c
SS
16# This file was written by Elena Zannoni (ezannoni@cygnus.com)
17
18# This file is part of the gdb testsuite
19#
20# tests for arithmetic, logical and relational operators
21# with mixed types
22#
23
24
25
c906108c
SS
26#
27# test running programs
28#
c906108c
SS
29
30set testfile "all-types"
31set srcfile ${testfile}.c
32set binfile ${objdir}/${subdir}/${testfile}
33
fc91c6c2 34if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
b60f0898
JB
35 untested all-bin.exp
36 return -1
c906108c
SS
37 }
38
4c93b1db 39if [get_compiler_info] {
085dd6e6
JM
40 return -1
41}
42
c906108c
SS
43gdb_exit
44gdb_start
45gdb_reinitialize_dir $srcdir/$subdir
46gdb_load ${binfile}
47
48
49#
50# set it up at a breakpoint so we can play with the variable values
51#
52
53if ![runto_main] then {
54 perror "couldn't run to breakpoint"
55 continue
56}
57
58gdb_test "next" "return 0;" "continuing after dummy()"
59
6acb16a2
MS
60gdb_test "print v_int+v_char" " = 71" "print value of v_int+v_char"
61
62gdb_test "print v_int+v_short" " = 9" "print value of v_int+v_short"
63
64gdb_test "print v_int+v_signed_char" " = 72" \
65 "print value of v_int+v_signed_char"
66
67gdb_test "print v_int+v_unsigned_char" " = 73" \
68 "print value of v_int+v_unsigned_char"
69
70gdb_test "print v_int+v_signed_short" " = 10" \
71 "print value of v_int+v_signed_short"
72
73gdb_test "print v_int+v_unsigned_short" " = 11" \
74 "print value of v_int+v_unsigned_short"
75
76gdb_test "print v_int+v_signed_int" " = 13" \
77 "print value of v_int+v_signed_int"
78
79gdb_test "print v_int+v_unsigned_int" " = 14" \
80 "print value of v_int+v_unsigned_int"
81
82gdb_test "print v_int+v_long" " = 15" "print value of v_int+v_long"
83
84gdb_test "print v_int+v_signed_long" " = 16" \
85 "print value of v_int+v_signed_long"
86
87gdb_test "print v_int+v_unsigned_long" " = 17" \
88 "print value of v_int+v_unsigned_long"
89
90gdb_test "print v_int+v_float" " = 106.34343.*" \
91 "print value of v_int+v_float"
92
93gdb_test "print v_int+v_double" " = 206.565.*" \
94 "print value of v_int+v_double"
c906108c
SS
95
96
97#
98# test the relational operators with mixed types
99#
100
6acb16a2
MS
101gdb_test "print v_int <= v_char" " = 1" "print value of v_int<=v_char"
102
103gdb_test "print v_int <= v_short" " = $false" \
104 "print value of v_int<=v_short"
105
106gdb_test "print v_int <= v_signed_char" " = 1" \
107 "print value of v_int<=v_signed_char"
108
109gdb_test "print v_int <= v_unsigned_char" " = 1" \
110 "print value of v_int<=v_unsigned_char"
111
112gdb_test "print v_int <= v_signed_short" " = $false" \
113 "print value of v_int<=v_signed_short"
114
115gdb_test "print v_int <= v_unsigned_short" " = $false" \
116 "print value of v_int<=v_unsigned_short"
c906108c 117
6acb16a2
MS
118gdb_test "print v_int <= v_signed_int" " = $true" \
119 "print value of v_int<=v_signed_int"
c906108c 120
6acb16a2
MS
121gdb_test "print v_int <= v_unsigned_int" " = $true" \
122 "print value of v_int<=v_unsigned_int"
123
124gdb_test "print v_int <= v_long" " = $true" "print value of v_int<=v_long"
125
126gdb_test "print v_int <= v_signed_long" " = $true" \
127 "print value of v_int<=v_signed_long"
128
129gdb_test "print v_int <= v_unsigned_long" " = $true" \
130 "print value of v_int<=v_unsigned_long"
131
132gdb_test "print v_int <= v_float" " = $true" "print value of v_int<=v_float"
133
134gdb_test "print v_int <= v_double" " = $true" \
135 "print value of v_int<=v_double"
c906108c
SS
136
137#
138# test the logical operators with mixed types
139#
140
6acb16a2
MS
141gdb_test_no_output "set variable v_char=0" "set v_char=0"
142gdb_test_no_output "set variable v_double=0.0" "set v_double=0"
143gdb_test_no_output "set variable v_unsigned_long=0" "set v_unsigned_long=0"
144
145gdb_test "print v_int && v_char" " = $false" "print value of v_int&&v_char"
146
147gdb_test "print v_int && v_short" " = $true" "print value of v_int&&v_short"
148
149gdb_test "print v_int && v_signed_char" " = $true" \
150 "print value of v_int&&v_signed_char"
151
152gdb_test "print v_int && v_unsigned_char" " = $true" \
153 "print value of v_int&&v_unsigned_char"
154
155gdb_test "print v_int && v_signed_short" " = $true" \
156 "print value of v_int&&v_signed_short"
157
158gdb_test "print v_int && v_unsigned_short" " = $true" \
159 "print value of v_int&&v_unsigned_short"
160
161gdb_test "print v_int && v_signed_int" " = $true" \
162 "print value of v_int&&v_signed_int"
163
164gdb_test "print v_int && v_unsigned_int" " = $true" \
165 "print value of v_int&&v_unsigned_int"
166
167gdb_test "print v_int && v_long" " = $true" "print value of v_int&&v_long"
168
169gdb_test "print v_int && v_signed_long" " = $true" \
170 "print value of v_int&&v_signed_long"
171
172gdb_test "print v_int && v_unsigned_long" " = $false" \
173 "print value of v_int&&v_unsigned_long"
174
175gdb_test "print v_int && v_float" " = $true" "print value of v_int&&v_float"
176
177gdb_test "print v_int && v_double" " = $false" \
178 "print value of v_int&&v_double"
c906108c
SS
179
180
181
182
183
This page took 1.211086 seconds and 4 git commands to generate.