Adrian Prantl | 3026a54 | 2014-12-24 01:17:51 +0000 | [diff] [blame] | 1 | ; struct A { |
| 2 | ; void foo(); |
| 3 | ; }; |
| 4 | ; |
| 5 | ; void (A::*p)() = &A::foo; |
| 6 | ; |
| 7 | ; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s |
| 8 | ; Check that the member function pointer is emitted without a DW_AT_size attribute. |
| 9 | ; CHECK: DW_TAG_ptr_to_member_type |
| 10 | ; CHECK-NOT: DW_AT_{{.*}}size |
| 11 | ; CHECK: DW_TAG |
| 12 | ; |
| 13 | ; ModuleID = 'memberfnptr.cpp' |
| 14 | target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
| 15 | target triple = "x86_64-apple-macosx" |
| 16 | |
| 17 | %struct.A = type { i8 } |
| 18 | |
Peter Collingbourne | d4135bb | 2016-09-13 01:12:59 +0000 | [diff] [blame] | 19 | @p = global { i64, i64 } { i64 ptrtoint (void (%struct.A*)* @_ZN1A3fooEv to i64), i64 0 }, align 8, !dbg !11 |
Adrian Prantl | 3026a54 | 2014-12-24 01:17:51 +0000 | [diff] [blame] | 20 | |
| 21 | declare void @_ZN1A3fooEv(%struct.A*) |
| 22 | |
| 23 | !llvm.dbg.cu = !{!0} |
| 24 | !llvm.module.flags = !{!14, !15, !16} |
| 25 | !llvm.ident = !{!17} |
| 26 | |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 27 | !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !10, imports: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 28 | !1 = !DIFile(filename: "memberfnptr.cpp", directory: "") |
Adrian Prantl | 3026a54 | 2014-12-24 01:17:51 +0000 | [diff] [blame] | 29 | !2 = !{} |
| 30 | !3 = !{!4} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 31 | !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", line: 1, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS1A") |
Adrian Prantl | 3026a54 | 2014-12-24 01:17:51 +0000 | [diff] [blame] | 32 | !5 = !{!6} |
Duncan P. N. Exon Smith | a59d3e5 | 2016-04-23 21:08:00 +0000 | [diff] [blame] | 33 | !6 = !DISubprogram(name: "foo", linkageName: "_ZN1A3fooEv", line: 2, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !4, type: !7) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 34 | !7 = !DISubroutineType(types: !8) |
Adrian Prantl | 3026a54 | 2014-12-24 01:17:51 +0000 | [diff] [blame] | 35 | !8 = !{null, !9} |
Duncan P. N. Exon Smith | a59d3e5 | 2016-04-23 21:08:00 +0000 | [diff] [blame] | 36 | !9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4) |
Adrian Prantl | 3026a54 | 2014-12-24 01:17:51 +0000 | [diff] [blame] | 37 | !10 = !{!11} |
Adrian Prantl | bceaaa9 | 2016-12-20 02:09:43 +0000 | [diff] [blame] | 38 | !11 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "p", line: 5, isLocal: false, isDefinition: true, scope: null, file: !12, type: !13)) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 39 | !12 = !DIFile(filename: "memberfnptr.cpp", directory: "") |
Duncan P. N. Exon Smith | a59d3e5 | 2016-04-23 21:08:00 +0000 | [diff] [blame] | 40 | !13 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, size: 64, baseType: !7, extraData: !4) |
Adrian Prantl | 3026a54 | 2014-12-24 01:17:51 +0000 | [diff] [blame] | 41 | !14 = !{i32 2, !"Dwarf Version", i32 2} |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 42 | !15 = !{i32 2, !"Debug Info Version", i32 3} |
Adrian Prantl | 3026a54 | 2014-12-24 01:17:51 +0000 | [diff] [blame] | 43 | !16 = !{i32 1, !"PIC Level", i32 2} |
| 44 | !17 = !{!"clang version 3.6.0 "} |