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'
2016-12-22 08:45:21 +08:00
source_filename = "test/DebugInfo/X86/multiple-aranges.ll"
2013-09-20 07:21:01 +08:00
target triple = "x86_64-unknown-linux-gnu"
2016-12-22 08:45:21 +08:00
@kittens = global i32 4 , align 4 , !dbg !0
@rainbows = global i32 5 , align 4 , !dbg !4
2013-09-20 07:21:01 +08:00
2016-12-22 08:45:21 +08:00
!llvm.dbg.cu = ! { !7 , !10 }
2013-11-23 05:49:45 +08:00
!llvm.module.flags = ! { !12 , !13 }
2013-09-20 07:21:01 +08:00
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: "kittens" , scope: null , file: !2 , line: 1 , type: !3 , isLocal: false , isDefinition: true )
!2 = !DIFile ( filename: "test1.c" , directory: "/home/kayamon" )
!3 = !DIBasicType ( name: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
2017-08-31 02:06:51 +08:00
!4 = !DIGlobalVariableExpression ( var: !5 , expr: !DIExpression ( ) )
2016-12-22 08:45:21 +08:00
!5 = !DIGlobalVariable ( name: "rainbows" , scope: null , file: !6 , line: 1 , type: !3 , isLocal: false , isDefinition: true )
!6 = !DIFile ( filename: "test2.c" , directory: "/home/kayamon" )
!7 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , file: !2 , producer: "clang version 3.4 " , isOptimized: false , runtimeVersion: 0 , emissionKind: F u l l D e b u g , enums: !8 , retainedTypes: !8 , globals: !9 , imports: !8 )
!8 = ! { }
!9 = ! { !0 }
!10 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , file: !6 , producer: "clang version 3.4 " , isOptimized: false , runtimeVersion: 0 , emissionKind: F u l l D e b u g , enums: !8 , retainedTypes: !8 , globals: !11 , imports: !8 )
!11 = ! { !4 }
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 }
2016-12-22 08:45:21 +08:00