File: DW_AT_GNU_template_name.test

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,245,028 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,675; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (60 lines) | stat: -rw-r--r-- 2,177 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
; REQUIRES: x86-registered-target

; For the given test case:

;  1 // Template Template parameters.
;  2 // Simple template class
;  3 template <typename T> class Foo { T Member; };
;  4
;  5 // Template template class
;  6 template <template <typename T> class TemplateType>
;  7 class Bar {
;  8   TemplateType<int> Int;
;  9 };
; 10
; 11 template <template <template <typename> class> class TemplateTemplateType>
; 12 class Baz {
; 13   TemplateTemplateType<Foo> Foo;
; 14 };
; 15
; 16 typedef Baz<Bar> Example;
; 17
; 18 Example TT;

; The llvm-debuginfo-analyzer did not support the DW_AT_GNU_template_name
; attribute. When using '--attribute=encoded' and the template argument is
; another template, it would show:
;   {Encoded} <>

; The object file is generated using the following commands:
;
; clang++ -Xclang -disable-O0-optnone -Xclang -disable-llvm-passes
;         -fno-discard-value-names -emit-llvm -S -g -O0
;         DW_AT_GNU_template_name.cpp -o DW_AT_GNU_template_name.ll
; llc --filetype=obj DW_AT_GNU_template_name.ll -o DW_AT_GNU_template_name.o
;
; llvm-debuginfo-analyzer --attribute=encoded --print=symbols
;                         DW_AT_GNU_template_name.o

; RUN: llc --filetype=obj \
; RUN:     %p/Inputs/DW_AT_GNU_template_name.ll -o %t.DW_AT_GNU_template_name.o

; RUN: llvm-debuginfo-analyzer --attribute=encoded \
; RUN:                         --print=symbols \
; RUN:                         %t.DW_AT_GNU_template_name.o 2>&1 | \
; RUN: FileCheck --strict-whitespace %s

; CHECK: Logical View:
; CHECK:            {File} '{{.*}}dw_at_gnu_template_name.o'
; CHECK-EMPTY:
; CHECK:              {CompileUnit} 'dw_at_gnu_template_name.cpp'
; CHECK:      3         {Class} 'Foo<int>'
; CHECK:                  {Encoded} <int>
; CHECK:      3           {Member} private 'Member' -> 'int'
; CHECK:      7         {Class} 'Bar<Foo>'
; CHECK:                  {Encoded} <Foo>
; CHECK:      8           {Member} private 'Int' -> 'Foo<int>'
; CHECK:     12         {Class} 'Baz<Bar>'
; CHECK:                  {Encoded} <Bar>
; CHECK:     13           {Member} private 'Foo' -> 'Bar<Foo>'
; CHECK:     18         {Variable} extern 'TT' -> 'Example'