2011-11-11 06:34:29 +08:00
; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
2017-09-12 07:05:20 +08:00
; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s
2011-11-11 06:34:29 +08:00
; test that the DW_AT_specification is a back edge in the file.
2014-10-06 11:36:31 +08:00
; CHECK: DW_TAG_subprogram
2015-03-11 06:44:45 +08:00
; CHECK-NEXT: DW_AT_linkage_name {{.*}} "_ZN3foo3barEv"
2014-05-22 02:04:33 +08:00
; CHECK: DW_TAG_subprogram
2014-06-25 04:10:27 +08:00
; CHECK-NOT: DW_TAG
2014-10-06 11:36:31 +08:00
; CHECK: DW_AT_specification {{.*}} "_ZN3foo3barEv"
2011-11-11 06:34:29 +08:00
2016-12-22 08:45:21 +08:00
source_filename = "test/DebugInfo/X86/DW_AT_specification.ll"
2011-11-11 06:34:29 +08:00
2016-12-22 08:45:21 +08:00
@_ZZN3foo3barEvE1x = constant i32 0 , align 4 , !dbg !0
2011-11-11 06:34:29 +08:00
2016-12-22 08:45:21 +08:00
define void @_ZN3foo3barEv ( ) !dbg !2 {
2011-11-11 06:34:29 +08:00
entry:
2016-12-22 08:45:21 +08:00
ret void , !dbg !17
2011-11-11 06:34:29 +08:00
}
2016-12-22 08:45:21 +08:00
!llvm.dbg.cu = ! { !8 }
!llvm.module.flags = ! { !16 }
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: "x" , scope: !2 , file: !3 , line: 5 , type: !14 , isLocal: true , isDefinition: true )
!2 = distinct !DISubprogram ( name: "bar" , linkageName: "_ZN3foo3barEv" , scope: null , file: !3 , line: 4 , type: !4 , isLocal: false , isDefinition: true , scopeLine: 4 , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , unit: !8 , declaration: !11 )
!3 = !DIFile ( filename: "nsNativeAppSupportBase.ii" , directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/toolkit/library" )
!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 )
!7 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "foo" , file: !3 , line: 1 , flags: D I F l a g F w d D e c l )
!8 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , file: !3 , producer: "clang version 3.0 ()" , isOptimized: false , runtimeVersion: 0 , emissionKind: F u l l D e b u g , enums: !9 , retainedTypes: !9 , globals: !10 , imports: !9 )
!9 = ! { }
!10 = ! { !0 }
!11 = !DISubprogram ( name: "bar" , linkageName: "_ZN3foo3barEv" , scope: !12 , file: !3 , line: 2 , type: !4 , isLocal: false , isDefinition: false , scopeLine: 2 , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false )
!12 = !DICompositeType ( tag: D W _ T A G _ c l a s s _ type , name: "foo" , file: !3 , line: 1 , size: 8 , align: 8 , elements: !13 )
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!13 = ! { !11 }
2016-12-22 08:45:21 +08:00
!14 = !DIDerivedType ( tag: D W _ T A G _ c o n s t _ type , baseType: !15 )
!15 = !DIBasicType ( name: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
!16 = ! { i32 1 , !"Debug Info Version" , i32 3 }
!17 = !DILocation ( line: 6 , column: 1 , scope: !18 )
!18 = distinct !DILexicalBlock ( scope: !2 , file: !3 , line: 4 , column: 17 )