OLD | NEW |
1 # Copyright 1998-1999, 2001, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 1998-1999, 2001, 2007-2012 Free Software Foundation, Inc. |
2 | 2 |
3 # This program is free software; you can redistribute it and/or modify | 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 | 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 | 5 # the Free Software Foundation; either version 3 of the License, or |
6 # (at your option) any later version. | 6 # (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 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/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
16 # This file was written by Elena Zannoni (ezannoni@cygnus.com) | 16 # This file was written by Elena Zannoni (ezannoni@cygnus.com) |
17 # Rewritten to use gdb_test by Michael Chastain (chastain@redhat.com) | 17 # Rewritten to use gdb_test by Michael Chastain (chastain@redhat.com) |
18 | 18 |
19 # This file is part of the gdb testsuite | 19 # This file is part of the gdb testsuite |
20 # | 20 # |
21 # tests for correctness of arithmetic operators, associativity and precedence | 21 # tests for correctness of arithmetic operators, associativity and precedence |
22 # with integer type variables | 22 # with integer type variables |
23 # | 23 # |
24 | 24 |
25 if $tracelevel then { | |
26 strace $tracelevel | |
27 } | |
28 | |
29 # | 25 # |
30 # test running programs | 26 # test running programs |
31 # | 27 # |
32 | 28 |
33 set testfile "int-type" | 29 set testfile "int-type" |
34 set srcfile ${testfile}.c | 30 set srcfile ${testfile}.c |
35 set binfile ${objdir}/${subdir}/${testfile} | 31 set binfile ${objdir}/${subdir}/${testfile} |
36 | 32 |
37 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug nowarnings}] != "" } { | 33 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug nowarnings}] != "" } { |
38 untested arithmet.exp | 34 untested arithmet.exp |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 gdb_test "print x*y/z" "20" | 99 gdb_test "print x*y/z" "20" |
104 gdb_test "print x*y%w" "1" | 100 gdb_test "print x*y%w" "1" |
105 gdb_test "print x/y%w" "2" | 101 gdb_test "print x/y%w" "2" |
106 | 102 |
107 # test use of parentheses to enforce different order of evaluation | 103 # test use of parentheses to enforce different order of evaluation |
108 | 104 |
109 gdb_test "print x-(y+w)" "3" | 105 gdb_test "print x-(y+w)" "3" |
110 gdb_test "print x/(y*w)" "0" | 106 gdb_test "print x/(y*w)" "0" |
111 gdb_test "print x-(y/w)" "9" | 107 gdb_test "print x-(y/w)" "9" |
112 gdb_test "print (x+y)*w" "42" | 108 gdb_test "print (x+y)*w" "42" |
OLD | NEW |