2011-08-05 03:44:28 +08:00
; RUN: llvm-link %s %p/2011-08-04-Metadata2.ll -o %t.bc
; RUN: llvm-dis < %t.bc | FileCheck %s
; Test if internal global variable's debug info is merged appropriately or not.
2016-09-13 09:12:59 +08:00
; CHECK: @x = internal global i32 0, align 4, !dbg [[DI1:![0-9]+]]
; CHECK: @x.1 = internal global i32 0, align 4, !dbg [[DI2:![0-9]+]]
2017-08-31 02:06:51 +08:00
; CHECK: [[DI1]] = !DIGlobalVariableExpression(var: [[V1:.*]], expr: !DIExpression())
2016-12-20 10:09:43 +08:00
; CHECK: [[V1]] = !DIGlobalVariable(name: "x",
; CHECK-NOT: linkageName:
2017-08-31 02:06:51 +08:00
; CHECK: [[DI2]] = !DIGlobalVariableExpression(var: [[V2:.*]], expr: !DIExpression())
2016-12-20 10:09:43 +08:00
; CHECK: [[V2]] = !DIGlobalVariable(name: "x",
; CHECK-NOT: linkageName:
2016-12-22 08:45:21 +08:00
source_filename = "test/Linker/2011-08-04-Metadata.ll"
2011-08-05 03:44:28 +08:00
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-apple-macosx10.7.0"
2016-12-22 08:45:21 +08:00
@x = internal global i32 0 , align 4 , !dbg !0
2011-08-05 03:44:28 +08:00
2016-12-22 08:45:21 +08:00
; Function Attrs: nounwind ssp uwtable
define void @foo ( ) #0 !dbg !8 {
2011-08-05 03:44:28 +08:00
entry:
2016-12-22 08:45:21 +08:00
store i32 1 , i32 * @x , align 4 , !dbg !11
ret void , !dbg !11
2011-08-05 03:44:28 +08:00
}
2016-12-22 08:45:21 +08:00
attributes #0 = { nounwind ssp uwtable }
!llvm.dbg.cu = ! { !2 }
!llvm.module.flags = ! { !7 }
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: 2 , type: !6 , isLocal: true , isDefinition: true )
!2 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , file: !3 , producer: "clang version 3.0 ()" , isOptimized: true , runtimeVersion: 0 , emissionKind: F u l l D e b u g , enums: !4 , retainedTypes: !4 , globals: !5 )
!3 = !DIFile ( filename: "/tmp/one.c" , directory: "/Volumes/Lalgate/Slate/D" )
!4 = ! { }
!5 = ! { !0 }
!6 = !DIBasicType ( name: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
!7 = ! { i32 1 , !"Debug Info Version" , i32 3 }
!8 = distinct !DISubprogram ( name: "foo" , scope: !3 , file: !3 , line: 3 , type: !9 , isLocal: false , isDefinition: true , virtualIndex: 6 , isOptimized: false , unit: !2 )
!9 = !DISubroutineType ( types: !10 )
!10 = ! { null }
!11 = !DILocation ( line: 3 , column: 14 , scope: !12 )
!12 = distinct !DILexicalBlock ( scope: !8 , file: !3 , line: 3 , column: 12 )