xref: /llvm-project/llvm/test/tools/llvm-debuginfo-analyzer/DWARF/dw-at-specification.test (revision c1ccf0781bf96f8609066bbed1389751926818c1)
1; REQUIRES: x86-registered-target
2
3; dw-at-specification.cpp
4; 1  struct S {
5; 2      static const int Arr[];
6; 3  };
7; 4  const int S::Arr[] = {
8; 5      0, 1, 2
9; 6  };
10
11; The above test compiled with clang++ produces both a DW_AT_type and
12; DW_AT_specification on the definition die for S::Arr, which previously caused
13; an assert in the LVDWARFReader:
14; $ clang++ -g -c dw-at-specification.cpp -o dw-at-specification.o
15
16; RUN: llvm-debuginfo-analyzer --attribute=level,format,producer \
17; RUN:                         --output-sort=name \
18; RUN:                         --print=symbols \
19; RUN:                         %p/Inputs/dw-at-specification.o 2>&1 | \
20; RUN: FileCheck --strict-whitespace -check-prefix=CHECK %s
21
22; CHECK: Logical View:
23; CHECK: [000]           {File} 'dw-at-specification.o' -> elf64-x86-64
24; CHECK-EMPTY:
25; CHECK: [001]             {CompileUnit} 'a.cpp'
26; CHECK: [002]               {Producer} 'clang version 11.0.0 ({{.*}})'
27; CHECK: [002]               {Variable} 'Arr' -> 'const int [3]'
28; CHECK: [002]     1         {Struct} 'S'
29; CHECK: [003]     2           {Member} extern public 'Arr' -> 'const int [1]'
30