2014-02-14 01:26:55 +00:00
; RUN: llc -generate-arange-section < %s | FileCheck %s
2013-09-19 23:21:01 +00:00
; -- header --
2013-10-03 22:07:08 +00:00
; CHECK: .short 2 # DWARF Arange version number
2015-03-10 03:58:36 +00:00
; CHECK-NEXT: .long .Lcu_begin0
2013-10-03 22:07:08 +00:00
; CHECK-NEXT: .byte 8 # Address Size (in bytes)
; CHECK-NEXT: .byte 0 # Segment Size (in bytes)
2013-09-19 23:21:01 +00:00
; -- alignment --
2014-01-07 19:28:14 +00:00
; CHECK-NEXT: .zero 4,255
2013-09-19 23:21:01 +00:00
2015-03-09 22:08:37 +00:00
; <data section> - it should have made one span covering all vars in this CU.
; CHECK-NEXT: .quad some_data
2015-03-23 21:22:04 +00:00
; CHECK-NEXT: .quad .Lsec_end0-some_data
2015-03-09 22:08:37 +00:00
; <other sections> - it should have made one span covering all vars in this CU.
; CHECK-NEXT: .quad some_other
2015-03-23 21:22:04 +00:00
; CHECK-NEXT: .quad .Lsec_end1-some_other
2015-03-09 22:08:37 +00:00
2013-10-03 22:07:08 +00:00
; <common symbols> - it should have made one span for each symbol.
; CHECK-NEXT: .quad some_bss
; CHECK-NEXT: .quad 4
2013-09-19 23:21:01 +00:00
2013-10-03 22:07:08 +00:00
; <text section> - it should have made one span covering all functions in this CU.
; CHECK-NEXT: .quad .Lfunc_begin0
2015-03-23 21:22:04 +00:00
; CHECK-NEXT: .quad .Lsec_end2-.Lfunc_begin0
2013-09-19 23:21:01 +00:00
2013-10-03 22:07:08 +00:00
; -- finish --
; CHECK-NEXT: # ARange terminator
2013-09-19 23:21:01 +00:00
; -- source code --
; Generated from: "clang -c -g -emit-llvm"
;
; int some_data = 4;
; int some_bss;
2013-10-03 22:07:08 +00:00
; int some_other __attribute__ ((section ("strange+section"))) = 5;
2013-09-19 23:21:01 +00:00
;
; void some_code()
; {
; some_bss += some_data + some_other;
; }
target triple = "x86_64-unknown-linux-gnu"
@some_data = global i32 4 , align 4
2013-10-03 22:07:08 +00:00
@some_other = global i32 5 , section "strange+section" , align 4
2013-09-19 23:21:01 +00:00
@some_bss = common global i32 0 , align 4
define void @some_code ( ) {
entry:
2015-02-27 21:17:42 +00:00
%0 = load i32 , i32 * @some_data , align 4 , !dbg !14
%1 = load i32 , i32 * @some_other , align 4 , !dbg !14
2013-09-19 23:21:01 +00:00
%add = add nsw i32 %0 , %1 , !dbg !14
2015-02-27 21:17:42 +00:00
%2 = load i32 , i32 * @some_bss , align 4 , !dbg !14
2013-09-19 23:21:01 +00:00
%add1 = add nsw i32 %2 , %add , !dbg !14
store i32 %add1 , i32 * @some_bss , align 4 , !dbg !14
ret void , !dbg !15
}
!llvm.dbg.cu = ! { !0 }
2013-11-22 21:49:45 +00:00
!llvm.module.flags = ! { !13 , !16 }
2013-09-19 23:21:01 +00:00
2015-04-29 16:38:44 +00:00
!0 = !DICompileUnit ( language: D W _ L A N G _ C 99 , producer: "clang version 3.4 " , isOptimized: false , emissionKind: 0 , file: !1 , enums: !2 , retainedTypes: !2 , subprograms: !3 , globals: !8 , imports: !2 )
!1 = !DIFile ( filename: "test.c" , directory: "/home/kayamon" )
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!2 = ! { }
!3 = ! { !4 }
2015-04-29 16:38:44 +00:00
!4 = !DISubprogram ( name: "some_code" , line: 5 , isLocal: false , isDefinition: true , virtualIndex: 6 , isOptimized: false , scopeLine: 6 , file: !1 , scope: !5 , type: !6 , function: void ( ) * @some_code , variables: !2 )
!5 = !DIFile ( filename: "test.c" , directory: "/home/kayamon" )
!6 = !DISubroutineType ( types: !7 )
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!7 = ! { null }
!8 = ! { !9 , !11 , !12 }
2015-04-29 16:38:44 +00:00
!9 = !DIGlobalVariable ( name: "some_data" , line: 1 , isLocal: false , isDefinition: true , scope: null , file: !5 , type: !10 , variable: i32 * @some_data )
!10 = !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 )
!11 = !DIGlobalVariable ( name: "some_other" , line: 3 , isLocal: false , isDefinition: true , scope: null , file: !5 , type: !10 , variable: i32 * @some_other )
!12 = !DIGlobalVariable ( name: "some_bss" , line: 2 , isLocal: false , isDefinition: true , scope: null , file: !5 , type: !10 , variable: i32 * @some_bss )
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!13 = ! { i32 2 , !"Dwarf Version" , i32 4 }
2015-04-29 16:38:44 +00:00
!14 = !DILocation ( line: 7 , scope: !4 )
!15 = !DILocation ( line: 8 , scope: !4 )
2015-03-03 17:24:31 +00:00
!16 = ! { i32 1 , !"Debug Info Version" , i32 3 }