aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2/clang-debug-names.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-05-08 16:24:09 +0200
committerTom de Vries <tdevries@suse.de>2020-05-08 16:24:09 +0200
commit283cb58c4ddb8a3dc7a014f5c6a41789fd7de939 (patch)
tree009a4d7ea4eccdd7e825c006df2eecd8b2c6ba6d /gdb/testsuite/gdb.dwarf2/clang-debug-names.c
parentcee2106c5b6a19e89843e4bb32dc23dac87c42bf (diff)
downloadgdb-283cb58c4ddb8a3dc7a014f5c6a41789fd7de939.zip
gdb-283cb58c4ddb8a3dc7a014f5c6a41789fd7de939.tar.gz
gdb-283cb58c4ddb8a3dc7a014f5c6a41789fd7de939.tar.bz2
[gdb/testsuite] Add gdb.dwarf2/clang-debug-names.c
Add test-case with .debug_names section using DW_FORM_ref4. There's currently no support for .debug_names in the dwarf assembler, so we use plain _emit rather than something more structured. Consequently, we cannot use regular declare_labels-generated labels to refer from .debug_names to .debug_info. Instead, we use labels with a predefined name, which we generate using _compute_label, and then define using define_label. This is the test-case for PR25952, so kfail the corresponding test. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-05-08 Tom de Vries <tdevries@suse.de> * gdb.dwarf2/clang-debug-names.c: New test. * gdb.dwarf2/clang-debug-names.exp: New file.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/clang-debug-names.c')
-rw-r--r--gdb/testsuite/gdb.dwarf2/clang-debug-names.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names.c b/gdb/testsuite/gdb.dwarf2/clang-debug-names.c
new file mode 100644
index 0000000..d66c192
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/clang-debug-names.c
@@ -0,0 +1,25 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2020 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 <http://www.gnu.org/licenses/>. */
+
+int
+main (void)
+{
+ asm ("main_label: .globl main_label");
+ int sum, a, b;
+ sum = a + b;
+ return sum;
+}