aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dlang/primitive-types.exp
blob: 3fd6d2d6e4139e7929ebcbd1ad0baf2cd2ec7657 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Copyright (C) 2014-2023 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"

require allow_d_tests

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."
}