OLD | NEW |
1 # Copyright 2008-2012 Free Software Foundation, Inc. | 1 # Copyright 2008-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 # Simple test for alternate punctuators. | 16 # Simple test for alternate punctuators. |
17 | 17 |
18 # This file is part of the gdb testsuite | 18 # This file is part of the gdb testsuite |
19 | 19 |
20 if $tracelevel then { | |
21 strace $tracelevel | |
22 } | |
23 | |
24 if { [skip_cplus_tests] } { continue } | 20 if { [skip_cplus_tests] } { continue } |
25 | 21 |
26 gdb_exit | 22 gdb_exit |
27 gdb_start | 23 gdb_start |
28 | 24 |
29 gdb_test_no_output "set lang c++" | 25 gdb_test_no_output "set lang c++" |
30 gdb_test "print (0x5a5a bitand 0xaaaa) == (0x5a5a & 0xaaaa)" " = true" | 26 gdb_test "print (0x5a5a bitand 0xaaaa) == (0x5a5a & 0xaaaa)" " = true" |
31 gdb_test "print (0x5a5a bitor 0xaaaa) == (0x5a5a | 0xaaaa)" " = true" | 27 gdb_test "print (0x5a5a bitor 0xaaaa) == (0x5a5a | 0xaaaa)" " = true" |
32 gdb_test "print (0x5a5a xor 0xaaaa) == (0x5a5a ^ 0xaaaa)" " = true" | 28 gdb_test "print (0x5a5a xor 0xaaaa) == (0x5a5a ^ 0xaaaa)" " = true" |
33 gdb_test "print (0x5a5a and 0xaaaa) == (0x5a5a && 0xaaaa)" " = true" | 29 gdb_test "print (0x5a5a and 0xaaaa) == (0x5a5a && 0xaaaa)" " = true" |
34 gdb_test "print (0x5a5a or 0xaaaa) == (0x5a5a || 0xaaaa)" " = true" | 30 gdb_test "print (0x5a5a or 0xaaaa) == (0x5a5a || 0xaaaa)" " = true" |
35 gdb_test "print (not not 0xaaaa) == (!!0xaaaa)" " = true" | 31 gdb_test "print (not not 0xaaaa) == (!!0xaaaa)" " = true" |
36 gdb_test "print (compl 0xaaaa) == (~0xaaaa)" " = true" | 32 gdb_test "print (compl 0xaaaa) == (~0xaaaa)" " = true" |
37 | 33 |
38 gdb_test_no_output "set \$u = 0x5a5a" "set \$u 1" | 34 gdb_test_no_output "set \$u = 0x5a5a" "set \$u 1" |
39 gdb_test_no_output "set \$v = 0x5a5a" "set \$v 1" | 35 gdb_test_no_output "set \$v = 0x5a5a" "set \$v 1" |
40 gdb_test "print (\$u not_eq 0xaaaa) == (\$v != 0xaaaa)" "= true" | 36 gdb_test "print (\$u not_eq 0xaaaa) == (\$v != 0xaaaa)" "= true" |
41 gdb_test "print (\$u and_eq 0xaaaa) == (\$v &= 0xaaaa)" "= true" | 37 gdb_test "print (\$u and_eq 0xaaaa) == (\$v &= 0xaaaa)" "= true" |
42 | 38 |
43 gdb_test_no_output "set \$u = 0x5a5a" "set \$u 2" | 39 gdb_test_no_output "set \$u = 0x5a5a" "set \$u 2" |
44 gdb_test_no_output "set \$v = 0x5a5a" "set \$v 2" | 40 gdb_test_no_output "set \$v = 0x5a5a" "set \$v 2" |
45 gdb_test "print (\$u or_eq 0xaaaa) == (\$v |= 0xaaaa)" "= true" | 41 gdb_test "print (\$u or_eq 0xaaaa) == (\$v |= 0xaaaa)" "= true" |
46 | 42 |
47 gdb_test_no_output "set \$u = 0x5a5a" "set \$u 3" | 43 gdb_test_no_output "set \$u = 0x5a5a" "set \$u 3" |
48 gdb_test_no_output "set \$v = 0x5a5a" "set \$v 3" | 44 gdb_test_no_output "set \$v = 0x5a5a" "set \$v 3" |
49 gdb_test "print (\$u xor_eq 0xaaaa) == (\$v ^= 0xaaaa)" "= true" | 45 gdb_test "print (\$u xor_eq 0xaaaa) == (\$v ^= 0xaaaa)" "= true" |
50 | 46 |
51 gdb_exit | 47 gdb_exit |
52 return 0 | 48 return 0 |
OLD | NEW |