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 |
Adrian Prantl | 16aa4cf | 2017-09-11 23:05:20 +0000 | [diff] [blame] | 2 | ; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s -check-prefix=PRESENT |
| 3 | ; RUN: llvm-dwarfdump -v -debug-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 |
Adrian Prantl | 16aa4cf | 2017-09-11 23:05:20 +0000 | [diff] [blame] | 5 | ; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s -check-prefix=DARWINP |
| 6 | ; RUN: llvm-dwarfdump -v -debug-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 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 39 | source_filename = "test/DebugInfo/X86/debug-info-static-member.ll" |
| 40 | |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 41 | %class.C = type { i32 } |
| 42 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 43 | @_ZN1C1aE = global i32 4, align 4, !dbg !0 |
| 44 | @_ZN1C1bE = global i32 2, align 4, !dbg !18 |
| 45 | @_ZN1C1cE = global i32 1, align 4, !dbg !20 |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 46 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 47 | ; Function Attrs: nounwind uwtable |
| 48 | define i32 @main() #0 !dbg !26 { |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 49 | entry: |
| 50 | %retval = alloca i32, align 4 |
| 51 | %instance_C = alloca %class.C, align 4 |
| 52 | store i32 0, i32* %retval |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 53 | call void @llvm.dbg.declare(metadata %class.C* %instance_C, metadata !29, metadata !30), !dbg !31 |
| 54 | %d = getelementptr inbounds %class.C, %class.C* %instance_C, i32 0, i32 0, !dbg !32 |
| 55 | store i32 8, i32* %d, align 4, !dbg !32 |
| 56 | %0 = load i32, i32* @_ZN1C1cE, align 4, !dbg !33 |
| 57 | ret i32 %0, !dbg !33 |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 58 | } |
| 59 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 60 | ; Function Attrs: nounwind readnone |
| 61 | declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 62 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 63 | attributes #0 = { nounwind uwtable } |
| 64 | attributes #1 = { nounwind readnone } |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 65 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 66 | !llvm.dbg.cu = !{!22} |
| 67 | !llvm.module.flags = !{!25} |
| 68 | |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 69 | !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 70 | !1 = !DIGlobalVariable(name: "a", linkageName: "_ZN1C1aE", scope: null, file: !2, line: 14, type: !3, isLocal: false, isDefinition: true, declaration: !4) |
| 71 | !2 = !DIFile(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") |
| 72 | !3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 73 | !4 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !5, file: !2, line: 3, baseType: !3, flags: DIFlagPrivate | DIFlagStaticMember) |
| 74 | !5 = !DICompositeType(tag: DW_TAG_class_type, name: "C", file: !2, line: 1, size: 32, align: 32, elements: !6) |
| 75 | !6 = !{!4, !7, !10, !11, !14, !15, !17} |
| 76 | !7 = !DIDerivedType(tag: DW_TAG_member, name: "const_a", scope: !5, file: !2, line: 4, baseType: !8, flags: DIFlagPrivate | DIFlagStaticMember, extraData: i1 true) |
| 77 | !8 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9) |
| 78 | !9 = !DIBasicType(name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean) |
| 79 | !10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !5, file: !2, line: 6, baseType: !3, flags: DIFlagProtected | DIFlagStaticMember) |
| 80 | !11 = !DIDerivedType(tag: DW_TAG_member, name: "const_b", scope: !5, file: !2, line: 7, baseType: !12, flags: DIFlagProtected | DIFlagStaticMember, extraData: float 0x40091EB860000000) |
| 81 | !12 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !13) |
| 82 | !13 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float) |
| 83 | !14 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !5, file: !2, line: 9, baseType: !3, flags: DIFlagPublic | DIFlagStaticMember) |
| 84 | !15 = !DIDerivedType(tag: DW_TAG_member, name: "const_c", scope: !5, file: !2, line: 10, baseType: !16, flags: DIFlagPublic | DIFlagStaticMember, extraData: i32 18) |
| 85 | !16 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !3) |
| 86 | !17 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !5, file: !2, line: 11, baseType: !3, size: 32, align: 32, flags: DIFlagPublic) |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 87 | !18 = !DIGlobalVariableExpression(var: !19, expr: !DIExpression()) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 88 | !19 = !DIGlobalVariable(name: "b", linkageName: "_ZN1C1bE", scope: null, file: !2, line: 15, type: !3, isLocal: false, isDefinition: true, declaration: !10) |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 89 | !20 = !DIGlobalVariableExpression(var: !21, expr: !DIExpression()) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 90 | !21 = !DIGlobalVariable(name: "c", linkageName: "_ZN1C1cE", scope: null, file: !2, line: 16, type: !3, isLocal: false, isDefinition: true, declaration: !14) |
| 91 | !22 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.3 (trunk 171914)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !23, retainedTypes: !23, globals: !24, imports: !23) |
| 92 | !23 = !{} |
| 93 | !24 = !{!0, !18, !20} |
| 94 | !25 = !{i32 1, !"Debug Info Version", i32 3} |
Shiva Chen | 2c86455 | 2018-05-09 02:40:45 +0000 | [diff] [blame] | 95 | !26 = distinct !DISubprogram(name: "main", scope: !2, file: !2, line: 18, type: !27, isLocal: false, isDefinition: true, scopeLine: 23, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !22, retainedNodes: !23) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 96 | !27 = !DISubroutineType(types: !28) |
| 97 | !28 = !{!3} |
| 98 | !29 = !DILocalVariable(name: "instance_C", scope: !26, file: !2, line: 20, type: !5) |
| 99 | !30 = !DIExpression() |
| 100 | !31 = !DILocation(line: 20, scope: !26) |
| 101 | !32 = !DILocation(line: 21, scope: !26) |
| 102 | !33 = !DILocation(line: 22, scope: !26) |
| 103 | |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 104 | ; PRESENT verifies that static member declarations have these attributes: |
Paul Robinson | 857b443 | 2015-03-10 22:44:45 +0000 | [diff] [blame] | 105 | ; external, declaration, accessibility, and either DW_AT_linkage_name |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 106 | ; (for variables) or DW_AT_const_value (for constants). |
| 107 | ; |
| 108 | ; PRESENT: .debug_info contents: |
David Blaikie | 49cfc8c | 2014-10-23 19:12:43 +0000 | [diff] [blame] | 109 | ; PRESENT: DW_TAG_variable |
| 110 | ; PRESENT-NEXT: DW_AT_specification {{.*}} "a" |
| 111 | ; PRESENT-NEXT: DW_AT_location |
| 112 | ; PRESENT-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1aE" |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 113 | ; PRESENT: DW_TAG_class_type |
| 114 | ; PRESENT-NEXT: DW_AT_name {{.*}} "C" |
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 {{.*}} "a" |
| 117 | ; PRESENT: DW_AT_external |
| 118 | ; PRESENT: DW_AT_declaration |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 119 | ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_private) |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 120 | ; PRESENT: DW_TAG_member |
| 121 | ; PRESENT-NEXT: DW_AT_name {{.*}} "const_a" |
| 122 | ; PRESENT: DW_AT_external |
| 123 | ; PRESENT: DW_AT_declaration |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 124 | ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_private) |
David Blaikie | b085931 | 2013-01-19 23:00:25 +0000 | [diff] [blame] | 125 | ; PRESENT: DW_AT_const_value {{.*}} (1) |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 126 | ; PRESENT: DW_TAG_member |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 127 | ; PRESENT-NEXT: DW_AT_name {{.*}} "b" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 128 | ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_protected) |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 129 | ; PRESENT: DW_TAG_member |
| 130 | ; PRESENT-NEXT: DW_AT_name {{.*}} "const_b" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 131 | ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_protected) |
David Blaikie | c05c8f4 | 2014-05-11 15:47:39 +0000 | [diff] [blame] | 132 | ; PRESENT: DW_AT_const_value [DW_FORM_udata] (1078523331) |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 133 | ; PRESENT: DW_TAG_member |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 134 | ; PRESENT-NEXT: DW_AT_name {{.*}} "c" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 135 | ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public) |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 136 | ; PRESENT: DW_TAG_member |
| 137 | ; PRESENT-NEXT: DW_AT_name {{.*}} "const_c" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 138 | ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public) |
Eric Christopher | 9d1daa8 | 2013-08-27 23:49:04 +0000 | [diff] [blame] | 139 | ; PRESENT: DW_AT_const_value {{.*}} (18) |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 140 | ; While we're here, a normal member has data_member_location and |
| 141 | ; accessibility attributes. |
| 142 | ; PRESENT: DW_TAG_member |
| 143 | ; PRESENT-NEXT: DW_AT_name {{.*}} "d" |
| 144 | ; PRESENT: DW_AT_data_member_location |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 145 | ; PRESENT: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public) |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 146 | ; PRESENT: NULL |
| 147 | ; Definitions point back to their declarations, and have a location. |
| 148 | ; PRESENT: DW_TAG_variable |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 149 | ; PRESENT-NEXT: DW_AT_specification {{.*}} "b" |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 150 | ; PRESENT-NEXT: DW_AT_location |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 151 | ; PRESENT-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1bE" |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 152 | ; PRESENT: DW_TAG_variable |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 153 | ; PRESENT-NEXT: DW_AT_specification {{.*}} "c" |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 154 | ; PRESENT-NEXT: DW_AT_location |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 155 | ; PRESENT-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1cE" |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 156 | |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 157 | ; For Darwin gdb: |
| 158 | ; DARWINP: .debug_info contents: |
David Blaikie | 49cfc8c | 2014-10-23 19:12:43 +0000 | [diff] [blame] | 159 | ; DARWINP: DW_TAG_variable |
| 160 | ; DARWINP-NEXT: DW_AT_specification {{.*}} "a" |
| 161 | ; DARWINP-NEXT: DW_AT_location |
| 162 | ; DARWINP-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1aE" |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 163 | ; DARWINP: DW_TAG_class_type |
| 164 | ; DARWINP-NEXT: DW_AT_name {{.*}} "C" |
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 {{.*}} "a" |
| 167 | ; DARWINP: DW_AT_external |
| 168 | ; DARWINP: DW_AT_declaration |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 169 | ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_private) |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 170 | ; DARWINP: DW_TAG_member |
| 171 | ; DARWINP-NEXT: DW_AT_name {{.*}} "const_a" |
| 172 | ; DARWINP: DW_AT_external |
| 173 | ; DARWINP: DW_AT_declaration |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 174 | ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_private) |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 175 | ; DARWINP: DW_AT_const_value {{.*}} (1) |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 176 | ; DARWINP: DW_TAG_member |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 177 | ; DARWINP-NEXT: DW_AT_name {{.*}} "b" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 178 | ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_protected) |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 179 | ; DARWINP: DW_TAG_member |
| 180 | ; DARWINP-NEXT: DW_AT_name {{.*}} "const_b" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 181 | ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_protected) |
David Blaikie | c05c8f4 | 2014-05-11 15:47:39 +0000 | [diff] [blame] | 182 | ; DARWINP: DW_AT_const_value [DW_FORM_udata] (1078523331) |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 183 | ; DARWINP: DW_TAG_member |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 184 | ; DARWINP-NEXT: DW_AT_name {{.*}} "c" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 185 | ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public) |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 186 | ; DARWINP: DW_TAG_member |
| 187 | ; DARWINP-NEXT: DW_AT_name {{.*}} "const_c" |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 188 | ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public) |
Eric Christopher | 9d1daa8 | 2013-08-27 23:49:04 +0000 | [diff] [blame] | 189 | ; DARWINP: DW_AT_const_value {{.*}} (18) |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 190 | ; While we're here, a normal member has data_member_location and |
| 191 | ; accessibility attributes. |
| 192 | ; DARWINP: DW_TAG_member |
| 193 | ; DARWINP-NEXT: DW_AT_name {{.*}} "d" |
| 194 | ; DARWINP: DW_AT_data_member_location |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 195 | ; DARWINP: DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public) |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 196 | ; DARWINP: NULL |
| 197 | ; Definitions point back to their declarations, and have a location. |
| 198 | ; DARWINP: DW_TAG_variable |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 199 | ; DARWINP-NEXT: DW_AT_specification {{.*}} "b" |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 200 | ; DARWINP-NEXT: DW_AT_location |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 201 | ; DARWINP-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1bE" |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 202 | ; DARWINP: DW_TAG_variable |
Frederic Riss | d4de180 | 2014-10-10 15:51:02 +0000 | [diff] [blame] | 203 | ; DARWINP-NEXT: DW_AT_specification {{.*}} "c" |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 204 | ; DARWINP-NEXT: DW_AT_location |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 205 | ; DARWINP-NEXT: DW_AT_linkage_name {{.*}} "_ZN1C1cE" |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 206 | |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 207 | ; ABSENT verifies that static member declarations do not have either |
| 208 | ; 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] | 209 | ; 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] | 210 | ; |
| 211 | ; ABSENT: .debug_info contents: |
| 212 | ; ABSENT: DW_TAG_member |
| 213 | ; ABSENT: DW_AT_name {{.*}} "a" |
| 214 | ; ABSENT-NOT: DW_AT_const_value |
| 215 | ; ABSENT-NOT: location |
| 216 | ; ABSENT: DW_AT_name {{.*}} "const_a" |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 217 | ; ABSENT-NOT: DW_AT_linkage_name |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 218 | ; ABSENT-NOT: location |
| 219 | ; ABSENT: DW_AT_name {{.*}} "b" |
| 220 | ; ABSENT-NOT: DW_AT_const_value |
| 221 | ; ABSENT-NOT: location |
| 222 | ; ABSENT: DW_AT_name {{.*}} "const_b" |
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: location |
| 225 | ; ABSENT: DW_AT_name {{.*}} "c" |
| 226 | ; ABSENT-NOT: DW_AT_const_value |
| 227 | ; ABSENT-NOT: location |
| 228 | ; ABSENT: DW_AT_name {{.*}} "const_c" |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 229 | ; ABSENT-NOT: DW_AT_linkage_name |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 230 | ; ABSENT-NOT: location |
| 231 | ; While we're here, a normal member does not have a linkage name, constant |
| 232 | ; value, or DW_AT_location. |
| 233 | ; ABSENT: DW_AT_name {{.*}} "d" |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 234 | ; ABSENT-NOT: DW_AT_linkage_name |
Eric Christopher | ce26df8 | 2013-01-16 19:53:47 +0000 | [diff] [blame] | 235 | ; ABSENT-NOT: DW_AT_const_value |
| 236 | ; ABSENT-NOT: DW_AT_location |
| 237 | ; ABSENT: NULL |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 238 | |
| 239 | ; For Darwin gdb: |
| 240 | ; DARWINA: .debug_info contents: |
| 241 | ; DARWINA: DW_TAG_member |
| 242 | ; DARWINA: DW_AT_name {{.*}} "a" |
| 243 | ; DARWINA-NOT: DW_AT_const_value |
| 244 | ; DARWINA-NOT: location |
| 245 | ; DARWINA: DW_AT_name {{.*}} "const_a" |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 246 | ; DARWINA-NOT: DW_AT_linkage_name |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 247 | ; DARWINA-NOT: location |
| 248 | ; DARWINA: DW_AT_name {{.*}} "b" |
| 249 | ; DARWINA-NOT: DW_AT_const_value |
| 250 | ; DARWINA-NOT: location |
| 251 | ; DARWINA: DW_AT_name {{.*}} "const_b" |
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: location |
| 254 | ; DARWINA: DW_AT_name {{.*}} "c" |
| 255 | ; DARWINA-NOT: DW_AT_const_value |
| 256 | ; DARWINA-NOT: location |
| 257 | ; DARWINA: DW_AT_name {{.*}} "const_c" |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 258 | ; DARWINA-NOT: DW_AT_linkage_name |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 259 | ; DARWINA-NOT: location |
| 260 | ; While we're here, a normal member does not have a linkage name, constant |
| 261 | ; value, or DW_AT_location. |
| 262 | ; DARWINA: DW_AT_name {{.*}} "d" |
Eric Christopher | af7eca2 | 2014-03-13 23:26:25 +0000 | [diff] [blame] | 263 | ; DARWINA-NOT: DW_AT_linkage_name |
Manman Ren | 584e4c0 | 2013-02-27 23:21:02 +0000 | [diff] [blame] | 264 | ; DARWINA-NOT: DW_AT_const_value |
| 265 | ; DARWINA-NOT: DW_AT_location |
| 266 | ; DARWINA: NULL |