2014-02-14 09:26:55 +08:00
; RUN: llc -generate-arange-section < %s | FileCheck %s
2013-09-20 07:21:01 +08:00
2015-03-24 05:22:04 +08:00
; CHECK: .section .debug_aranges,"",@progbits
2015-03-10 04:09:58 +08:00
2013-09-20 07:21:01 +08:00
; First CU
2015-03-10 04:09:58 +08:00
; CHECK-NEXT: .long 44 # Length of ARange Set
2013-09-20 07:21:01 +08:00
; CHECK-NEXT: .short 2 # DWARF Arange version number
2015-03-10 11:58:36 +08:00
; CHECK-NEXT: .long .Lcu_begin0 # Offset Into Debug Info Section
2013-09-20 07:21:01 +08:00
; CHECK-NEXT: .byte 8 # Address Size (in bytes)
; CHECK-NEXT: .byte 0 # Segment Size (in bytes)
2014-01-08 03:28:14 +08:00
; CHECK-NEXT: .zero 4,255
2013-09-20 07:21:01 +08:00
; CHECK-NEXT: .quad kittens
2014-10-21 09:17:30 +08:00
; CHECK-NEXT: .quad rainbows-kittens
2013-09-20 07:21:01 +08:00
; CHECK-NEXT: .quad 0 # ARange terminator
; CHECK-NEXT: .quad 0
; Second CU
; CHECK-NEXT: .long 44 # Length of ARange Set
; CHECK-NEXT: .short 2 # DWARF Arange version number
2015-03-10 11:58:36 +08:00
; CHECK-NEXT: .long .Lcu_begin1 # Offset Into Debug Info Section
2013-09-20 07:21:01 +08:00
; CHECK-NEXT: .byte 8 # Address Size (in bytes)
; CHECK-NEXT: .byte 0 # Segment Size (in bytes)
2014-01-08 03:28:14 +08:00
; CHECK-NEXT: .zero 4,255
2013-09-20 07:21:01 +08:00
; CHECK-NEXT: .quad rainbows
2015-03-24 05:22:04 +08:00
; CHECK-NEXT: .quad .Lsec_end0-rainbows
2013-09-20 07:21:01 +08:00
; CHECK-NEXT: .quad 0 # ARange terminator
; CHECK-NEXT: .quad 0
; Generated from: clang -c -g -emit-llvm
; llvm-link test1.bc test2.bc -o test.bc
; test1.c: int kittens = 4;
; test2.c: int rainbows = 5;
; ModuleID = 'test.bc'
target triple = "x86_64-unknown-linux-gnu"
@kittens = global i32 4 , align 4
@rainbows = global i32 5 , align 4
!llvm.dbg.cu = ! { !0 , !7 }
2013-11-23 05:49:45 +08:00
!llvm.module.flags = ! { !12 , !13 }
2013-09-20 07:21:01 +08:00
2015-04-30 00:38:44 +08: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: !2 , globals: !3 , imports: !2 )
!1 = !DIFile ( filename: "test1.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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!2 = ! { }
!3 = ! { !4 }
2015-04-30 00:38:44 +08:00
!4 = !DIGlobalVariable ( name: "kittens" , line: 1 , isLocal: false , isDefinition: true , scope: null , file: !5 , type: !6 , variable: i32 * @kittens )
!5 = !DIFile ( filename: "test1.c" , directory: "/home/kayamon" )
!6 = !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 )
!7 = !DICompileUnit ( language: D W _ L A N G _ C 99 , producer: "clang version 3.4 " , isOptimized: false , emissionKind: 0 , file: !8 , enums: !2 , retainedTypes: !2 , subprograms: !2 , globals: !9 , imports: !2 )
!8 = !DIFile ( filename: "test2.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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!9 = ! { !10 }
2015-04-30 00:38:44 +08:00
!10 = !DIGlobalVariable ( name: "rainbows" , line: 1 , isLocal: false , isDefinition: true , scope: null , file: !11 , type: !6 , variable: i32 * @rainbows )
!11 = !DIFile ( filename: "test2.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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!12 = ! { i32 2 , !"Dwarf Version" , i32 4 }
2015-03-04 01:24:31 +08:00
!13 = ! { i32 1 , !"Debug Info Version" , i32 3 }