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

Unified Diff: gdb/testsuite/gdb.go/basic-types.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/Makefile.in ('k') | gdb/testsuite/gdb.go/chan.exp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.go/basic-types.exp
diff --git a/gdb/testsuite/gdb.go/basic-types.exp b/gdb/testsuite/gdb.go/basic-types.exp
new file mode 100644
index 0000000000000000000000000000000000000000..d3a542d280869c737c584e5a421085793297f44f
--- /dev/null
+++ b/gdb/testsuite/gdb.go/basic-types.exp
@@ -0,0 +1,118 @@
+# 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
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test basic builtin types.
+# NOTE: The tests here intentionally do not require a go compiler.
+
+load_lib "go.exp"
+
+if { [skip_go_tests] } { continue }
+
+proc test_integer_literal_types_accepted {} {
+ # Test various decimal values.
+
+ gdb_test "pt 123" "type = int"
+
+ gdb_test "pt void(42)" "type = void"
+ gdb_test "pt byte(42)" "type = uint8"
+ gdb_test "pt int(42)" "type = int"
+ gdb_test "pt uint(42)" "type = uint"
+ gdb_test "pt uintptr(42)" "type = uintptr"
+
+ gdb_test "pt int8(42)" "type = int8"
+ gdb_test "pt int16(42)" "type = int16"
+ gdb_test "pt int32(42)" "type = int32"
+ gdb_test "pt int64(42)" "type = int64"
+
+ gdb_test "pt uint8(42)" "type = uint8"
+ gdb_test "pt uint16(42)" "type = uint16"
+ gdb_test "pt uint32(42)" "type = uint32"
+ gdb_test "pt uint64(42)" "type = uint64"
+}
+
+proc test_logical_literal_types_accepted {} {
+ # Test the only possible values for a logical, TRUE and FALSE.
+
+ gdb_test "pt true" "type = bool"
+ gdb_test "pt false" "type = bool"
+
+ gdb_test "pt bool(0)" "type = bool"
+ gdb_test "pt bool(1)" "type = bool"
+}
+
+proc test_character_literal_types_accepted {} {
+ # Test various character values.
+
+ gdb_test "pt 'a'" "type = char"
+
+ # FIXME: Need more.
+}
+
+proc test_string_literal_types_accepted {} {
+ # Test various string values.
+
+ gdb_test "pt \"a simple string\"" "type = string"
+ gdb_test "pt `a simple raw string`" "type = string"
+
+ # FIXME: Need more.
+}
+
+proc test_float_literal_types_accepted {} {
+ # Test various floating point formats.
+
+ gdb_test "pt .44" "type = float64"
+ gdb_test "pt 44.0" "type = float64"
+ gdb_test "pt 10e20" "type = float64"
+ gdb_test "pt 10E20" "type = float64"
+
+ gdb_test "pt float32(.42)" "type = float32"
+
+ gdb_test "pt float64(.42)" "type = float64"
+}
+
+proc test_complex_literal_types_accepted {} {
+ # Test various complex formats.
+
+ gdb_test "pt complex64(.42)" "type = complex64"
+ setup_xfail "*-*-*"
+ gdb_test "pt complex64(.42i1.0)" "type = complex64"
+ setup_xfail "*-*-*"
+ gdb_test "pt complex64(i1.0)" "type = complex64"
+
+ gdb_test "pt complex128(.42)" "type = complex128"
+ setup_xfail "*-*-*"
+ gdb_test "pt complex128(.42i1.0)" "type = complex128"
+ setup_xfail "*-*-*"
+ gdb_test "pt complex128(i1.0)" "type = complex128"
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+if [set_lang_go] {
+ test_integer_literal_types_accepted
+ test_logical_literal_types_accepted
+ test_character_literal_types_accepted
+ test_string_literal_types_accepted
+ test_float_literal_types_accepted
+ test_complex_literal_types_accepted
+} else {
+ warning "Go type tests suppressed."
+}
« no previous file with comments | « gdb/testsuite/gdb.go/Makefile.in ('k') | gdb/testsuite/gdb.go/chan.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698