1 # Copyright 2014-2020 Free Software Foundation, Inc.
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.
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.
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/>.
17 # This test can only be run on targets which support DWARF-2 and use gas.
18 if {![dwarf2_support]} {
22 standard_testfile arr-subrange.c arr-subrange-dw.S
24 # Make some DWARF for the test.
25 set asm_file [standard_output_file $srcfile2]
26 Dwarf::assemble $asm_file {
29 {DW_AT_language @DW_LANG_Ada95}
32 {MACRO_AT_range {main}}
34 declare_labels boolean_label typedef_label array_label enum_label
36 boolean_label: DW_TAG_base_type {
37 {DW_AT_byte_size 1 DW_FORM_sdata}
38 {DW_AT_encoding @DW_ATE_boolean}
42 typedef_label: DW_TAG_typedef {
43 {DW_AT_name pck__table}
44 {DW_AT_type :$array_label}
47 array_label: DW_TAG_array_type {
48 {DW_AT_name pck__table}
49 {DW_AT_type :$boolean_label}
51 DW_TAG_subrange_type {
52 {DW_AT_type :$enum_label}
53 {DW_AT_lower_bound 0 DW_FORM_data1}
54 {DW_AT_upper_bound 128 DW_FORM_data1}
58 enum_label: DW_TAG_enumeration_type {
59 {DW_AT_name pck__enum_t}
60 {DW_AT_byte_size 1 DW_FORM_sdata}
63 {DW_AT_name pck__enum_000}
64 {DW_AT_const_value 0 DW_FORM_sdata}
67 {DW_AT_name pck__enum_001}
68 {DW_AT_const_value 1 DW_FORM_sdata}
71 {DW_AT_name pck__enum_128}
72 {DW_AT_const_value 128 DW_FORM_sdata}
79 if { [prepare_for_testing "failed to prepare" ${testfile} \
80 [list $srcfile $asm_file] {nodebug}] } {
84 gdb_test_no_output "set language ada"
86 gdb_test "ptype pck.table" \
87 "type = array \\(enum_000 \\.\\. enum_128\\) of boolean"