aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dlang
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2014-01-18 17:18:23 +0000
committerIain Buclaw <ibuclaw@gdcproject.org>2014-01-18 18:10:47 +0000
commit94b1b47ee13476f376feddf808c63560c036cf1b (patch)
tree057f147503fdff8195a66016f6140c76b021c2cb /gdb/testsuite/gdb.dlang
parent6377854769ea85f2dd38aac9a9b11fded61245f3 (diff)
downloadgdb-94b1b47ee13476f376feddf808c63560c036cf1b.zip
gdb-94b1b47ee13476f376feddf808c63560c036cf1b.tar.gz
gdb-94b1b47ee13476f376feddf808c63560c036cf1b.tar.bz2
Define all basic data types of D and add them to the primitive type
language vector. gdb/ChangeLog: 2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org> * d-lang.h (struct builtin_d_type): New data type. (builtin_d_type): Add declaration. * d-lang.c (d_language_arch_info, build_d_types) (builtin_d_type): New functions. (enum d_primitive_types): New data type. (d_language_defn): Change c_language_arch_info to d_language_arch_info. (d_type_data): New static variable. (_initialize_d_language): Initialize d_type_data. gdb/testsuite/ChangeLog: 2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org> * gdb.dlang/primitive-types.exp: New file.
Diffstat (limited to 'gdb/testsuite/gdb.dlang')
-rw-r--r--gdb/testsuite/gdb.dlang/primitive-types.exp61
1 files changed, 61 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dlang/primitive-types.exp b/gdb/testsuite/gdb.dlang/primitive-types.exp
new file mode 100644
index 0000000..7bbdd25
--- /dev/null
+++ b/gdb/testsuite/gdb.dlang/primitive-types.exp
@@ -0,0 +1,61 @@
+# Copyright (C) 2014 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 D compiler.
+
+load_lib "d-support.exp"
+
+if { [skip_d_tests] } { continue }
+
+proc test_builtin_d_types_accepted {} {
+ # Test types are recognised.
+
+ gdb_test "ptype void" "type = void"
+ gdb_test "ptype bool" "type = bool"
+ gdb_test "ptype byte" "type = byte"
+ gdb_test "ptype ubyte" "type = ubyte"
+ gdb_test "ptype short" "type = short"
+ gdb_test "ptype ushort" "type = ushort"
+ gdb_test "ptype int" "type = int"
+ gdb_test "ptype uint" "type = uint"
+ gdb_test "ptype long" "type = long"
+ gdb_test "ptype ulong" "type = ulong"
+ gdb_test "ptype cent" "type = cent"
+ gdb_test "ptype ucent" "type = ucent"
+ gdb_test "ptype float" "type = float"
+ gdb_test "ptype double" "type = double"
+ gdb_test "ptype real" "type = real"
+ gdb_test "ptype ifloat" "type = ifloat"
+ gdb_test "ptype idouble" "type = idouble"
+ gdb_test "ptype ireal" "type = ireal"
+ gdb_test "ptype cfloat" "type = cfloat"
+ gdb_test "ptype cdouble" "type = cdouble"
+ gdb_test "ptype creal" "type = creal"
+ gdb_test "ptype char" "type = char"
+ gdb_test "ptype wchar" "type = wchar"
+ gdb_test "ptype dchar" "type = dchar"
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+
+if [set_lang_d] {
+ test_builtin_d_types_accepted
+} else {
+ warning "D type tests suppressed."
+}