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' |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 14 | source_filename = "test/DebugInfo/X86/memberfnptr.ll" |
Adrian Prantl | 3026a54 | 2014-12-24 01:17:51 +0000 | [diff] [blame] | 15 | target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
| 16 | target triple = "x86_64-apple-macosx" |
| 17 | |
| 18 | %struct.A = type { i8 } |
| 19 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 20 | @p = global { i64, i64 } { i64 ptrtoint (void (%struct.A*)* @_ZN1A3fooEv to i64), i64 0 }, align 8, !dbg !0 |
Adrian Prantl | 3026a54 | 2014-12-24 01:17:51 +0000 | [diff] [blame] | 21 | |
| 22 | declare void @_ZN1A3fooEv(%struct.A*) |
| 23 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 24 | !llvm.dbg.cu = !{!10} |
Adrian Prantl | 3026a54 | 2014-12-24 01:17:51 +0000 | [diff] [blame] | 25 | !llvm.module.flags = !{!14, !15, !16} |
| 26 | !llvm.ident = !{!17} |
| 27 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 28 | !0 = !DIGlobalVariableExpression(var: !1) |
| 29 | !1 = !DIGlobalVariable(name: "p", scope: null, file: !2, line: 5, type: !3, isLocal: false, isDefinition: true) |
| 30 | !2 = !DIFile(filename: "memberfnptr.cpp", directory: "") |
| 31 | !3 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !4, size: 64, extraData: !7) |
| 32 | !4 = !DISubroutineType(types: !5) |
| 33 | !5 = !{null, !6} |
| 34 | !6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) |
| 35 | !7 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !2, line: 1, size: 8, align: 8, elements: !8, identifier: "_ZTS1A") |
| 36 | !8 = !{!9} |
| 37 | !9 = !DISubprogram(name: "foo", linkageName: "_ZN1A3fooEv", scope: !7, file: !2, line: 2, type: !4, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false) |
| 38 | !10 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.6.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !11, retainedTypes: !12, globals: !13, imports: !11) |
| 39 | !11 = !{} |
| 40 | !12 = !{!7} |
| 41 | !13 = !{!0} |
Adrian Prantl | 3026a54 | 2014-12-24 01:17:51 +0000 | [diff] [blame] | 42 | !14 = !{i32 2, !"Dwarf Version", i32 2} |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 43 | !15 = !{i32 2, !"Debug Info Version", i32 3} |
Adrian Prantl | 3026a54 | 2014-12-24 01:17:51 +0000 | [diff] [blame] | 44 | !16 = !{i32 1, !"PIC Level", i32 2} |
| 45 | !17 = !{!"clang version 3.6.0 "} |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 46 | |