Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 1 | ; RUN: llc %s -o %t -filetype=obj -O0 -mtriple=x86_64-unknown-linux-gnu -dwarf-version=4 |
David Blaikie | 49cfc8c | 2014-10-23 19:12:43 +0000 | [diff] [blame] | 2 | ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s -check-prefix=PRESENT |
Eli Bendersky | e6abe83 | 2013-01-25 21:44:53 +0000 | [diff] [blame] | 3 | ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s -check-prefix=ABSENT |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 4 | ; RUN: llc %s -o %t -filetype=obj -O0 -mtriple=x86_64-apple-darwin -dwarf-version=4 |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 5 | ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s -check-prefix=DARWINP |
| 6 | ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s -check-prefix=DARWINA |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 7 | ; Verify that attributes we do want are PRESENT; |
| 8 | ; verify that attributes we don't want are ABSENT. |
| 9 | ; It's a lot easier to do this in two passes than in one. |
| 10 | ; PR14471 |
| 11 | |
David Blaikie | 9f4b70d | 2013-01-26 21:55:23 +0000 | [diff] [blame] | 12 | ; LLVM IR generated using: clang -emit-llvm -S -g |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 13 | ; (with the Clang part of this patch applied). |
| 14 | ; |
| 15 | ; class C |
| 16 | ; { |
| 17 | ; static int a; |
David Blaikie | b085931 | 2013-01-19 23:00:25 +0000 | [diff] [blame] | 18 | ; const static bool const_a = true; |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 19 | ; protected: |
| 20 | ; static int b; |
David Blaikie | a39a76e | 2013-01-20 01:18:01 +0000 | [diff] [blame] | 21 | ; const static float const_b = 3.14; |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 22 | ; public: |
| 23 | ; static int c; |
| 24 | ; const static int const_c = 18; |
| 25 | ; int d; |
| 26 | ; }; |
| 27 | ; |
| 28 | ; int C::a = 4; |
| 29 | ; int C::b = 2; |
| 30 | ; int C::c = 1; |
| 31 | ; |
| 32 | ; int main() |
| 33 | ; { |
| 34 | ; C instance_C; |
| 35 | ; instance_C.d = 8; |
| 36 | ; return C::c; |
| 37 | ; } |
| 38 | |
| 39 | %class.C = type { i32 } |
| 40 | |
| 41 | @_ZN1C1aE = global i32 4, align 4 |
| 42 | @_ZN1C1bE = global i32 2, align 4 |
| 43 | @_ZN1C1cE = global i32 1, align 4 |
| 44 | |
| 45 | define i32 @main() nounwind uwtable { |
| 46 | entry: |
| 47 | %retval = alloca i32, align 4 |
| 48 | %instance_C = alloca %class.C, align 4 |
| 49 | store i32 0, i32* %retval |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 50 | call void @llvm.dbg.declare(metadata %class.C* %instance_C, metadata !29, metadata !MDExpression()), !dbg !30 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 51 | %d = getelementptr inbounds %class.C, %class.C* %instance_C, i32 0, i32 0, !dbg !31 |
David Blaikie | 9f4b70d | 2013-01-26 21:55:23 +0000 | [diff] [blame] | 52 | store i32 8, i32* %d, align 4, !dbg !31 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 53 | %0 = load i32, i32* @_ZN1C1cE, align 4, !dbg !32 |
David Blaikie | 9f4b70d | 2013-01-26 21:55:23 +0000 | [diff] [blame] | 54 | ret i32 %0, !dbg !32 |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 55 | } |
| 56 | |
Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 57 | declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 58 | |
| 59 | !llvm.dbg.cu = !{!0} |
Manman Ren | 409558f | 2013-11-22 21:49:45 +0000 | [diff] [blame] | 60 | !llvm.module.flags = !{!34} |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 61 | |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 62 | !0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 171914)", isOptimized: false, emissionKind: 0, file: !33, enums: !1, retainedTypes: !1, subprograms: !3, globals: !10, imports: !1) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 63 | !1 = !{} |
| 64 | !3 = !{!5} |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 65 | !5 = !MDSubprogram(name: "main", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 23, file: !33, scope: !6, type: !7, function: i32 ()* @main, variables: !1) |
| 66 | !6 = !MDFile(filename: "/usr/local/google/home/blaikie/Development/llvm/src/tools/clang/test/CodeGenCXX/debug-info-static-member.cpp", directory: "/home/blaikie/local/Development/llvm/build/clang/x86-64/Debug/llvm") |
| 67 | !7 = !MDSubroutineType(types: !8) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 68 | !8 = !{!9} |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 69 | !9 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 70 | !10 = !{!12, !27, !28} |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 71 | !12 = !MDGlobalVariable(name: "a", linkageName: "_ZN1C1aE", line: 14, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, variable: i32* @_ZN1C1aE, declaration: !15) |
| 72 | !13 = !MDCompositeType(tag: DW_TAG_class_type, name: "C", line: 1, size: 32, align: 32, file: !33, elements: !14) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 73 | !14 = !{!15, !16, !19, !20, !23, !24, !26} |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 74 | !15 = !MDDerivedType(tag: DW_TAG_member, name: "a", line: 3, flags: DIFlagPrivate | DIFlagStaticMember, file: !33, scope: !13, baseType: !9) |
| 75 | !16 = !MDDerivedType(tag: DW_TAG_member, name: "const_a", line: 4, flags: DIFlagPrivate | DIFlagStaticMember, file: !33, scope: !13, baseType: !17, extraData: i1 true) |
| 76 | !17 = !MDDerivedType(tag: DW_TAG_const_type, baseType: !18) |
| 77 | !18 = !MDBasicType(tag: DW_TAG_base_type, name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean) |
| 78 | !19 = !MDDerivedType(tag: DW_TAG_member, name: "b", line: 6, flags: DIFlagProtected | DIFlagStaticMember, file: !33, scope: !13, baseType: !9) |
| 79 | !20 = !MDDerivedType(tag: DW_TAG_member, name: "const_b", line: 7, flags: DIFlagProtected | DIFlagStaticMember, file: !33, scope: !13, baseType: !21, extraData: float 0x40091EB860000000) |
| 80 | !21 = !MDDerivedType(tag: DW_TAG_const_type, baseType: !22) |
| 81 | !22 = !MDBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float) |
| 82 | !23 = !MDDerivedType(tag: DW_TAG_member, name: "c", line: 9, flags: DIFlagPublic | DIFlagStaticMember, file: !33, scope: !13, baseType: !9) |
| 83 | !24 = !MDDerivedType(tag: DW_TAG_member, name: "const_c", line: 10, flags: DIFlagPublic | DIFlagStaticMember, file: !33, scope: !13, baseType: !25, extraData: i32 18) |
| 84 | !25 = !MDDerivedType(tag: DW_TAG_const_type, baseType: !9) |
| 85 | !26 = !MDDerivedType(tag: DW_TAG_member, name: "d", line: 11, size: 32, align: 32, flags: DIFlagPublic, file: !33, scope: !13, baseType: !9) |
| 86 | !27 = !MDGlobalVariable(name: "b", linkageName: "_ZN1C1bE", line: 15, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, variable: i32* @_ZN1C1bE, declaration: !19) |
| 87 | !28 = !MDGlobalVariable(name: "c", linkageName: "_ZN1C1cE", line: 16, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, variable: i32* @_ZN1C1cE, declaration: !23) |
| 88 | !29 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "instance_C", line: 20, scope: !5, file: !6, type: !13) |
Duncan P. N. Exon Smith | 9885469 | 2015-01-14 22:27:36 +0000 | [diff] [blame] | 89 | !30 = !MDLocation(line: 20, scope: !5) |
| 90 | !31 = !MDLocation(line: 21, scope: !5) |
| 91 | !32 = !MDLocation(line: 22, scope: !5) |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 92 | !33 = !MDFile(filename: "/usr/local/google/home/blaikie/Development/llvm/src/tools/clang/test/CodeGenCXX/debug-info-static-member.cpp", directory: "/home/blaikie/local/Development/llvm/build/clang/x86-64/Debug/llvm") |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 93 | ; PRESENT verifies that static member declarations have these attributes: |
Paul Robinson | 857b443 | 2015-03-10 22:44:45 +0000 | [diff] [blame^] | 94 | ; external, declaration, accessibility, and either DW_AT_linkage_name |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 95 | ; (for variables) or DW_AT_const_value (for constants). |
| 96 | ; |
| 97 | ; PRESENT: .debug_info contents: |
David Blaikie | 49cfc8c | 2014-10-23 19:12:43 +0000 | [diff] [blame] | 98 | ; PRESENT: DW_TAG_variable |
| 99 | ; PRESENT-NEXT: DW_AT_specification {{.*}} "a" |
| 100 | ; PRESENT-NEXT: DW_AT_location |
| 101 | ; PRESENT-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1aE" |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 102 | ; PRESENT: DW_TAG_class_type |
| 103 | ; PRESENT-NEXT: DW_AT_name {{.*}} "C" |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 104 | ; PRESENT: DW_TAG_member |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 105 | ; PRESENT-NEXT: DW_AT_name {{.*}} "a" |
| 106 | ; PRESENT: DW_AT_external |
| 107 | ; PRESENT: DW_AT_declaration |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 108 | ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_private) |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 109 | ; PRESENT: DW_TAG_member |
| 110 | ; PRESENT-NEXT: DW_AT_name {{.*}} "const_a" |
| 111 | ; PRESENT: DW_AT_external |
| 112 | ; PRESENT: DW_AT_declaration |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 113 | ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_private) |
David Blaikie | b085931 | 2013-01-19 23:00:25 +0000 | [diff] [blame] | 114 | ; PRESENT: DW_AT_const_value {{.*}} (1) |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 115 | ; PRESENT: DW_TAG_member |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 116 | ; PRESENT-NEXT: DW_AT_name {{.*}} "b" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 117 | ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_protected) |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 118 | ; PRESENT: DW_TAG_member |
| 119 | ; PRESENT-NEXT: DW_AT_name {{.*}} "const_b" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 120 | ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_protected) |
David Blaikie | c05c8f4 | 2014-05-11 15:47:39 +0000 | [diff] [blame] | 121 | ; PRESENT: DW_AT_const_value [DW_FORM_udata] (1078523331) |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 122 | ; PRESENT: DW_TAG_member |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 123 | ; PRESENT-NEXT: DW_AT_name {{.*}} "c" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 124 | ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public) |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 125 | ; PRESENT: DW_TAG_member |
| 126 | ; PRESENT-NEXT: DW_AT_name {{.*}} "const_c" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 127 | ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public) |
Eric Christopher | 9d1daa8 | 2013-08-27 23:49:04 +0000 | [diff] [blame] | 128 | ; PRESENT: DW_AT_const_value {{.*}} (18) |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 129 | ; While we're here, a normal member has data_member_location and |
| 130 | ; accessibility attributes. |
| 131 | ; PRESENT: DW_TAG_member |
| 132 | ; PRESENT-NEXT: DW_AT_name {{.*}} "d" |
| 133 | ; PRESENT: DW_AT_data_member_location |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 134 | ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public) |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 135 | ; PRESENT: NULL |
| 136 | ; Definitions point back to their declarations, and have a location. |
| 137 | ; PRESENT: DW_TAG_variable |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 138 | ; PRESENT-NEXT: DW_AT_specification {{.*}} "b" |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 139 | ; PRESENT-NEXT: DW_AT_location |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 140 | ; PRESENT-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1bE" |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 141 | ; PRESENT: DW_TAG_variable |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 142 | ; PRESENT-NEXT: DW_AT_specification {{.*}} "c" |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 143 | ; PRESENT-NEXT: DW_AT_location |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 144 | ; PRESENT-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1cE" |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 145 | |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 146 | ; For Darwin gdb: |
| 147 | ; DARWINP: .debug_info contents: |
David Blaikie | 49cfc8c | 2014-10-23 19:12:43 +0000 | [diff] [blame] | 148 | ; DARWINP: DW_TAG_variable |
| 149 | ; DARWINP-NEXT: DW_AT_specification {{.*}} "a" |
| 150 | ; DARWINP-NEXT: DW_AT_location |
| 151 | ; DARWINP-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1aE" |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 152 | ; DARWINP: DW_TAG_class_type |
| 153 | ; DARWINP-NEXT: DW_AT_name {{.*}} "C" |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 154 | ; DARWINP: DW_TAG_member |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 155 | ; DARWINP-NEXT: DW_AT_name {{.*}} "a" |
| 156 | ; DARWINP: DW_AT_external |
| 157 | ; DARWINP: DW_AT_declaration |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 158 | ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_private) |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 159 | ; DARWINP: DW_TAG_member |
| 160 | ; DARWINP-NEXT: DW_AT_name {{.*}} "const_a" |
| 161 | ; DARWINP: DW_AT_external |
| 162 | ; DARWINP: DW_AT_declaration |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 163 | ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_private) |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 164 | ; DARWINP: DW_AT_const_value {{.*}} (1) |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 165 | ; DARWINP: DW_TAG_member |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 166 | ; DARWINP-NEXT: DW_AT_name {{.*}} "b" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 167 | ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_protected) |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 168 | ; DARWINP: DW_TAG_member |
| 169 | ; DARWINP-NEXT: DW_AT_name {{.*}} "const_b" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 170 | ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_protected) |
David Blaikie | c05c8f4 | 2014-05-11 15:47:39 +0000 | [diff] [blame] | 171 | ; DARWINP: DW_AT_const_value [DW_FORM_udata] (1078523331) |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 172 | ; DARWINP: DW_TAG_member |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 173 | ; DARWINP-NEXT: DW_AT_name {{.*}} "c" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 174 | ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public) |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 175 | ; DARWINP: DW_TAG_member |
| 176 | ; DARWINP-NEXT: DW_AT_name {{.*}} "const_c" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 177 | ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public) |
Eric Christopher | 9d1daa8 | 2013-08-27 23:49:04 +0000 | [diff] [blame] | 178 | ; DARWINP: DW_AT_const_value {{.*}} (18) |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 179 | ; While we're here, a normal member has data_member_location and |
| 180 | ; accessibility attributes. |
| 181 | ; DARWINP: DW_TAG_member |
| 182 | ; DARWINP-NEXT: DW_AT_name {{.*}} "d" |
| 183 | ; DARWINP: DW_AT_data_member_location |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 184 | ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public) |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 185 | ; DARWINP: NULL |
| 186 | ; Definitions point back to their declarations, and have a location. |
| 187 | ; DARWINP: DW_TAG_variable |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 188 | ; DARWINP-NEXT: DW_AT_specification {{.*}} "b" |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 189 | ; DARWINP-NEXT: DW_AT_location |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 190 | ; DARWINP-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1bE" |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 191 | ; DARWINP: DW_TAG_variable |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 192 | ; DARWINP-NEXT: DW_AT_specification {{.*}} "c" |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 193 | ; DARWINP-NEXT: DW_AT_location |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 194 | ; DARWINP-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1cE" |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 195 | |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 196 | ; ABSENT verifies that static member declarations do not have either |
| 197 | ; DW_AT_location or DW_AT_data_member_location; also, variables do not |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 198 | ; have DW_AT_const_value and constants do not have DW_AT_linkage_name. |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 199 | ; |
| 200 | ; ABSENT: .debug_info contents: |
| 201 | ; ABSENT: DW_TAG_member |
| 202 | ; ABSENT: DW_AT_name {{.*}} "a" |
| 203 | ; ABSENT-NOT: DW_AT_const_value |
| 204 | ; ABSENT-NOT: location |
| 205 | ; ABSENT: DW_AT_name {{.*}} "const_a" |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 206 | ; ABSENT-NOT: DW_AT_linkage_name |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 207 | ; ABSENT-NOT: location |
| 208 | ; ABSENT: DW_AT_name {{.*}} "b" |
| 209 | ; ABSENT-NOT: DW_AT_const_value |
| 210 | ; ABSENT-NOT: location |
| 211 | ; ABSENT: DW_AT_name {{.*}} "const_b" |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 212 | ; ABSENT-NOT: DW_AT_linkage_name |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 213 | ; ABSENT-NOT: location |
| 214 | ; ABSENT: DW_AT_name {{.*}} "c" |
| 215 | ; ABSENT-NOT: DW_AT_const_value |
| 216 | ; ABSENT-NOT: location |
| 217 | ; ABSENT: DW_AT_name {{.*}} "const_c" |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 218 | ; ABSENT-NOT: DW_AT_linkage_name |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 219 | ; ABSENT-NOT: location |
| 220 | ; While we're here, a normal member does not have a linkage name, constant |
| 221 | ; value, or DW_AT_location. |
| 222 | ; ABSENT: DW_AT_name {{.*}} "d" |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 223 | ; ABSENT-NOT: DW_AT_linkage_name |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 224 | ; ABSENT-NOT: DW_AT_const_value |
| 225 | ; ABSENT-NOT: DW_AT_location |
| 226 | ; ABSENT: NULL |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 227 | |
| 228 | ; For Darwin gdb: |
| 229 | ; DARWINA: .debug_info contents: |
| 230 | ; DARWINA: DW_TAG_member |
| 231 | ; DARWINA: DW_AT_name {{.*}} "a" |
| 232 | ; DARWINA-NOT: DW_AT_const_value |
| 233 | ; DARWINA-NOT: location |
| 234 | ; DARWINA: DW_AT_name {{.*}} "const_a" |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 235 | ; DARWINA-NOT: DW_AT_linkage_name |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 236 | ; DARWINA-NOT: location |
| 237 | ; DARWINA: DW_AT_name {{.*}} "b" |
| 238 | ; DARWINA-NOT: DW_AT_const_value |
| 239 | ; DARWINA-NOT: location |
| 240 | ; DARWINA: DW_AT_name {{.*}} "const_b" |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 241 | ; DARWINA-NOT: DW_AT_linkage_name |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 242 | ; DARWINA-NOT: location |
| 243 | ; DARWINA: DW_AT_name {{.*}} "c" |
| 244 | ; DARWINA-NOT: DW_AT_const_value |
| 245 | ; DARWINA-NOT: location |
| 246 | ; DARWINA: DW_AT_name {{.*}} "const_c" |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 247 | ; DARWINA-NOT: DW_AT_linkage_name |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 248 | ; DARWINA-NOT: location |
| 249 | ; While we're here, a normal member does not have a linkage name, constant |
| 250 | ; value, or DW_AT_location. |
| 251 | ; DARWINA: DW_AT_name {{.*}} "d" |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 252 | ; DARWINA-NOT: DW_AT_linkage_name |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 253 | ; DARWINA-NOT: DW_AT_const_value |
| 254 | ; DARWINA-NOT: DW_AT_location |
| 255 | ; DARWINA: NULL |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 256 | !34 = !{i32 1, !"Debug Info Version", i32 3} |