Files
clang-p2996/llvm/test/tools/llvm-symbolizer/file-prefix.test
Serge Pavlov 1792852f86 [symbolizer] Change reaction on invalid input
If llvm-symbolizer finds a malformed command, it echoes it to the
standard output. New versions of binutils (starting from 2.39) allow to
specify an address by a symbols. Implementation of this feature in
llvm-symbolizer makes the current reaction on invalid input
inappropriate. Almost any invalid command may be treated as a symbol
name, so the right reaction should be "symbol not found" in such case.

The exception are commands that are recognized but have incorrect
syntax, like "FILE:FILE:". The utility must produce descriptive
diagnostic for such input and route it to the stderr.

This change implements the new reaction on invalid input and is a
prerequisite for implementation of symbol lookup in llvm-symbolizer.

Differential Revision: https://reviews.llvm.org/D157210
2023-08-30 17:54:37 +07:00

12 lines
588 B
Plaintext

# The FILE prefix acts as a no-op, but it provides consistency with BUILDID.
RUN: llvm-symbolizer "CODE FILE:%p/Inputs/addr.exe 0x40054d" | \
RUN: FileCheck %s --check-prefix=FOUND
FOUND: {{[/\]+}}tmp{{[/\]+}}x.c:14:0
# Passing FILE twice is a syntax error.
RUN: llvm-symbolizer "CODE FILE:FILE:%p/Inputs/addr.exe 0x40054d" 2>%t.err | FileCheck --check-prefix=NOTFOUND %s
RUN: FileCheck %s --check-prefix=FILEFILE --input-file %t.err
NOTFOUND: ??
NOTFOUND-NEXT: ??:0:0
FILEFILE: error: 'CODE FILE:FILE:{{.*}}/Inputs/addr.exe 0x40054d': duplicate input file specification prefix