Debian Codegraph @

gcc/testsuite/g++.dg/debug/dwarf2/nested-3.C

raw
1 // Origin: PR debug/45682
2 // { dg-options "-g -fno-merge-debug-strings -gdwarf-4 -dA -fdebug-types-section" }
3
4 namespace thread {
5
6 class Executor {
7 public:
8 static Executor* CurrentExecutor();
9 };
10
11 }
12
13 namespace thread {
14
15 Executor* Executor::CurrentExecutor() {
16 return 0;
17 }
18
19 }
20
21 thread::Executor *te;
22
23 int
24 main ()
25 {
26 return 0;
27 }
28
29 // We want to express the fact that the DIE for the definition of
30 // 'Executor::CurrentExecutor' is a grand-child of the DIE for the
31 // namespace 'thread'. We must have something like this output:
32 // .uleb128 0x8 # (DIE (0x29) DW_TAG_namespace)
33 // .ascii "thread\0" # DW_AT_name
34 // .byte 0x1 # DW_AT_decl_file (.../testsuite/g++.dg/debug/dwarf2/nested-3.C)
35 // .byte 0x4 # DW_AT_decl_line
36 // .long 0x4b # DW_AT_sibling
37 // .uleb128 0x9 # (DIE (0x34) DW_TAG_class_type)
38 // .long .LASF0 # DW_AT_name: "Executor"
39 // # DW_AT_declaration
40 // .byte 0xa0 # DW_AT_signature
41 // .byte 0xfe
42 // .byte 0xe6
43 // .byte 0x7b
44 // .byte 0x66
45 // .byte 0xe9
46 // .byte 0x38
47 // .byte 0xf0
48 // .uleb128 0x5 # (DIE (0x39) DW_TAG_subprogram)
49 // # DW_AT_external
50 // .long .LASF1 # DW_AT_name: "CurrentExecutor"
51 // .byte 0x1 # DW_AT_decl_file (.../testsuite/g++.dg/debug/dwarf2/nested-3.C)
52 // .byte 0x8 # DW_AT_decl_line
53 // .long .LASF2 # DW_AT_linkage_name: "_ZN6thread8Executor15CurrentExecutorEv"
54 // .long 0x4b # DW_AT_type
55 // .byte 0x1 # DW_AT_accessibility
56 // # DW_AT_declaration
57 // .byte 0 # end of children of DIE 0x34
58 // .byte 0 # end of children of DIE 0x29
59 //
60 // Hence the scary regexp:
61 //
62 // { dg-final { scan-assembler "\[^\n\r\]*\\(DIE \\(0x(\[0-9a-f\]+)\\) DW_TAG_namespace\\)\[\n\r\]+\[^\n\r\]*\"thread\[\^\n\r]+\[\n\r\]+(\[^\n\r\]*\[\n\r\]+)+\[^\n\r\]*\\(DIE \\(0x(\[0-9a-f\]+)\\) DW_TAG_class_type\\)(\[\n\r\]+\[^\n\r\]*)+\"Executor\[^\n\r\]+\[\n\r\]+\[^\n\r\]*DW_AT_declaration\[\n\r\]+\[^\n\r\]*DW_AT_signature\[^#;/!|@\]*\[#;/!|@\]+ \[^\n\r\]*\\(DIE\[^\n\r\]*DW_TAG_subprogram\\)\[\n\r\]+(\[^\n\r\]*\[\n\r\]+)+\[^\n\r\]*\"CurrentExecutor\[^\n\r\]+\[\n\r\]+(\[^\n\r\]*\[\n\r\]+)+(\[^\n\r\]*\[\n\r\]+)+\[^\n\r\]*end of children of DIE 0x\\3\[\n\r]+\[^\n\r\]*end of children of DIE 0x\\1\[\n\r]+" } }