2014-01-30 09:39:17 +08:00
; RUN: %llc_dwarf -O0 < %s | FileCheck %s -check-prefix ARGUMENT
; RUN: %llc_dwarf -O0 < %s | FileCheck %s -check-prefix VARIABLE
2012-07-06 16:45:08 +08:00
; PR 13202
2015-11-06 06:03:56 +08:00
define i32 @main ( ) uwtable !dbg !5 {
2012-07-06 16:45:08 +08:00
entry:
2017-07-29 04:21:02 +08:00
tail call void @llvm.dbg.value ( metadata i32 0 , metadata !18 , metadata !DIExpression ( ) ) , !dbg !21
tail call void @llvm.dbg.value ( metadata i32 0 , metadata !22 , metadata !DIExpression ( ) ) , !dbg !23
2012-07-06 16:45:08 +08:00
tail call void @smth ( i32 0 ) , !dbg !24
tail call void @smth ( i32 0 ) , !dbg !25
ret i32 0 , !dbg !19
}
declare void @smth ( i32 )
2017-07-29 04:21:02 +08:00
declare void @llvm.dbg.value ( metadata , metadata , metadata ) nounwind readnone
2012-07-06 16:45:08 +08:00
!llvm.dbg.cu = ! { !0 }
2013-11-23 05:49:45 +08:00
!llvm.module.flags = ! { !27 }
2012-07-06 16:45:08 +08:00
2016-04-15 23:57:41 +08:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , producer: "clang version 3.2 (trunk 159419)" , isOptimized: true , emissionKind: F u l l D e b u g , file: !26 , enums: !2 , retainedTypes: !2 , globals: !2 , imports: !2 )
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
!1 = ! { i32 0 }
!2 = ! { }
2016-04-15 23:57:41 +08:00
!5 = distinct !DISubprogram ( name: "main" , line: 10 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !0 , scopeLine: 10 , file: !26 , scope: !6 , type: !7 , variables: !2 )
2015-04-30 00:38:44 +08:00
!6 = !DIFile ( filename: "inline-bug.cc" , directory: "/tmp/dbginfo/pr13202" )
!7 = !DISubroutineType ( types: !8 )
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
!8 = ! { !9 }
2015-04-30 00:38:44 +08:00
!9 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
2016-04-15 23:57:41 +08:00
!10 = distinct !DISubprogram ( name: "f" , linkageName: "_ZL1fi" , line: 3 , isLocal: true , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !0 , scopeLine: 3 , file: !26 , scope: !6 , type: !11 , variables: !13 )
2015-04-30 00:38:44 +08:00
!11 = !DISubroutineType ( types: !12 )
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
!12 = ! { !9 , !9 }
!13 = ! { !15 , !16 }
2015-08-01 02:58:39 +08:00
!15 = !DILocalVariable ( name: "argument" , line: 3 , arg: 1 , scope: !10 , file: !6 , type: !9 )
2012-07-06 16:45:08 +08:00
; Two DW_TAG_formal_parameter: one abstract and one inlined.
; ARGUMENT: {{.*Abbrev.*DW_TAG_formal_parameter}}
; ARGUMENT: {{.*Abbrev.*DW_TAG_formal_parameter}}
; ARGUMENT-NOT: {{.*Abbrev.*DW_TAG_formal_parameter}}
2015-08-01 02:58:39 +08:00
!16 = !DILocalVariable ( name: "local" , line: 4 , scope: !10 , file: !6 , type: !9 )
2012-07-06 16:45:08 +08:00
; Two DW_TAG_variable: one abstract and one inlined.
; VARIABLE: {{.*Abbrev.*DW_TAG_variable}}
; VARIABLE: {{.*Abbrev.*DW_TAG_variable}}
; VARIABLE-NOT: {{.*Abbrev.*DW_TAG_variable}}
2015-08-01 02:58:39 +08:00
!18 = !DILocalVariable ( name: "argument" , line: 3 , arg: 1 , scope: !10 , file: !6 , type: !9 )
2015-04-30 00:38:44 +08:00
!19 = !DILocation ( line: 11 , column: 10 , scope: !5 )
!21 = !DILocation ( line: 3 , column: 25 , scope: !10 , inlinedAt: !19 )
2015-08-01 02:58:39 +08:00
!22 = !DILocalVariable ( name: "local" , line: 4 , scope: !10 , file: !6 , type: !9 )
2015-04-30 00:38:44 +08:00
!23 = !DILocation ( line: 4 , column: 16 , scope: !10 , inlinedAt: !19 )
!24 = !DILocation ( line: 5 , column: 3 , scope: !10 , inlinedAt: !19 )
!25 = !DILocation ( line: 6 , column: 3 , scope: !10 , inlinedAt: !19 )
!26 = !DIFile ( filename: "inline-bug.cc" , directory: "/tmp/dbginfo/pr13202" )
2015-03-04 01:24:31 +08:00
!27 = ! { i32 1 , !"Debug Info Version" , i32 3 }