aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2022-09-12 10:05:18 +0200
committerTom de Vries <tdevries@suse.de>2022-09-12 10:05:18 +0200
commit9e338b141b5f9ab104bb87aea6f8358c9dfa8f77 (patch)
tree05d041961646af045f87fa8ff7eaa181f8e8d0b2 /gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c
parentac3fe48fd61a92d03c66152038df4fc184bf5fcd (diff)
downloadbinutils-9e338b141b5f9ab104bb87aea6f8358c9dfa8f77.zip
binutils-9e338b141b5f9ab104bb87aea6f8358c9dfa8f77.tar.gz
binutils-9e338b141b5f9ab104bb87aea6f8358c9dfa8f77.tar.bz2
[gdb/testsuite] Fix gdb.dwarf2/dw2-dir-file-name.exp with clang
When running test-case gdb.dwarf2/dw2-dir-file-name.exp with clang, we run into: ... (gdb) break *compdir_missing__ldir_missing__file_basename^M Breakpoint 2 at 0x400580^M (gdb) continue^M Continuing.^M ^M Breakpoint 2, 0x0000000000400580 in \ compdir_missing.ldir_missing.file_basename ()^M (gdb) FAIL: gdb.dwarf2/dw2-dir-file-name.exp: \ compdir_missing__ldir_missing__file_basename: continue to breakpoint: \ compdir_missing__ldir_missing__file_basename ... The problem is that the test-case uses labels outside functions, which is know to cause problem with clang, as documented in the comment for proc function_range. Fix this by using get_func_info instead. Tested on x86_64-linux, with both gcc 7.5.0 and clang 13.0.0.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c')
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c
index a2a0db2..8041053 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c
+++ b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c
@@ -63,28 +63,13 @@ FUNC (compdir_absolute_ldir_absolute_file_relative_different) \
FUNC (compdir_absolute_ldir_absolute_file_absolute_same) \
FUNC (compdir_absolute_ldir_absolute_file_absolute_different)
-#ifdef __mips__
-#define START_INSNS asm (".insn\n");
-#else
-#define START_INSNS
-#endif
-
-/* Notes: (1) The '*_start' label below is needed because 'name' may
- point to a function descriptor instead of to the actual code. (2)
- The '.balign' should specify the highest possible function
- alignment across all supported architectures, such that the label
- never points into the alignment gap. */
-
#define FUNC(name) \
- asm (".balign 8"); \
- asm (#name "_start: .globl " #name "_start\n"); \
- START_INSNS \
static void \
name (void) \
{ \
+ asm (#name "_label: .globl " #name "_label\n"); \
v++; \
- } \
- asm (#name "_end: .globl " #name "_end\n");
+ }
FUNCBLOCK
#undef FUNC