2014-12-24 09:17:51 +08:00
; struct A {
; void foo();
; };
;
; void (A::*p)() = &A::foo;
;
2017-09-12 06:59:45 +08:00
; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck %s
2014-12-24 09:17:51 +08:00
; Check that the member function pointer is emitted without a DW_AT_size attribute.
; CHECK: DW_TAG_ptr_to_member_type
; CHECK-NOT: DW_AT_{{.*}}size
; CHECK: DW_TAG
;
; ModuleID = 'memberfnptr.cpp'
2016-12-22 08:45:21 +08:00
source_filename = "test/DebugInfo/X86/memberfnptr.ll"
2014-12-24 09:17:51 +08:00
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx"
%struct.A = type { i8 }
2016-12-22 08:45:21 +08:00
@p = global { i64 , i64 } { i64 ptrtoint ( void ( %struct.A * ) * @_ZN1A3fooEv to i64 ) , i64 0 } , align 8 , !dbg !0
2014-12-24 09:17:51 +08:00
declare void @_ZN1A3fooEv ( %struct.A * )
2016-12-22 08:45:21 +08:00
!llvm.dbg.cu = ! { !10 }
2014-12-24 09:17:51 +08:00
!llvm.module.flags = ! { !14 , !15 , !16 }
!llvm.ident = ! { !17 }
2017-08-31 02:06:51 +08:00
!0 = !DIGlobalVariableExpression ( var: !1 , expr: !DIExpression ( ) )
2016-12-22 08:45:21 +08:00
!1 = !DIGlobalVariable ( name: "p" , scope: null , file: !2 , line: 5 , type: !3 , isLocal: false , isDefinition: true )
!2 = !DIFile ( filename: "memberfnptr.cpp" , directory: "" )
!3 = !DIDerivedType ( tag: D W _ T A G _ p t r _ t o _ m e m b e r _ type , baseType: !4 , size: 64 , extraData: !7 )
!4 = !DISubroutineType ( types: !5 )
!5 = ! { null , !6 }
!6 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , baseType: !7 , size: 64 , align: 64 , flags: D I F l a g A r t i f i c i a l | D I F l a g O b j e c t P o i n t e r )
!7 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "A" , file: !2 , line: 1 , size: 8 , align: 8 , elements: !8 , identifier: "_ZTS1A" )
!8 = ! { !9 }
!9 = !DISubprogram ( name: "foo" , linkageName: "_ZN1A3fooEv" , scope: !7 , file: !2 , line: 2 , type: !4 , isLocal: false , isDefinition: false , scopeLine: 2 , flags: D I F l a g P r o t o t y p e d , isOptimized: false )
!10 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , file: !2 , producer: "clang version 3.6.0 " , isOptimized: false , runtimeVersion: 0 , emissionKind: F u l l D e b u g , enums: !11 , retainedTypes: !12 , globals: !13 , imports: !11 )
!11 = ! { }
!12 = ! { !7 }
!13 = ! { !0 }
2014-12-24 09:17:51 +08:00
!14 = ! { i32 2 , !"Dwarf Version" , i32 2 }
2015-03-04 01:24:31 +08:00
!15 = ! { i32 2 , !"Debug Info Version" , i32 3 }
2014-12-24 09:17:51 +08:00
!16 = ! { i32 1 , !"PIC Level" , i32 2 }
!17 = ! { !"clang version 3.6.0 " }
2016-12-22 08:45:21 +08:00