Manman Ren | e8064c9 | 2013-07-24 18:56:43 +0000 | [diff] [blame] | 1 | ; RUN: llc -O0 %s -mtriple=x86_64-apple-darwin -filetype=obj -o %t |
Manman Ren | e697d3c | 2013-02-01 23:54:37 +0000 | [diff] [blame] | 2 | ; RUN: llvm-dwarfdump %t | FileCheck %s |
| 3 | |
| 4 | ; rdar://13071590 |
| 5 | ; Check we are not emitting mutliple AT_const_value for a single member. |
| 6 | ; CHECK: .debug_info contents: |
| 7 | ; CHECK: DW_TAG_compile_unit |
| 8 | ; CHECK: DW_TAG_class_type |
| 9 | ; CHECK: DW_TAG_member |
| 10 | ; CHECK: badbit |
Eric Christopher | 9d1daa8 | 2013-08-27 23:49:04 +0000 | [diff] [blame] | 11 | ; CHECK: DW_AT_const_value [DW_FORM_sdata] (1) |
Manman Ren | e697d3c | 2013-02-01 23:54:37 +0000 | [diff] [blame] | 12 | ; CHECK-NOT: DW_AT_const_value |
| 13 | ; CHECK: NULL |
| 14 | |
| 15 | %"class.std::basic_ostream" = type { i32 (...)**, %"class.std::basic_os" } |
| 16 | %"class.std::basic_os" = type { %"class.std::os_base", %"class.std::basic_ostream"*, i8, i8 } |
| 17 | %"class.std::os_base" = type { i32 (...)**, i64, i64, i32, i32, i32 } |
| 18 | |
| 19 | @_ZSt4cout = external global %"class.std::basic_ostream" |
| 20 | @.str = private unnamed_addr constant [6 x i8] c"c is \00", align 1 |
| 21 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 22 | define i32 @main() !dbg !960 { |
Manman Ren | e697d3c | 2013-02-01 23:54:37 +0000 | [diff] [blame] | 23 | entry: |
David Blaikie | f72d05b | 2015-03-13 18:20:45 +0000 | [diff] [blame] | 24 | %call1.i = tail call %"class.std::basic_ostream"* @test(%"class.std::basic_ostream"* @_ZSt4cout, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5) |
Manman Ren | e697d3c | 2013-02-01 23:54:37 +0000 | [diff] [blame] | 25 | ret i32 0 |
| 26 | } |
| 27 | |
| 28 | declare %"class.std::basic_ostream"* @test(%"class.std::basic_ostream"*, i8*, i64) |
| 29 | |
Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 30 | declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone |
Manman Ren | e697d3c | 2013-02-01 23:54:37 +0000 | [diff] [blame] | 31 | |
| 32 | !llvm.dbg.cu = !{!0} |
Manman Ren | 409558f | 2013-11-22 21:49:45 +0000 | [diff] [blame] | 33 | !llvm.module.flags = !{!1803} |
Manman Ren | e697d3c | 2013-02-01 23:54:37 +0000 | [diff] [blame] | 34 | |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 35 | !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 174207)", isOptimized: true, emissionKind: FullDebug, file: !1802, enums: !1, retainedTypes: !955, globals: !1786, imports: !955) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 36 | !1 = !{!26} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 37 | !4 = !DINamespace(name: "std", line: 48, scope: !5) |
| 38 | !5 = !DIFile(filename: "os_base.h", directory: "/privite/tmp") |
| 39 | !25 = !DIEnumerator(name: "_S_os_fmtflags_end", value: 65536) ; [ DW_TAG_enumerator ] |
| 40 | !26 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "_Ios_Iostate", line: 146, size: 32, align: 32, file: !1801, scope: !4, elements: !27) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 41 | !27 = !{!28, !29, !30, !31, !32} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 42 | !28 = !DIEnumerator(name: "_S_goodbit", value: 0) ; [ DW_TAG_enumerator ] [_S_goodbit :: 0] |
| 43 | !29 = !DIEnumerator(name: "_S_badbit", value: 1) ; [ DW_TAG_enumerator ] [_S_badbit :: 1] |
| 44 | !30 = !DIEnumerator(name: "_S_eofbit", value: 2) ; [ DW_TAG_enumerator ] [_S_eofbit :: 2] |
| 45 | !31 = !DIEnumerator(name: "_S_failbit", value: 4) ; [ DW_TAG_enumerator ] [_S_failbit :: 4] |
| 46 | !32 = !DIEnumerator(name: "_S_os_ostate_end", value: 65536) ; [ DW_TAG_enumerator ] [_S_os_ostate_end :: 65536] |
| 47 | !49 = !DICompositeType(tag: DW_TAG_class_type, name: "os_base", line: 200, size: 1728, align: 64, file: !1801, scope: !4, elements: !50, vtableHolder: !49) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 48 | !50 = !{!77} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 49 | !54 = !DISubroutineType(types: !55) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 50 | !55 = !{!56} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 51 | !56 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 52 | !77 = !DIDerivedType(tag: DW_TAG_member, name: "badbit", line: 331, flags: DIFlagStaticMember, file: !1801, scope: !49, baseType: !78, extraData: i32 1) |
| 53 | !78 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !79) |
| 54 | !79 = !DIDerivedType(tag: DW_TAG_typedef, name: "ostate", line: 327, file: !1801, scope: !49, baseType: !26) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 55 | !955 = !{} |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 56 | !960 = distinct !DISubprogram(name: "main", line: 73, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 73, file: !1802, scope: null, type: !54, variables: !955) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 57 | !961 = !DIFile(filename: "student2.cpp", directory: "/privite/tmp") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 58 | !1786 = !{!1800} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 59 | !1800 = !DIGlobalVariable(name: "badbit", linkageName: "badbit", line: 331, isLocal: true, isDefinition: true, scope: !5, file: !5, type: !78, variable: i32 1, declaration: !77) |
| 60 | !1801 = !DIFile(filename: "os_base.h", directory: "/privite/tmp") |
| 61 | !1802 = !DIFile(filename: "student2.cpp", directory: "/privite/tmp") |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 62 | !1803 = !{i32 1, !"Debug Info Version", i32 3} |