1 # Copyright 2023 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/>.
16 # Check that the DWARF reader works with a a DW_AT_specification that
17 # refers to a later DIE. Inter-cu variant of forward-spec.exp.
21 # This test can only be run on targets which support DWARF-2 and use gas.
22 require dwarf2_support
24 standard_testfile main.c -debug.S
26 # Set up the DWARF for the test.
27 set asm_file [standard_output_file $srcfile2]
28 Dwarf::assemble $asm_file {
35 {DW_AT_language @DW_LANG_C_plus_plus}
37 # The new indexer has special code to compute the full
38 # name of an object that uses a specification that appears
41 {DW_AT_specification %$spec}
52 {DW_AT_language @DW_LANG_C_plus_plus}
56 myint: DW_TAG_base_type {
57 {DW_AT_byte_size 4 DW_FORM_sdata}
58 {DW_AT_encoding @DW_ATE_signed}
65 spec: DW_TAG_variable {
68 {DW_AT_declaration 1 DW_FORM_flag_present}
75 if {[build_executable "failed to build executable" ${testfile} \
76 [list $srcfile $asm_file] {nodebug}]} {
83 set worker_threads_list {}
85 # Exercises the intra-shard case.
86 lappend worker_threads_list 0
88 # Might exercise the inter-shard case.
89 lappend worker_threads_list default
91 foreach_with_prefix worker_threads $worker_threads_list {
95 if { $worker_threads != "default" } {
96 gdb_test_no_output "maint set worker-threads $worker_threads"
101 gdb_test "pipe maint print objfiles | grep ns::v" \
102 "$ws+qualified:$ws+ns::v" \