From 37cf733543c55471c76f216675ce1030335b6211 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Sun, 18 Aug 2024 20:56:54 +0200 Subject: [PATCH] [gdb/testsuite] Add gdb.dwarf2/dw2-inter-cu-error.exp --- .../gdb.dwarf2/dw2-inter-cu-error.exp | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error.exp diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error.exp b/gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error.exp new file mode 100644 index 00000000000..2c206e75197 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-inter-cu-error.exp @@ -0,0 +1,49 @@ +# Copyright 2024 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 . + +load_lib dwarf.exp + +# This test can only be run on targets which support DWARF-2 and use gas. +require dwarf2_support + +standard_testfile main.c .S + +# Create the DWARF. +set asm_file [standard_output_file $srcfile2] +Dwarf::assemble $asm_file { + declare_labels label1 + + cu {} { + compile_unit {{language @DW_LANG_C}} { + subprogram { + {MACRO_AT_range { main }} + {DW_AT_specification %$label1} + } + } + } + + cu {} { + compile_unit {{language @DW_LANG_C}} { + label1: + } + } +} + +if [prepare_for_testing "failed to prepare" $testfile \ + [list $asm_file $srcfile] {nodebug}] { + return -1 +} + +gdb_assert { [regexp "Dwarf Error:" $gdb_file_cmd_msg] } "Error message" base-commit: 9747e37ed4a6b167b8d1b0468fc6657c0781743f -- 2.35.3