* gdb.base/help.exp: Remove testing of individual command help text,
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / eval-skip.exp
1 # Copyright 1998-1999, 2007-2012 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 3 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, see <http://www.gnu.org/licenses/>.
15
16 # This file was written by Elena Zannoni (ezannoni@cygnus.com)
17
18 # This file is part of the gdb testsuite
19
20 #
21 # tests to cover evaluate_subexp_standard with the EVAL_SKIP flag set.
22 # this happens for instance when there is short circuit evaluation in the && and ||
23 # operators, or in the non returned part of a (x ? y: z) expression.
24 # the part that is not evaluated is parsed and evaluated anyway, but with
25 # the EVAL_SKIP flag set
26 #
27 # source file "int-type.c"
28 #
29
30
31 # Check to see if we have an executable to test. If not, then either we
32 # haven't tried to compile one, or the compilation failed for some reason.
33 # In either case, just notify the user and skip the tests in this file.
34
35 set testfile "int-type"
36 set srcfile ${testfile}.c
37 set binfile ${objdir}/${subdir}/${testfile}
38
39 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
40 untested eval-skip.exp
41 return -1
42 }
43
44 if [get_compiler_info] {
45 return -1
46 }
47
48 gdb_exit
49 gdb_start
50 gdb_reinitialize_dir $srcdir/$subdir
51 gdb_load ${binfile}
52
53
54 if ![runto_main] then {
55 perror "couldn't run to breakpoint"
56 continue
57 }
58
59 gdb_test_no_output "set variable x=14" "set variable x=14"
60 gdb_test_no_output "set variable y=2" "set variable y=2"
61 gdb_test_no_output "set variable z=2" "set variable z=2"
62 gdb_test_no_output "set variable w=3" "set variable w=3"
63
64 gdb_test "print (0 && (x+y))" ".$decimal = $false" \
65 "print value of (0 && (x+y))"
66
67 gdb_test "print (0 && (x-y))" ".$decimal = $false" \
68 "print value of (0 && (x-y))"
69
70 gdb_test "print (0 && (x*y))" ".$decimal = $false" \
71 "print value of (0 && (x*y))"
72
73 gdb_test "print (0 && (x/y))" ".$decimal = $false" \
74 "print value of (0 && (x/y))"
75
76 gdb_test "print (0 && (x%y))" ".$decimal = $false" \
77 "print value of (0 && (x%y))"
78
79 gdb_test "print (0 && (x&&y))" ".$decimal = $false" \
80 "print value of (0 && (x&&y))"
81
82 gdb_test "print (0 && (x||y))" ".$decimal = $false" \
83 "print value of (0 && (x||y))"
84
85 gdb_test "print (0 && (x&y))" ".$decimal = $false" \
86 "print value of (0 && (x&y))"
87
88 gdb_test "print (0 && (x|y))" ".$decimal = $false" \
89 "print value of (0 && (x|y))"
90
91 gdb_test "print (0 && (x^y))" ".$decimal = $false" \
92 "print value of (0 && (x^y))"
93
94 gdb_test "print (0 && (x < y))" ".$decimal = $false" \
95 "print value of (0 && (x < y))"
96
97 gdb_test "print (0 && (x <= y))" ".$decimal = $false" \
98 "print value of (0 && (x <= y))"
99
100 gdb_test "print (0 && (x>y))" ".$decimal = $false" \
101 "print value of (0 && (x>y))"
102
103 gdb_test "print (0 && (x>=y))" ".$decimal = $false" \
104 "print value of (0 && (x>=y))"
105
106 gdb_test "print (0 && (x==y))" ".$decimal = $false" \
107 "print value of (0 && (x==y))"
108
109 gdb_test "print (0 && (x!=y))" ".$decimal = $false" \
110 "print value of (0 && (x!=y))"
111
112 gdb_test "print (0 && (x<<31))" ".$decimal = $false" \
113 "print value of (0 && (x<<31))"
114
115 gdb_test "print (0 && (x>>31))" ".$decimal = $false" \
116 "print value of (0 && (x>>31))"
117
118 gdb_test "print (0 && (!x))" ".$decimal = $false" \
119 "print value of (0 && (!x))"
120
121 gdb_test "print (0 && (~x))" ".$decimal = $false" \
122 "print value of (0 && (~x))"
123
124 gdb_test "print (0 && (-x))" ".$decimal = $false" \
125 "print value of (0 && (-x))"
126
127 gdb_test "print (0 && (x++))" ".$decimal = $false" \
128 "print value of (0 && (x++))"
129
130 gdb_test "print (0 && (++x))" ".$decimal = $false" \
131 "print value of (0 && (++x))"
132
133 gdb_test "print (0 && (x--))" ".$decimal = $false" \
134 "print value of (0 && (x--))"
135
136 gdb_test "print (0 && (--x))" ".$decimal = $false" \
137 "print value of (0 && (--x))"
138
139 gdb_test "print (0 && (x+=7))" ".$decimal = $false" \
140 "print value of (0 && (x+=7))"
141
142 gdb_test "print (0 && (x=y))" ".$decimal = $false" \
143 "print value of (0 && (x=y))"
144
145
146 gdb_exit
147 return 0
148
149
150
151
152
153
154
This page took 0.037865 seconds and 4 git commands to generate.