Various spelling fixes.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / whatis-exp.exp
1 # Copyright 1998, 1999, 2007, 2008, 2009, 2010, 2011
2 # Free Software Foundation, Inc.
3
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17 # This file was written by Elena Zannoni (ezannoni@cygnus.com)
18
19 # This file is part of the gdb testsuite
20 #
21 # tests for whatis command on expressions.
22 # used in file eval.c. This flavor of whatis
23 # command performs evaluation of expressions w/o actually
24 # computing the value, but just the type
25 # of the result. It goes through the evaluate_subexp_standard
26 # with the EVAL_AVOID_SIDE_EFFECTS flag rather than EVAL_NORMAL
27 #
28
29 if $tracelevel then {
30 strace $tracelevel
31 }
32
33 #
34 # test running programs
35 #
36
37 if { [prepare_for_testing whatis-exp.exp whatis-exp int-type.c {debug nowarnings}] } {
38 return -1
39 }
40
41 #
42 # set it up at a breakpoint so we can play with the variable values
43 #
44
45 if ![runto_main] then {
46 perror "couldn't run to breakpoint"
47 continue
48 }
49
50 #
51 # test expressions with "int" types
52 #
53
54 gdb_test_no_output "set variable x=14" "set variable x=14"
55 gdb_test_no_output "set variable y=2" "set variable y=2"
56 gdb_test_no_output "set variable z=2" "set variable z=2"
57 gdb_test_no_output "set variable w=3" "set variable w=3"
58
59 gdb_test "print x" " = 14" "print value of x"
60 gdb_test "print y" " = 2" "print value of y"
61 gdb_test "print z" " = 2" "print value of z"
62 gdb_test "print w" " = 3" "print value of w"
63
64 gdb_test "whatis x+y" "type = int" "whatis value of x+y"
65 gdb_test "whatis x-y" "type = int" "whatis value of x-y"
66 gdb_test "whatis x*y" "type = int" "whatis value of x*y"
67 gdb_test "whatis x/y" "type = int" "whatis value of x/y"
68 gdb_test "whatis x%y" "type = int" "whatis value of x%y"
69 gdb_test "whatis x=y" "type = int" "whatis value of x=y"
70
71 gdb_test "whatis x+=2" "type = int" "whatis value of x+=2"
72 gdb_test "whatis ++x" "type = int" "whatis value of ++x"
73 gdb_test "whatis --x" "type = int" "whatis value of --x"
74 gdb_test "whatis x++" "type = int" "whatis value of x++"
75 gdb_test "whatis x--" "type = int" "whatis value of x--"
76
77 gdb_exit
78 return 0
This page took 0.031581 seconds and 4 git commands to generate.