[ARM, thumb] Fix disassembling bug after reloading a symbol file
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / ctf-constvars.exp
1 # Copyright 2019 Free Software Foundation, Inc.
2
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
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
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/>. */
15
16 # This file is a subset of constvars.exp, written by
17 # Elena Zannoni (elz@apollo.hp.com)
18 #
19 # This file is part of the gdb testsuite
20 #
21 # tests for const variables
22 # const pointers to vars
23 # pointers to const variables
24 # const pointers to const vars
25 # with mixed types
26
27 #
28 # test running programs
29 #
30 # -gt generates full-fledged CTF.
31
32 standard_testfile .c
33 set opts "additional_flags=-gt"
34
35 if { [prepare_for_testing "failed to prepare" ${testfile} \
36 [list $srcfile] [list $opts nowarnings]] } {
37 return 0
38 }
39
40 #
41 # set it up at a breakpoint so we can play with the variable values
42 #
43 if ![runto_main] then {
44 perror "couldn't run to breakpoint"
45 continue
46 }
47
48 # test vars and pointers
49
50 proc do_constvar_tests {} {
51 gdb_test "print vox" " = 66 'B'"
52 gdb_test "ptype vox" "type = volatile char"
53 gdb_test "print victuals" " = 67 'C'"
54 gdb_test "ptype victuals" "type = volatile unsigned char"
55 gdb_test "print vixen" " = 200"
56 gdb_test "ptype vixen" "type = volatile short.*"
57 gdb_test "print vitriol" " = 300"
58 gdb_test "ptype vitriol" "type = volatile (unsigned short|short unsigned)( int)?"
59 gdb_test "print vellum" " = 1000"
60 gdb_test "ptype vellum" "type = volatile long.*"
61 gdb_test "print valve" " = 2000"
62 gdb_test "ptype valve" "type = volatile (unsigned long|long unsigned)( int)?"
63 gdb_test "print vacuity" " = 3"
64 gdb_test "ptype vacuity" "type = volatile float"
65 gdb_test "print vertigo" " = 10"
66 gdb_test "ptype vertigo" "type = volatile double"
67 gdb_test "print laconic" " = 65 'A'"
68
69 gdb_test "ptype vampire" "type = volatile char.*"
70 gdb_test "ptype viper" "type = volatile unsigned char.*"
71 gdb_test "ptype vigour" "type = volatile short.*"
72 gdb_test "ptype vapour" "type = volatile (unsigned short|short unsigned)( int)?.*"
73 gdb_test "ptype ventricle" "type = volatile long.*"
74 gdb_test "ptype vigintillion" "type = volatile (unsigned long|long unsigned)( int)?.*"
75 gdb_test "ptype vocation" "type = volatile float.*"
76 gdb_test "ptype veracity" "type = volatile double.*"
77
78 gdb_test "ptype vapidity" "type = volatile char.* volatile"
79 gdb_test "ptype velocity" "type = volatile unsigned char.* volatile"
80 gdb_test "ptype veneer" "type = volatile short.* volatile"
81 gdb_test "ptype video" "type = volatile (unsigned short|short unsigned)( int)?.* volatile"
82 gdb_test "ptype vacuum" "type = volatile long.* volatile"
83 gdb_test "ptype veniality" "type = volatile (unsigned long|long unsigned)( int)?.* volatile"
84 gdb_test "ptype vitality" "type = volatile float.* volatile"
85 gdb_test "ptype voracity" "type = volatile double.* volatile"
86
87 gdb_test "ptype violent" "type = volatile char \\\[2\\\]"
88 gdb_test "ptype violet" "type = volatile unsigned char \\\[2\\\]"
89 gdb_test "ptype vips" "type = volatile short.* \\\[2\\\]"
90 gdb_test "ptype virgen" "type = volatile unsigned short.* \\\[2\\\]"
91 gdb_test "ptype vulgar" "type = volatile long.* \\\[2\\\]"
92 gdb_test "ptype vulture" "type = volatile (unsigned long|long unsigned)( int)? \\\[2\\\]"
93 gdb_test "ptype vilify" "type = volatile float \\\[2\\\]"
94 gdb_test "ptype villar" "type = volatile double \\\[2\\\]"
95
96 gdb_test "print victor" " = 89 'Y'"
97 gdb_test "ptype victor" "type = const volatile char"
98 gdb_test "ptype victory" "type = const volatile char.*"
99 gdb_test "ptype cavern" "type = const volatile char.* const"
100 gdb_test "ptype caveat" "type = const char.* volatile"
101 gdb_test "ptype covenant" "type = const unsigned char.* volatile"
102 gdb_test "ptype vanadium" "type = const volatile unsigned char.* volatile"
103
104 gdb_test "ptype cove" "type = const char.* const volatile"
105 gdb_test "ptype cavity" "type = const unsigned char.* const volatile"
106 gdb_test "ptype vagus" "type = volatile char.* const volatile"
107 gdb_test "ptype vagrancy" "type = volatile unsigned char.* const volatile"
108 gdb_test "ptype vagary" "type = const volatile char.* const volatile"
109 gdb_test "ptype vendor" "type = const volatile unsigned char.* const volatile"
110 gdb_test "ptype vindictive" "type = const volatile char \\\[2\\\]"
111 gdb_test "ptype vegetation" "type = const volatile unsigned char \\\[2\\\]"
112 }
113
114 do_constvar_tests
This page took 0.03366 seconds and 4 git commands to generate.