Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Unified Diff: gdb/testsuite/gdb.go/integers.exp

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/testsuite/gdb.go/hello.go ('k') | gdb/testsuite/gdb.go/integers.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.go/integers.exp
diff --git a/gdb/testsuite/gdb.pascal/integers.exp b/gdb/testsuite/gdb.go/integers.exp
similarity index 67%
copy from gdb/testsuite/gdb.pascal/integers.exp
copy to gdb/testsuite/gdb.go/integers.exp
index 8cdc00ca21fd877373c305f25fe56edc971aa384..68626c7b294ca0221fc584024329388178d22432 100644
--- a/gdb/testsuite/gdb.pascal/integers.exp
+++ b/gdb/testsuite/gdb.go/integers.exp
@@ -1,4 +1,6 @@
-# Copyright 2008-2012 Free Software Foundation, Inc.
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2012 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,68 +15,50 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if $tracelevel then {
- strace $tracelevel
-}
+# Test integer expressions.
+
+load_lib "go.exp"
-load_lib "pascal.exp"
+if { [skip_go_tests] } { continue }
-set testfile "integers"
-set srcfile ${testfile}.pas
-set binfile ${objdir}/${subdir}/${testfile}$EXEEXT
+standard_testfile .go
-if {[gdb_compile_pascal "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } {
- return -1
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } {
+ return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
set bp_location2 [gdb_get_line_number "set breakpoint 2 here"]
-if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
- pass "setting breakpoint 1"
-}
-if { [gdb_breakpoint ${srcfile}:${bp_location2}] } {
- pass "setting breakpoint 2"
-}
-
-# Verify that "start" lands inside the right procedure.
-if { [gdb_start_cmd] < 0 } {
- untested start
+if { [go_runto_main] < 0 } {
+ untested $testfile
return -1
}
-gdb_test "" ".* at .*${srcfile}.*" "start"
+if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
+ pass "setting breakpoint 1"
+}
gdb_test "cont" "Breakpoint .*:${bp_location1}.*" "Going to first breakpoint"
gdb_test "print i" ".* = 0" "Print i before assigned to 1"
-gdb_test "next" "i := 1;" "Next to 'i := 1' line"
-gdb_test "next" "j := 2;" "Next to 'j := 2' line"
+gdb_test "next" "i = 1" "Next to 'i = 1' line"
+gdb_test "next" "j = 2" "Next to 'j = 2' line"
# At that point,
# i should be equal to 1
gdb_test "print i" " = 1"
# but j should still be equal to zero
-if { $pascal_compiler_is_gpc } {
- setup_xfail *-*-*
-}
gdb_test "print j" " = 0" "Test j value before assignment"
-gdb_test "next" "k := 3;" "Next to 'k := 3' line"
-gdb_test "next" "l := k;" "Next to 'l := k' line"
+gdb_test "next" "k = 3" "Next to 'k = 3' line"
+gdb_test "next" "l = k" "Next to 'l = k' line"
#j should be equal to 2
gdb_test "print j" " = 2"
# k should be equal to 3
gdb_test "print k" " = 3"
-# But l shoud still be zero
-if { $pascal_compiler_is_gpc } {
- setup_xfail *-*-*
-}
+# But l should still be zero
gdb_test "print l" " = 0"
# Test addition
@@ -96,8 +80,8 @@ gdb_test "print -(i)" " = -1"
gdb_test "print -(i+j)" " = -3"
# Test boolean operators =, <>, <, <=, > and >=
-gdb_test "print i + 1 = j" " = true"
-gdb_test "print i + 1 <> j" " = false"
+gdb_test "print i + 1 == j" " = true"
+gdb_test "print i + 1 != j" " = false"
gdb_test "print i + 1 < j" " = false"
gdb_test "print i + 1 <= j" " = true"
gdb_test "print i + 1 > j" " = false"
@@ -109,18 +93,20 @@ gdb_test "print j * k" " = 6"
gdb_test "print 3000*i" " = 3000"
#Test div and mod operators
-gdb_test "print 35 div 2" " = 17"
-gdb_test "print 35 mod 2" " = 1"
+gdb_test "print 35 / 2" " = 17"
+gdb_test "print 35 % 2" " = 1"
# Test several operators together
gdb_test "print i+10*j+100*k" " = 321"
gdb_test " print (i + 5) * (j + 7)" " = 54"
-# 'set i' does not work, as there are set sub-commands starting with 'i'
-# Thus we need to use 'set var i'
-gdb_test "set var i := 2" " := 2"
+gdb_test "set var i = 2" " = 2"
gdb_test "print i" " = 2" "Testing new i value"
+if { [gdb_breakpoint ${srcfile}:${bp_location2}] } {
+ pass "setting breakpoint 2"
+}
+
gdb_test "cont" \
"Breakpoint .*:${bp_location2}.*" \
"Going to second breakpoint"
« no previous file with comments | « gdb/testsuite/gdb.go/hello.go ('k') | gdb/testsuite/gdb.go/integers.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698