xref: /llvm-project/llvm/test/tools/llvm-symbolizer/split-dwarf-dwp-invalid.test (revision f198c508109d4e971bce14da361763fdeee00149)
1RUN: llvm-symbolizer --dwp=%p/Inputs/split-dwarf-dwp-invalid.dwp \
2RUN:     --obj=%p/Inputs/split-dwarf-dwp-invalid \
3RUN:     0x0000000000001140 0x0000000000001130 0x0000000000001130 \
4RUN:     2>&1 | FileCheck %s
5
6The test contains a hand-modified dwp file containing an invalid DWARF version
7in the second-queried CU.
8
9This ensures llvm-symbolizer doesn't crash when trying to access the invalid CU
10a second time (the first time works fine, the second fails the sorted search
11because of a null entry that can't be sorted/compared)
12
13One warning rather than two would be good here, but we put the CUs in an
14offset-sorted list, so a null entry in that list makes it impossible to sort
15(since it has no offset), so on failure we don't put anything in the list,
16which means next time it's queried it is parsed again and fails and warns
17again. We could make the list a pair of {offset, pointer} but that'd require
18fixing up a bunch of clients probably (possibly by providing a filter iterator
19that skips the null entries, keeping those only as an implementation detail?) -
20or perhaps just have a separate list of offsets that have failed to parse
21previously?
22
23CHECK: warning: DWARF unit at offset 0x00000000 has unsupported version 255, supported are 2-5
24CHECK: warning: DWARF unit at offset 0x00000000 has unsupported version 255, supported are 2-5
25
26CHECK: other()
27CHECK: /usr/local/google/home/blaikie/dev/scratch{{[/\\]}}other.cpp:1:16
28
29CHECK: main
30CHECK: /usr/local/google/home/blaikie/dev/scratch{{[/\\]}}test.cpp:5:0
31
32CHECK: main
33CHECK: /usr/local/google/home/blaikie/dev/scratch{{[/\\]}}test.cpp:5:0
34