190075Sobrien# Copyright 2009-2020 Free Software Foundation, Inc. 2132718Skan 3132718Skan# This program is free software; you can redistribute it and/or modify 490075Sobrien# it under the terms of the GNU General Public License as published by 590075Sobrien# the Free Software Foundation; either version 3 of the License, or 6132718Skan# (at your option) any later version. 790075Sobrien# 8132718Skan# This program is distributed in the hope that it will be useful, 9132718Skan# but WITHOUT ANY WARRANTY; without even the implied warranty of 10132718Skan# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11132718Skan# GNU General Public License for more details. 1290075Sobrien# 13132718Skan# You should have received a copy of the GNU General Public License 14132718Skan# along with this program. If not, see <http://www.gnu.org/licenses/>. 15132718Skanload_lib dwarf.exp 16132718Skan 1790075Sobrien# This test can only be run on targets which support DWARF-2 and use gas. 18132718Skanif {![dwarf2_support]} { 19132718Skan return 0 20132718Skan} 21132718Skan 2290075Sobrien# Some targets have leading underscores on assembly symbols. 2390075Sobrienset additional_flags [gdb_target_symbol_prefix_flags_asm] 2490075Sobrien 2590075Sobrienif { [prepare_for_testing "failed to prepare" "dw2-unresolved" \ 2690075Sobrien {dw2-unresolved-main.c dw2-unresolved.S} \ 2790075Sobrien [list nodebug $additional_flags]] } { 2890075Sobrien return -1 2990075Sobrien} 3090075Sobrien 3190075Sobrienif ![runto_main] { 3290075Sobrien return -1 33132718Skan} 3490075Sobrien 3590075Sobrien# This testcase tests LOC_UNRESOLVED works right. 3690075Sobrien 3790075Sobriengdb_breakpoint "*extern_block_start" 3890075Sobriengdb_continue_to_breakpoint "*extern_block_start" 3990075Sobrien 4090075Sobrien# Expect the inner value 2. Value 1 from the outer local block is shadowed. 4190075Sobriengdb_test "print/d var" "= 2" 4290075Sobrien