Renumber testcase metadata nodes after r290153.
This patch renumbers the metadata nodes in debug info testcases after
https://reviews.llvm.org/D26769. This is a separate patch because it
causes so much churn. This was implemented with a python script that
pipes the testcases through llvm-as - | llvm-dis - and then goes
through the original and new output side-by side to insert all
comments at a close-enough location.
Differential Revision: https://reviews.llvm.org/D27765
llvm-svn: 290292
diff --git a/llvm/test/Transforms/GlobalMerge/debug-info.ll b/llvm/test/Transforms/GlobalMerge/debug-info.ll
index 2ec7b11..97e0bb2 100644
--- a/llvm/test/Transforms/GlobalMerge/debug-info.ll
+++ b/llvm/test/Transforms/GlobalMerge/debug-info.ll
@@ -1,27 +1,30 @@
; RUN: opt -global-merge -global-merge-max-offset=100 -S -o - %s | FileCheck %s
+source_filename = "test/Transforms/GlobalMerge/debug-info.ll"
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
-
; CHECK: @_MergedGlobals = private global { i32, i32 } { i32 1, i32 2 }, !dbg [[A:![0-9]+]], !dbg [[B:![0-9]+]]
@a = internal global i32 1, !dbg !0
-@b = internal global i32 2, !dbg !1
+@b = internal global i32 2, !dbg !2
define void @use1() {
%x = load i32, i32* @a
%y = load i32, i32* @b
ret void
}
-
; CHECK: [[A]] = !DIGlobalVariableExpression(var: [[AVAR:![0-9]+]])
; CHECK: [[AVAR]] = !DIGlobalVariable(name: "a", scope: null, isLocal: false, isDefinition: true)
; CHECK: [[B]] = !DIGlobalVariableExpression(var: [[BVAR:![0-9]+]], expr: [[EXPR:![0-9]+]])
; CHECK: [[BVAR]] = !DIGlobalVariable(name: "b", scope: null, isLocal: false, isDefinition: true)
; CHECK: [[EXPR]] = !DIExpression(DW_OP_plus, 4)
-!llvm.module.flags = !{!2, !3}
-!0 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a"))
-!1 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "b"))
-!2 = !{i32 2, !"Debug Info Version", i32 3}
-!3 = !{i32 2, !"Dwarf Version", i32 4}
+!llvm.module.flags = !{!4, !5}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: null, isLocal: false, isDefinition: true)
+!2 = !DIGlobalVariableExpression(var: !3)
+!3 = !DIGlobalVariable(name: "b", scope: null, isLocal: false, isDefinition: true)
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{i32 2, !"Dwarf Version", i32 4}
+
diff --git a/llvm/test/Transforms/GlobalOpt/2009-03-05-dbg.ll b/llvm/test/Transforms/GlobalOpt/2009-03-05-dbg.ll
index cced3c3..c785e13 100644
--- a/llvm/test/Transforms/GlobalOpt/2009-03-05-dbg.ll
+++ b/llvm/test/Transforms/GlobalOpt/2009-03-05-dbg.ll
@@ -2,81 +2,79 @@
; RUN: opt < %s -globalopt -stats -disable-output 2>&1 | FileCheck %s
; CHECK: 1 globalopt - Number of global vars shrunk to booleans
-@Stop = internal global i32 0, !dbg !0 ; <i32*> [#uses=3]
+source_filename = "test/Transforms/GlobalOpt/2009-03-05-dbg.ll"
-define i32 @foo(i32 %i) nounwind ssp {
+@Stop = internal global i32 0, !dbg !0
+
+; Function Attrs: nounwind ssp
+define i32 @foo(i32 %i) #0 {
entry:
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !3, metadata !DIExpression()), !dbg !7
- %0 = icmp eq i32 %i, 1, !dbg !7 ; <i1> [#uses=1]
- br i1 %0, label %bb, label %bb1, !dbg !7
+ %"alloca point" = bitcast i32 0 to i32
+ call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !8, metadata !12), !dbg !13
+ %0 = icmp eq i32 %i, 1, !dbg !13
+ br i1 %0, label %bb, label %bb1, !dbg !13
bb: ; preds = %entry
- store i32 0, i32* @Stop, align 4, !dbg !9
- %1 = mul nsw i32 %i, 42, !dbg !10 ; <i32> [#uses=1]
- call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !3, metadata !DIExpression()), !dbg !10
- br label %bb2, !dbg !10
+ store i32 0, i32* @Stop, align 4, !dbg !15
+ %1 = mul nsw i32 %i, 42, !dbg !16
+ call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !8, metadata !12), !dbg !16
+ br label %bb2, !dbg !16
bb1: ; preds = %entry
- store i32 1, i32* @Stop, align 4, !dbg !11
- br label %bb2, !dbg !11
+ store i32 1, i32* @Stop, align 4, !dbg !17
+ br label %bb2, !dbg !17
bb2: ; preds = %bb1, %bb
- %i_addr.0 = phi i32 [ %1, %bb ], [ %i, %bb1 ] ; <i32> [#uses=1]
- br label %return, !dbg !12
+ %i_addr.0 = phi i32 [ %1, %bb ], [ %i, %bb1 ]
+ br label %return, !dbg !18
return: ; preds = %bb2
- ret i32 %i_addr.0, !dbg !12
+ ret i32 %i_addr.0, !dbg !18
}
-declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
+; Function Attrs: nounwind readnone
-define i32 @bar() nounwind ssp {
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
+
+; Function Attrs: nounwind ssp
+define i32 @bar() #0 {
entry:
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %0 = load i32, i32* @Stop, align 4, !dbg !13 ; <i32> [#uses=1]
- %1 = icmp eq i32 %0, 1, !dbg !13 ; <i1> [#uses=1]
- br i1 %1, label %bb, label %bb1, !dbg !13
+ %"alloca point" = bitcast i32 0 to i32
+ %0 = load i32, i32* @Stop, align 4, !dbg !19
+ %1 = icmp eq i32 %0, 1, !dbg !19
+ br i1 %1, label %bb, label %bb1, !dbg !19
bb: ; preds = %entry
- br label %bb2, !dbg !18
+
+ br label %bb2, !dbg !24
bb1: ; preds = %entry
- br label %bb2, !dbg !19
+ br label %bb2, !dbg !25
bb2: ; preds = %bb1, %bb
- %.0 = phi i32 [ 0, %bb ], [ 1, %bb1 ] ; <i32> [#uses=1]
- br label %return, !dbg !19
+ %.0 = phi i32 [ 0, %bb ], [ 1, %bb1 ]
+ br label %return, !dbg !25
return: ; preds = %bb2
- ret i32 %.0, !dbg !19
+ ret i32 %.0, !dbg !25
}
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
-!llvm.dbg.cu = !{!1}
-!llvm.module.flags = !{!21, !22}
+attributes #0 = { nounwind ssp }
+attributes #1 = { nounwind readnone }
-!0 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "Stop", line: 2, isLocal: true, isDefinition: true, scope: !1, file: !20, type: !2))
-!1 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: FullDebug, file: !20, globals: !{!0})
-!2 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!3 = !DILocalVariable(name: "i", line: 4, arg: 1, scope: !4, file: !20, type: !2)
-!4 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !1, scope: !1, type: !5)
-!5 = !DISubroutineType(types: !6)
-!6 = !{!2, !2}
-!7 = !DILocation(line: 5, scope: !8)
-!8 = distinct !DILexicalBlock(line: 0, column: 0, file: !20, scope: !4)
-!9 = !DILocation(line: 6, scope: !8)
-!10 = !DILocation(line: 7, scope: !8)
-!11 = !DILocation(line: 9, scope: !8)
-!12 = !DILocation(line: 11, scope: !8)
-!13 = !DILocation(line: 14, scope: !14)
-!14 = distinct !DILexicalBlock(line: 0, column: 0, file: !20, scope: !15)
-!15 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !1, scope: !1, type: !16)
-!16 = !DISubroutineType(types: !17)
-!17 = !{!2}
-!18 = !DILocation(line: 15, scope: !14)
-!19 = !DILocation(line: 16, scope: !14)
-!20 = !DIFile(filename: "g.c", directory: "/tmp")
-!21 = !{i32 2, !"Dwarf Version", i32 2}
-!22 = !{i32 2, !"Debug Info Version", i32 3}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!6, !7}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "Stop", scope: !2, file: !3, line: 2, type: !5, isLocal: true, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C89, file: !3, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, globals: !4)
+!3 = !DIFile(filename: "g.c", directory: "/tmp")
+!4 = !{!0}
+!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!6 = !{i32 2, !"Dwarf Version", i32 2}
+!7 = !{i32 2, !"Debug Info Version", i32 3}
+!8 = !DILocalVariable(name: "i", arg: 1, scope: !9, file: !3, line: 4, type: !5)
+!9 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !2, line: 4, type: !10, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !2)!10 = !DISubroutineType(types: !11)!11 = !{!5, !5}!12 = !DIExpression()!13 = !DILocation(line: 5, scope: !14)!14 = distinct !DILexicalBlock(scope: !9, file: !3)!15 = !DILocation(line: 6, scope: !14)!16 = !DILocation(line: 7, scope: !14)!17 = !DILocation(line: 9, scope: !14)!18 = !DILocation(line: 11, scope: !14)!19 = !DILocation(line: 14, scope: !20)!20 = distinct !DILexicalBlock(scope: !21, file: !3)!21 = distinct !DISubprogram(name: "bar", linkageName: "bar", scope: !2, line: 13, type: !22, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !2)!22 = !DISubroutineType(types: !23)!23 = !{!5}!24 = !DILocation(line: 15, scope: !20)!25 = !DILocation(line: 16, scope: !20)
\ No newline at end of file
diff --git a/llvm/test/Transforms/Inline/alloca-dbgdeclare.ll b/llvm/test/Transforms/Inline/alloca-dbgdeclare.ll
index aeb7e05..881acef 100644
--- a/llvm/test/Transforms/Inline/alloca-dbgdeclare.ll
+++ b/llvm/test/Transforms/Inline/alloca-dbgdeclare.ll
@@ -16,25 +16,26 @@
; fn4();
; }
; ModuleID = 'test.cpp'
+source_filename = "test/Transforms/Inline/alloca-dbgdeclare.ll"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-apple-darwin"
%struct.A = type { i32, [2 x double] }
-@a = global %struct.A zeroinitializer, align 8, !dbg !26
-@b = global %struct.A zeroinitializer, align 8, !dbg !27
+@a = global %struct.A zeroinitializer, align 8, !dbg !0
+@b = global %struct.A zeroinitializer, align 8, !dbg !12
; Function Attrs: nounwind
-declare void @_Z3fn31A(%struct.A* nocapture readonly %p1) #0
+declare void @_Z3fn31A(%struct.A* nocapture readonly) #0
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
-; Function Attrs: nounwind
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #2
+; Function Attrs: argmemonly nounwind
+declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32, i1) #2
; Function Attrs: nounwind
-define void @_Z3fn4v() #0 !dbg !21 {
+define void @_Z3fn4v() #0 !dbg !22 {
entry:
; Test that the dbg.declare is moved together with the alloca.
; CHECK: define void @_Z3fn5v()
@@ -42,32 +43,33 @@
; CHECK-NEXT: %agg.tmp.sroa.3.i = alloca [20 x i8], align 4
; CHECK-NEXT: call void @llvm.dbg.declare(metadata [20 x i8]* %agg.tmp.sroa.3.i,
%agg.tmp.sroa.3 = alloca [20 x i8], align 4
- tail call void @llvm.dbg.declare(metadata [20 x i8]* %agg.tmp.sroa.3, metadata !46, metadata !48), !dbg !49
- %agg.tmp.sroa.0.0.copyload = load i32, i32* getelementptr inbounds (%struct.A, %struct.A* @b, i64 0, i32 0), align 8, !dbg !50
- tail call void @llvm.dbg.value(metadata i32 %agg.tmp.sroa.0.0.copyload, i64 0, metadata !46, metadata !51), !dbg !49
- %agg.tmp.sroa.3.0..sroa_idx = getelementptr inbounds [20 x i8], [20 x i8]* %agg.tmp.sroa.3, i64 0, i64 0, !dbg !50
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %agg.tmp.sroa.3.0..sroa_idx, i8* getelementptr (i8, i8* bitcast (%struct.A* @b to i8*), i64 4), i64 20, i32 4, i1 false), !dbg !50
- tail call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !46, metadata !31) #2, !dbg !49
- %tobool.i = icmp eq i32 %agg.tmp.sroa.0.0.copyload, 0, !dbg !52
- br i1 %tobool.i, label %_Z3fn31A.exit, label %if.then.i, !dbg !53
+ tail call void @llvm.dbg.declare(metadata [20 x i8]* %agg.tmp.sroa.3, metadata !25, metadata !30), !dbg !31
+ %agg.tmp.sroa.0.0.copyload = load i32, i32* getelementptr inbounds (%struct.A, %struct.A* @b, i64 0, i32 0), align 8, !dbg !33
+ tail call void @llvm.dbg.value(metadata i32 %agg.tmp.sroa.0.0.copyload, i64 0, metadata !25, metadata !34), !dbg !31
+ %agg.tmp.sroa.3.0..sroa_idx = getelementptr inbounds [20 x i8], [20 x i8]* %agg.tmp.sroa.3, i64 0, i64 0, !dbg !33
+ call void @llvm.memcpy.p0i8.p0i8.i64(i8* %agg.tmp.sroa.3.0..sroa_idx, i8* getelementptr (i8, i8* bitcast (%struct.A* @b to i8*), i64 4), i64 20, i32 4, i1 false), !dbg !33
+ tail call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !25, metadata !35) #0, !dbg !31
+ %tobool.i = icmp eq i32 %agg.tmp.sroa.0.0.copyload, 0, !dbg !36
+ br i1 %tobool.i, label %_Z3fn31A.exit, label %if.then.i, !dbg !38
if.then.i: ; preds = %entry
- store i32 %agg.tmp.sroa.0.0.copyload, i32* getelementptr inbounds (%struct.A, %struct.A* @a, i64 0, i32 0), align 8, !dbg !54
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr (i8, i8* bitcast (%struct.A* @a to i8*), i64 4), i8* %agg.tmp.sroa.3.0..sroa_idx, i64 20, i32 4, i1 false), !dbg !54
- br label %_Z3fn31A.exit, !dbg !54
+ store i32 %agg.tmp.sroa.0.0.copyload, i32* getelementptr inbounds (%struct.A, %struct.A* @a, i64 0, i32 0), align 8, !dbg !39
+ call void @llvm.memcpy.p0i8.p0i8.i64(i8* getelementptr (i8, i8* bitcast (%struct.A* @a to i8*), i64 4), i8* %agg.tmp.sroa.3.0..sroa_idx, i64 20, i32 4, i1 false), !dbg !39
+ br label %_Z3fn31A.exit, !dbg !39
-_Z3fn31A.exit: ; preds = %entry, %if.then.i
- ret void, !dbg !50
+_Z3fn31A.exit: ; preds = %if.then.i, %entry
+
+ ret void, !dbg !33
}
; Function Attrs: noreturn nounwind
-define void @_Z3fn5v() #3 !dbg !24 {
+define void @_Z3fn5v() #3 !dbg !40 {
entry:
- br label %while.body, !dbg !55
+ br label %while.body, !dbg !41
-while.body: ; preds = %entry, %while.body
- call void @_Z3fn4v(), !dbg !56
- br label %while.body, !dbg !55
+while.body: ; preds = %while.body, %entry
+ call void @_Z3fn4v(), !dbg !42
+ br label %while.body, !dbg !41
}
; Function Attrs: nounwind readnone
@@ -75,66 +77,54 @@
attributes #0 = { nounwind }
attributes #1 = { nounwind readnone }
-attributes #2 = { nounwind }
+attributes #2 = { argmemonly nounwind }
attributes #3 = { noreturn nounwind }
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!28, !29}
-!llvm.ident = !{!30}
+!llvm.dbg.cu = !{!14}
+!llvm.module.flags = !{!19, !20}
+!llvm.ident = !{!21}
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 (trunk 227480) (llvm/trunk 227517)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !25, imports: !2)
-!1 = !DIFile(filename: "<stdin>", directory: "")
-!2 = !{}
-!3 = !{!4}
-!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", line: 1, size: 192, align: 64, file: !5, elements: !6, identifier: "_ZTS1A")
-!5 = !DIFile(filename: "test.cpp", directory: "")
-!6 = !{!7, !9}
-!7 = !DIDerivedType(tag: DW_TAG_member, name: "arg0", line: 2, size: 32, align: 32, file: !5, scope: !4, baseType: !8)
-!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!9 = !DIDerivedType(tag: DW_TAG_member, name: "arg1", line: 3, size: 128, align: 64, offset: 64, file: !5, scope: !4, baseType: !10)
-!10 = !DICompositeType(tag: DW_TAG_array_type, size: 128, align: 64, baseType: !11, elements: !12)
-!11 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float)
-!12 = !{!13}
-!13 = !DISubrange(count: 2)
-!15 = distinct !DISubprogram(name: "fn3", linkageName: "_Z3fn31A", line: 6, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 6, file: !5, scope: !16, type: !17, variables: !19)
-!16 = !DIFile(filename: "test.cpp", directory: "")
-!17 = !DISubroutineType(types: !18)
-!18 = !{null, !4}
-!19 = !{!20}
-!20 = !DILocalVariable(name: "p1", line: 6, arg: 1, scope: !15, file: !16, type: !4)
-!21 = distinct !DISubprogram(name: "fn4", linkageName: "_Z3fn4v", line: 11, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 11, file: !5, scope: !16, type: !22, variables: !2)
-!22 = !DISubroutineType(types: !23)
-!23 = !{null}
-!24 = distinct !DISubprogram(name: "fn5", linkageName: "_Z3fn5v", line: 13, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 13, file: !5, scope: !16, type: !22, variables: !2)
-!25 = !{!26, !27}
-!26 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", line: 4, isLocal: false, isDefinition: true, scope: null, file: !16, type: !4))
-!27 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "b", line: 4, isLocal: false, isDefinition: true, scope: null, file: !16, type: !4))
-!28 = !{i32 2, !"Dwarf Version", i32 4}
-!29 = !{i32 2, !"Debug Info Version", i32 3}
-!30 = !{!"clang version 3.7.0 (trunk 227480) (llvm/trunk 227517)"}
-!31 = !DIExpression(DW_OP_deref)
-!32 = !DILocation(line: 6, scope: !15)
-!33 = !DILocation(line: 7, scope: !34)
-!34 = distinct !DILexicalBlock(line: 7, column: 0, file: !5, scope: !15)
-!35 = !{!36, !37, i64 0}
-!36 = !{!4, !37, i64 0, !38, i64 8}
-!37 = !{!"int", !38, i64 0}
-!38 = !{!"omnipotent char", !39, i64 0}
-!39 = !{!"Simple C/C++ TBAA"}
-!40 = !DILocation(line: 7, scope: !15)
-!41 = !DILocation(line: 8, scope: !34)
-!42 = !{i64 0, i64 4, !43, i64 8, i64 16, !44}
-!43 = !{!37, !37, i64 0}
-!44 = !{!38, !38, i64 0}
-!45 = !DILocation(line: 9, scope: !15)
-!46 = !DILocalVariable(name: "p1", line: 6, arg: 1, scope: !15, file: !16, type: !4)
-!47 = distinct !DILocation(line: 11, scope: !21)
-!48 = !DIExpression(DW_OP_LLVM_fragment, 32, 160)
-!49 = !DILocation(line: 6, scope: !15, inlinedAt: !47)
-!50 = !DILocation(line: 11, scope: !21)
-!51 = !DIExpression(DW_OP_LLVM_fragment, 0, 32)
-!52 = !DILocation(line: 7, scope: !34, inlinedAt: !47)
-!53 = !DILocation(line: 7, scope: !15, inlinedAt: !47)
-!54 = !DILocation(line: 8, scope: !34, inlinedAt: !47)
-!55 = !DILocation(line: 14, scope: !24)
-!56 = !DILocation(line: 15, scope: !24)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 4, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "test.cpp", directory: "")
+!3 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !2, line: 1, size: 192, align: 64, elements: !4, identifier: "_ZTS1A")
+!4 = !{!5, !7}
+!5 = !DIDerivedType(tag: DW_TAG_member, name: "arg0", scope: !3, file: !2, line: 2, baseType: !6, size: 32, align: 32)
+!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!7 = !DIDerivedType(tag: DW_TAG_member, name: "arg1", scope: !3, file: !2, line: 3, baseType: !8, size: 128, align: 64, offset: 64)
+!8 = !DICompositeType(tag: DW_TAG_array_type, baseType: !9, size: 128, align: 64, elements: !10)
+!9 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float)
+!10 = !{!11}
+!11 = !DISubrange(count: 2)
+!12 = !DIGlobalVariableExpression(var: !13)
+!13 = !DIGlobalVariable(name: "b", scope: null, file: !2, line: 4, type: !3, isLocal: false, isDefinition: true)
+!14 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !15, producer: "clang version 3.7.0 (trunk 227480) (llvm/trunk 227517)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !16, retainedTypes: !17, globals: !18, imports: !16)
+!15 = !DIFile(filename: "<stdin>", directory: "")
+!16 = !{}
+!17 = !{!3}
+!18 = !{!0, !12}
+!19 = !{i32 2, !"Dwarf Version", i32 4}
+!20 = !{i32 2, !"Debug Info Version", i32 3}
+!21 = !{!"clang version 3.7.0 (trunk 227480) (llvm/trunk 227517)"}
+!22 = distinct !DISubprogram(name: "fn4", linkageName: "_Z3fn4v", scope: !2, file: !2, line: 11, type: !23, isLocal: false, isDefinition: true, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: true, unit: !14, variables: !16)
+!23 = !DISubroutineType(types: !24)
+!24 = !{null}
+!25 = !DILocalVariable(name: "p1", arg: 1, scope: !26, file: !2, line: 6, type: !3)
+!26 = distinct !DISubprogram(name: "fn3", linkageName: "_Z3fn31A", scope: !2, file: !2, line: 6, type: !27, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !14, variables: !29)
+!27 = !DISubroutineType(types: !28)
+!28 = !{null, !3}
+!29 = !{!25}
+!30 = !DIExpression(DW_OP_LLVM_fragment, 32, 160)
+!31 = !DILocation(line: 6, scope: !26, inlinedAt: !32)
+!32 = distinct !DILocation(line: 11, scope: !22)
+!33 = !DILocation(line: 11, scope: !22)
+!34 = !DIExpression(DW_OP_LLVM_fragment, 0, 32)
+!35 = !DIExpression(DW_OP_deref)
+!36 = !DILocation(line: 7, scope: !37, inlinedAt: !32)
+!37 = distinct !DILexicalBlock(scope: !26, file: !2, line: 7)
+!38 = !DILocation(line: 7, scope: !26, inlinedAt: !32)
+!39 = !DILocation(line: 8, scope: !37, inlinedAt: !32)
+!40 = distinct !DISubprogram(name: "fn5", linkageName: "_Z3fn5v", scope: !2, file: !2, line: 13, type: !23, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: true, unit: !14, variables: !16)
+!41 = !DILocation(line: 14, scope: !40)
+!42 = !DILocation(line: 15, scope: !40)
+
diff --git a/llvm/test/Transforms/LoopVectorize/dbg.value.ll b/llvm/test/Transforms/LoopVectorize/dbg.value.ll
index b780f36..453f02b 100644
--- a/llvm/test/Transforms/LoopVectorize/dbg.value.ll
+++ b/llvm/test/Transforms/LoopVectorize/dbg.value.ll
@@ -1,68 +1,77 @@
; RUN: opt < %s -S -loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -dce -instcombine | FileCheck %s
; Make sure we vectorize with debugging turned on.
+source_filename = "test/Transforms/LoopVectorize/dbg.value.ll"
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-S128"
-@A = global [1024 x i32] zeroinitializer, align 16, !dbg !12
-@B = global [1024 x i32] zeroinitializer, align 16, !dbg !16
-@C = global [1024 x i32] zeroinitializer, align 16, !dbg !17
-
+@A = global [1024 x i32] zeroinitializer, align 16, !dbg !0
+@B = global [1024 x i32] zeroinitializer, align 16, !dbg !7
+@C = global [1024 x i32] zeroinitializer, align 16, !dbg !9
; CHECK-LABEL: @test(
-define i32 @test() #0 !dbg !3 {
-entry:
- tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !9, metadata !DIExpression()), !dbg !18
- br label %for.body, !dbg !18
-for.body:
+; Function Attrs: nounwind ssp uwtable
+define i32 @test() #0 !dbg !15 {
+entry:
+ tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !19, metadata !21), !dbg !22
+ br label %for.body, !dbg !22
+
+for.body: ; preds = %for.body, %entry
;CHECK: load <4 x i32>
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
- %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvars.iv, !dbg !19
- %0 = load i32, i32* %arrayidx, align 4, !dbg !19
- %arrayidx2 = getelementptr inbounds [1024 x i32], [1024 x i32]* @C, i64 0, i64 %indvars.iv, !dbg !19
- %1 = load i32, i32* %arrayidx2, align 4, !dbg !19
- %add = add nsw i32 %1, %0, !dbg !19
- %arrayidx4 = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv, !dbg !19
- store i32 %add, i32* %arrayidx4, align 4, !dbg !19
- %indvars.iv.next = add i64 %indvars.iv, 1, !dbg !18
- tail call void @llvm.dbg.value(metadata !{null}, i64 0, metadata !9, metadata !DIExpression()), !dbg !18
- %lftr.wideiv = trunc i64 %indvars.iv.next to i32, !dbg !18
- %exitcond = icmp ne i32 %lftr.wideiv, 1024, !dbg !18
- br i1 %exitcond, label %for.body, label %for.end, !dbg !18
+ %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvars.iv, !dbg !23
+ %0 = load i32, i32* %arrayidx, align 4, !dbg !23
+ %arrayidx2 = getelementptr inbounds [1024 x i32], [1024 x i32]* @C, i64 0, i64 %indvars.iv, !dbg !23
+ %1 = load i32, i32* %arrayidx2, align 4, !dbg !23
+ %add = add nsw i32 %1, %0, !dbg !23
+ %arrayidx4 = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv, !dbg !23
+ store i32 %add, i32* %arrayidx4, align 4, !dbg !23
+ %indvars.iv.next = add i64 %indvars.iv, 1, !dbg !22
+ tail call void @llvm.dbg.value(metadata !12, i64 0, metadata !19, metadata !21), !dbg !22
+ %lftr.wideiv = trunc i64 %indvars.iv.next to i32, !dbg !22
+ %exitcond = icmp ne i32 %lftr.wideiv, 1024, !dbg !22
+ br i1 %exitcond, label %for.body, label %for.end, !dbg !22
-for.end:
- ret i32 0, !dbg !24
+for.end: ; preds = %for.body
+ ret i32 0, !dbg !25
}
+; Function Attrs: nounwind readnone
+
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
+; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
attributes #0 = { nounwind ssp uwtable "fp-contract-model"="standard" "no-frame-pointer-elim" "no-frame-pointer-elim-non-leaf" "relocation-model"="pic" "ssp-buffers-size"="8" }
attributes #1 = { nounwind readnone }
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!26}
+!llvm.dbg.cu = !{!11}
+!llvm.module.flags = !{!14}
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang", isOptimized: true, emissionKind: FullDebug, file: !25, enums: !1, retainedTypes: !1, globals: !11)
-!1 = !{}
-!3 = distinct !DISubprogram(name: "test", linkageName: "test", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 5, file: !25, scope: !4, type: !5, variables: !8)
-!4 = !DIFile(filename: "test", directory: "/path/to/somewhere")
-!5 = !DISubroutineType(types: !6)
-!6 = !{!7}
-!7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!8 = !{!9}
-!9 = !DILocalVariable(name: "i", line: 6, scope: !10, file: !4, type: !7)
-!10 = distinct !DILexicalBlock(line: 6, column: 0, file: !25, scope: !3)
-!11 = !{!12, !16, !17}
-!12 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "A", line: 1, isLocal: false, isDefinition: true, scope: null, file: !4, type: !13))
-!13 = !DICompositeType(tag: DW_TAG_array_type, size: 32768, align: 32, baseType: !7, elements: !14)
-!14 = !{!15}
-!15 = !{i32 786465, i64 0, i64 1024}
-!16 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "B", line: 2, isLocal: false, isDefinition: true, scope: null, file: !4, type: !13))
-!17 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "C", line: 3, isLocal: false, isDefinition: true, scope: null, file: !4, type: !13))
-!18 = !DILocation(line: 6, scope: !10)
-!19 = !DILocation(line: 7, scope: !20)
-!20 = distinct !DILexicalBlock(line: 6, column: 0, file: !25, scope: !10)
-!24 = !DILocation(line: 9, scope: !3)
-!25 = !DIFile(filename: "test", directory: "/path/to/somewhere")
-!26 = !{i32 1, !"Debug Info Version", i32 3}
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "A", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "test", directory: "/path/to/somewhere")
+!3 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 32768, align: 32, elements: !5)
+!4 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!5 = !{!6}
+!6 = !{i32 786465, i64 0, i64 1024}
+!7 = !DIGlobalVariableExpression(var: !8)
+!8 = !DIGlobalVariable(name: "B", scope: null, file: !2, line: 2, type: !3, isLocal: false, isDefinition: true)
+!9 = !DIGlobalVariableExpression(var: !10)
+!10 = !DIGlobalVariable(name: "C", scope: null, file: !2, line: 3, type: !3, isLocal: false, isDefinition: true)
+!11 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !12, retainedTypes: !12, globals: !13)
+!12 = !{}
+!13 = !{!0, !7, !9}
+!14 = !{i32 1, !"Debug Info Version", i32 3}
+!15 = distinct !DISubprogram(name: "test", linkageName: "test", scope: !2, file: !2, line: 5, type: !16, isLocal: false, isDefinition: true, scopeLine: 5, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !11, variables: !18)
+!16 = !DISubroutineType(types: !17)
+!17 = !{!4}
+!18 = !{!19}
+!19 = !DILocalVariable(name: "i", scope: !20, file: !2, line: 6, type: !4)
+!20 = distinct !DILexicalBlock(scope: !15, file: !2, line: 6)
+!21 = !DIExpression()
+!22 = !DILocation(line: 6, scope: !20)
+!23 = !DILocation(line: 7, scope: !24)
+!24 = distinct !DILexicalBlock(scope: !20, file: !2, line: 6)
+!25 = !DILocation(line: 9, scope: !15)
+
diff --git a/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll b/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll
index 9ec87ef..7ccaa3e 100644
--- a/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll
+++ b/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll
@@ -13,130 +13,135 @@
; Coverage for this profile should be 100%
; CHECK-NOT: warning: cov-zero-samples.cc:1:
-@N = global i64 8000000000, align 8, !dbg !12
+source_filename = "test/Transforms/SampleProfile/cov-zero-samples.ll"
+
+@N = global i64 8000000000, align 8, !dbg !0
@.str = private unnamed_addr constant [11 x i8] c"sum is %d\0A\00", align 1
-; Function Attrs: nounwind uwtable
-define i32 @_Z12never_calledi(i32 %i) !dbg !4 {
+define i32 @_Z12never_calledi(i32 %i) !dbg !11 {
entry:
- ret i32 0, !dbg !32
+ ret i32 0, !dbg !15
}
; Function Attrs: nounwind readnone
-declare void @llvm.dbg.declare(metadata, metadata, metadata)
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
-; Function Attrs: norecurse uwtable
-define i32 @main() !dbg !8 {
+define i32 @main() !dbg !17 {
entry:
%retval = alloca i32, align 4
%sum = alloca i32, align 4
%i = alloca i64, align 8
store i32 0, i32* %retval, align 4
- call void @llvm.dbg.declare(metadata i32* %sum, metadata !33, metadata !19), !dbg !34
- store i32 0, i32* %sum, align 4, !dbg !34
- call void @llvm.dbg.declare(metadata i64* %i, metadata !35, metadata !19), !dbg !37
- store i64 0, i64* %i, align 8, !dbg !37
- br label %for.cond, !dbg !38
+ call void @llvm.dbg.declare(metadata i32* %sum, metadata !20, metadata !21), !dbg !22
+ store i32 0, i32* %sum, align 4, !dbg !22
+ call void @llvm.dbg.declare(metadata i64* %i, metadata !23, metadata !21), !dbg !25
+ store i64 0, i64* %i, align 8, !dbg !25
+ br label %for.cond, !dbg !26
for.cond: ; preds = %for.inc, %entry
- %0 = load i64, i64* %i, align 8, !dbg !39
- %1 = load volatile i64, i64* @N, align 8, !dbg !42
- %cmp = icmp slt i64 %0, %1, !dbg !43
- br i1 %cmp, label %for.body, label %for.end, !dbg !44
+
+ %0 = load i64, i64* %i, align 8, !dbg !27
+ %1 = load volatile i64, i64* @N, align 8, !dbg !30
+ %cmp = icmp slt i64 %0, %1, !dbg !31
+ br i1 %cmp, label %for.body, label %for.end, !dbg !32
for.body: ; preds = %for.cond
- %2 = load i64, i64* %i, align 8, !dbg !45
- %3 = load volatile i64, i64* @N, align 8, !dbg !48
- %cmp1 = icmp sgt i64 %2, %3, !dbg !49
- br i1 %cmp1, label %if.then, label %if.end, !dbg !50
+ %2 = load i64, i64* %i, align 8, !dbg !33
+ %3 = load volatile i64, i64* @N, align 8, !dbg !36
+ %cmp1 = icmp sgt i64 %2, %3, !dbg !37
+ br i1 %cmp1, label %if.then, label %if.end, !dbg !38
if.then: ; preds = %for.body
- %4 = load i64, i64* %i, align 8, !dbg !51
- %conv = trunc i64 %4 to i32, !dbg !51
- %call = call i32 @_Z12never_calledi(i32 %conv), !dbg !53
- %5 = load i32, i32* %sum, align 4, !dbg !54
- %add = add nsw i32 %5, %call, !dbg !54
- store i32 %add, i32* %sum, align 4, !dbg !54
- br label %if.end, !dbg !55
+ %4 = load i64, i64* %i, align 8, !dbg !39
+ %conv = trunc i64 %4 to i32, !dbg !39
+ %call = call i32 @_Z12never_calledi(i32 %conv), !dbg !41
+ %5 = load i32, i32* %sum, align 4, !dbg !42
+ %add = add nsw i32 %5, %call, !dbg !42
+ store i32 %add, i32* %sum, align 4, !dbg !42
+ br label %if.end, !dbg !43
if.end: ; preds = %if.then, %for.body
- %6 = load i64, i64* %i, align 8, !dbg !56
- %div = sdiv i64 %6, 239, !dbg !57
- %7 = load i32, i32* %sum, align 4, !dbg !58
- %conv2 = sext i32 %7 to i64, !dbg !58
- %mul = mul nsw i64 %conv2, %div, !dbg !58
- %conv3 = trunc i64 %mul to i32, !dbg !58
- store i32 %conv3, i32* %sum, align 4, !dbg !58
- br label %for.inc, !dbg !59
+ %6 = load i64, i64* %i, align 8, !dbg !44
+ %div = sdiv i64 %6, 239, !dbg !45
+ %7 = load i32, i32* %sum, align 4, !dbg !46
+ %conv2 = sext i32 %7 to i64, !dbg !46
+ %mul = mul nsw i64 %conv2, %div, !dbg !46
+ %conv3 = trunc i64 %mul to i32, !dbg !46
+ store i32 %conv3, i32* %sum, align 4, !dbg !46
+ br label %for.inc, !dbg !47
for.inc: ; preds = %if.end
- %8 = load i64, i64* %i, align 8, !dbg !60
- %inc = add nsw i64 %8, 1, !dbg !60
- store i64 %inc, i64* %i, align 8, !dbg !60
- br label %for.cond, !dbg !62
+ %8 = load i64, i64* %i, align 8, !dbg !48
+ %inc = add nsw i64 %8, 1, !dbg !48
+ store i64 %inc, i64* %i, align 8, !dbg !48
+ br label %for.cond, !dbg !50
for.end: ; preds = %for.cond
- %9 = load i32, i32* %sum, align 4, !dbg !63
- %call4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %9), !dbg !64
- ret i32 0, !dbg !65
+ %9 = load i32, i32* %sum, align 4, !dbg !51
+ %call4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %9), !dbg !52
+ ret i32 0, !dbg !53
}
declare i32 @printf(i8*, ...)
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!15, !16}
-!llvm.ident = !{!17}
+attributes #0 = { nounwind readnone }
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 253667) (llvm/trunk 253670)", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug, enums: !2, globals: !11)
-!1 = !DIFile(filename: "cov-zero-samples.cc", directory: ".")
-!2 = !{}
-!4 = distinct !DISubprogram(name: "never_called", linkageName: "_Z12never_calledi", scope: !1, file: !1, line: 5, type: !5, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!5 = !DISubroutineType(types: !6)
-!6 = !{!7, !7}
-!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!8 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 7, type: !9, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!9 = !DISubroutineType(types: !10)
-!10 = !{!7}
-!11 = !{!12}
-!12 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "N", scope: !0, file: !1, line: 3, type: !13, isLocal: false, isDefinition: true))
-!13 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !14)
-!14 = !DIBasicType(name: "long long int", size: 64, align: 64, encoding: DW_ATE_signed)
-!15 = !{i32 2, !"Dwarf Version", i32 4}
-!16 = !{i32 2, !"Debug Info Version", i32 3}
-!17 = !{!"clang version 3.8.0 (trunk 253667) (llvm/trunk 253670)"}
-!19 = !DIExpression()
-!31 = !DILexicalBlockFile(scope: !4, file: !1, discriminator: 3)
-!32 = !DILocation(line: 5, column: 27, scope: !31)
-!33 = !DILocalVariable(name: "sum", scope: !8, file: !1, line: 8, type: !7)
-!34 = !DILocation(line: 8, column: 7, scope: !8)
-!35 = !DILocalVariable(name: "i", scope: !36, file: !1, line: 9, type: !14)
-!36 = distinct !DILexicalBlock(scope: !8, file: !1, line: 9, column: 3)
-!37 = !DILocation(line: 9, column: 18, scope: !36)
-!38 = !DILocation(line: 9, column: 8, scope: !36)
-!39 = !DILocation(line: 9, column: 25, scope: !40)
-!40 = !DILexicalBlockFile(scope: !41, file: !1, discriminator: 1)
-!41 = distinct !DILexicalBlock(scope: !36, file: !1, line: 9, column: 3)
-!42 = !DILocation(line: 9, column: 29, scope: !40)
-!43 = !DILocation(line: 9, column: 27, scope: !40)
-!44 = !DILocation(line: 9, column: 3, scope: !40)
-!45 = !DILocation(line: 10, column: 9, scope: !46)
-!46 = distinct !DILexicalBlock(scope: !47, file: !1, line: 10, column: 9)
-!47 = distinct !DILexicalBlock(scope: !41, file: !1, line: 9, column: 37)
-!48 = !DILocation(line: 10, column: 13, scope: !46)
-!49 = !DILocation(line: 10, column: 11, scope: !46)
-!50 = !DILocation(line: 10, column: 9, scope: !47)
-!51 = !DILocation(line: 10, column: 36, scope: !52)
-!52 = !DILexicalBlockFile(scope: !46, file: !1, discriminator: 1)
-!53 = !DILocation(line: 10, column: 23, scope: !52)
-!54 = !DILocation(line: 10, column: 20, scope: !52)
-!55 = !DILocation(line: 10, column: 16, scope: !52)
-!56 = !DILocation(line: 11, column: 12, scope: !47)
-!57 = !DILocation(line: 11, column: 14, scope: !47)
-!58 = !DILocation(line: 11, column: 9, scope: !47)
-!59 = !DILocation(line: 12, column: 3, scope: !47)
-!60 = !DILocation(line: 9, column: 33, scope: !61)
-!61 = !DILexicalBlockFile(scope: !41, file: !1, discriminator: 2)
-!62 = !DILocation(line: 9, column: 3, scope: !61)
-!63 = !DILocation(line: 13, column: 25, scope: !8)
-!64 = !DILocation(line: 13, column: 3, scope: !8)
-!65 = !DILocation(line: 14, column: 3, scope: !8)
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!8, !9}
+!llvm.ident = !{!10}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "N", scope: !2, file: !3, line: 3, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.8.0 (trunk 253667) (llvm/trunk 253670)", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "cov-zero-samples.cc", directory: ".")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7)
+!7 = !DIBasicType(name: "long long int", size: 64, align: 64, encoding: DW_ATE_signed)
+!8 = !{i32 2, !"Dwarf Version", i32 4}
+!9 = !{i32 2, !"Debug Info Version", i32 3}
+!10 = !{!"clang version 3.8.0 (trunk 253667) (llvm/trunk 253670)"}
+!11 = distinct !DISubprogram(name: "never_called", linkageName: "_Z12never_calledi", scope: !3, file: !3, line: 5, type: !12, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !4)
+!12 = !DISubroutineType(types: !13)
+!13 = !{!14, !14}
+!14 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!15 = !DILocation(line: 5, column: 27, scope: !16)
+!16 = !DILexicalBlockFile(scope: !11, file: !3, discriminator: 3)
+!17 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 7, type: !18, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: false, unit: !2, variables: !4)
+!18 = !DISubroutineType(types: !19)
+!19 = !{!14}
+!20 = !DILocalVariable(name: "sum", scope: !17, file: !3, line: 8, type: !14)
+!21 = !DIExpression()
+!22 = !DILocation(line: 8, column: 7, scope: !17)
+!23 = !DILocalVariable(name: "i", scope: !24, file: !3, line: 9, type: !7)
+!24 = distinct !DILexicalBlock(scope: !17, file: !3, line: 9, column: 3)
+!25 = !DILocation(line: 9, column: 18, scope: !24)
+!26 = !DILocation(line: 9, column: 8, scope: !24)
+!27 = !DILocation(line: 9, column: 25, scope: !28)
+!28 = !DILexicalBlockFile(scope: !29, file: !3, discriminator: 1)
+!29 = distinct !DILexicalBlock(scope: !24, file: !3, line: 9, column: 3)
+!30 = !DILocation(line: 9, column: 29, scope: !28)
+!31 = !DILocation(line: 9, column: 27, scope: !28)
+!32 = !DILocation(line: 9, column: 3, scope: !28)
+!33 = !DILocation(line: 10, column: 9, scope: !34)
+!34 = distinct !DILexicalBlock(scope: !35, file: !3, line: 10, column: 9)
+!35 = distinct !DILexicalBlock(scope: !29, file: !3, line: 9, column: 37)
+!36 = !DILocation(line: 10, column: 13, scope: !34)
+!37 = !DILocation(line: 10, column: 11, scope: !34)
+!38 = !DILocation(line: 10, column: 9, scope: !35)
+!39 = !DILocation(line: 10, column: 36, scope: !40)
+!40 = !DILexicalBlockFile(scope: !34, file: !3, discriminator: 1)
+!41 = !DILocation(line: 10, column: 23, scope: !40)
+!42 = !DILocation(line: 10, column: 20, scope: !40)
+!43 = !DILocation(line: 10, column: 16, scope: !40)
+!44 = !DILocation(line: 11, column: 12, scope: !35)
+!45 = !DILocation(line: 11, column: 14, scope: !35)
+!46 = !DILocation(line: 11, column: 9, scope: !35)
+!47 = !DILocation(line: 12, column: 3, scope: !35)
+!48 = !DILocation(line: 9, column: 33, scope: !49)
+!49 = !DILexicalBlockFile(scope: !29, file: !3, discriminator: 2)
+!50 = !DILocation(line: 9, column: 3, scope: !49)
+!51 = !DILocation(line: 13, column: 25, scope: !17)
+!52 = !DILocation(line: 13, column: 3, scope: !17)
+!53 = !DILocation(line: 14, column: 3, scope: !17)
+
diff --git a/llvm/test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll b/llvm/test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll
index d2da839..b434bb2 100644
--- a/llvm/test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll
+++ b/llvm/test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll
@@ -9,19 +9,17 @@
; ModuleID = './csmith107.i.debug.ll'
source_filename = "./csmith107.i.debug.ll"
-@a = global i16 0, !dbg !4
-@b = global i32 0, !dbg !6
-@c = global i16* null, !dbg !10
+@a = global i16 0, !dbg !0
+@b = global i32 0, !dbg !4
+@c = global i16* null, !dbg !9
-
-; Function Attrs: nounwind
-define i16 @fn1() #3 !dbg !15 {
+define i16 @fn1() !dbg !17 {
bb2:
store i32 -1, i32* @b, align 1
- %_tmp1.pre = load i16, i16* @a, align 1, !dbg !19
+ %_tmp1.pre = load i16, i16* @a, align 1, !dbg !20
%_tmp2.pre = load i16*, i16** @c, align 1
tail call void @llvm.dbg.value(metadata i16 6, i64 0, metadata !22, metadata !23), !dbg !24
- tail call void @llvm.dbg.value(metadata i16 %_tmp1.pre, i64 0, metadata !25, metadata !23), !dbg !19
+ tail call void @llvm.dbg.value(metadata i16 %_tmp1.pre, i64 0, metadata !25, metadata !23), !dbg !20
%_tmp3 = load i16, i16* %_tmp2.pre, align 1
%_tmp4 = icmp ne i16 %_tmp3, 0
%_tmp6 = icmp ne i16 %_tmp1.pre, 0
@@ -37,32 +35,37 @@
}
; Function Attrs: nounwind readnone
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #4
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!12, !13}
+attributes #0 = { nounwind readnone }
-!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "FlexC Compiler v6.36 (LLVM)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3)
-!1 = !DIFile(filename: "csmith107.i.c", directory: "/tmp")
-!2 = !{}
-!3 = !{!4, !6, !10}
-!4 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "a", scope: null, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true))
-!5 = !DIBasicType(name: "int", size: 16, align: 16, encoding: DW_ATE_signed)
-!6 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "b", scope: null, file: !1, line: 3, type: !7, isLocal: false, isDefinition: true))
-!7 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint32_t", file: !1, line: 1, baseType: !8)
-!8 = !DIDerivedType(tag: DW_TAG_typedef, name: "__u32_t", file: !1, baseType: !9)
-!9 = !DIBasicType(name: "unsigned long", size: 32, align: 16, encoding: DW_ATE_unsigned)
-!10 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "c", scope: null, file: !1, line: 4, type: !11, isLocal: false, isDefinition: true))
-!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 16, align: 16)
-!12 = !{i32 2, !"Dwarf Version", i32 4}
-!13 = !{i32 2, !"Debug Info Version", i32 3}
-!15 = distinct !DISubprogram(name: "fn1", scope: !1, file: !1, line: 5, type: !16, isLocal: false, isDefinition: true, scopeLine: 5, isOptimized: false, unit: !0, variables: !2)
-!16 = !DISubroutineType(types: !17)
-!17 = !{!5}
-!19 = !DILocation(line: 8, column: 16, scope: !20)
-!20 = !DILexicalBlock(scope: !15, file: !1, line: 7, column: 29)
-!22 = !DILocalVariable(name: "d", scope: !20, line: 8, type: !5)
+!llvm.dbg.cu = !{!12}
+!llvm.module.flags = !{!15, !16}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 2, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "csmith107.i.c", directory: "/tmp")
+!3 = !DIBasicType(name: "int", size: 16, align: 16, encoding: DW_ATE_signed)
+!4 = !DIGlobalVariableExpression(var: !5)
+!5 = !DIGlobalVariable(name: "b", scope: null, file: !2, line: 3, type: !6, isLocal: false, isDefinition: true)
+!6 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint32_t", file: !2, line: 1, baseType: !7)
+!7 = !DIDerivedType(tag: DW_TAG_typedef, name: "__u32_t", file: !2, baseType: !8)
+!8 = !DIBasicType(name: "unsigned long", size: 32, align: 16, encoding: DW_ATE_unsigned)
+!9 = !DIGlobalVariableExpression(var: !10)
+!10 = !DIGlobalVariable(name: "c", scope: null, file: !2, line: 4, type: !11, isLocal: false, isDefinition: true)
+!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 16, align: 16)
+!12 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "FlexC Compiler v6.36 (LLVM)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !13, retainedTypes: !13, globals: !14)
+!13 = !{}
+!14 = !{!0, !4, !9}
+!15 = !{i32 2, !"Dwarf Version", i32 4}
+!16 = !{i32 2, !"Debug Info Version", i32 3}
+!17 = distinct !DISubprogram(name: "fn1", scope: !2, file: !2, line: 5, type: !18, isLocal: false, isDefinition: true, scopeLine: 5, isOptimized: false, unit: !12, variables: !13)
+!18 = !DISubroutineType(types: !19)
+!19 = !{!3}
+!20 = !DILocation(line: 8, column: 16, scope: !21)
+!21 = !DILexicalBlock(scope: !17, file: !2, line: 7, column: 29)
+!22 = !DILocalVariable(name: "d", scope: !21, line: 8, type: !3)
!23 = !DIExpression()
-!24 = !DILocation(line: 8, column: 9, scope: !20)
-!25 = !DILocalVariable(name: "e", scope: !20, line: 8, type: !5)
+!24 = !DILocation(line: 8, column: 9, scope: !21)
+!25 = !DILocalVariable(name: "e", scope: !21, line: 8, type: !3)
diff --git a/llvm/test/Transforms/StripSymbols/2010-06-30-StripDebug.ll b/llvm/test/Transforms/StripSymbols/2010-06-30-StripDebug.ll
index 2a0a171..5eaba26 100644
--- a/llvm/test/Transforms/StripSymbols/2010-06-30-StripDebug.ll
+++ b/llvm/test/Transforms/StripSymbols/2010-06-30-StripDebug.ll
@@ -2,30 +2,33 @@
; CHECK-NOT: call void @llvm.dbg.value
-@x = common global i32 0, !dbg !8 ; <i32*> [#uses=0]
+source_filename = "test/Transforms/StripSymbols/2010-06-30-StripDebug.ll"
-define void @foo() nounwind readnone optsize ssp !dbg !0 {
+@x = common global i32 0, !dbg !0
+
+; Function Attrs: nounwind optsize readnone ssp
+define void @foo() #0 !dbg !7 {
entry:
- tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !5, metadata !DIExpression()), !dbg !10
- ret void, !dbg !11
+ tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !10, metadata !12), !dbg !13
+ ret void, !dbg !14
}
-declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
-!llvm.module.flags = !{!13}
-!llvm.dbg.cu = !{!2}
+attributes #0 = { nounwind optsize readnone ssp }
+attributes #1 = { nounwind readnone }
-!0 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !2, file: !12, scope: !1, type: !3)
-!1 = !DIFile(filename: "b.c", directory: "/tmp")
-!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: FullDebug, file: !12, globals: !{!8})
-!3 = !DISubroutineType(types: !4)
-!4 = !{null}
-!5 = !DILocalVariable(name: "y", line: 3, scope: !6, file: !1, type: !7)
-!6 = distinct !DILexicalBlock(line: 2, column: 0, file: !12, scope: !0)
-!7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!8 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "x", line: 1, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !7))
-!9 = !{i32 0}
-!10 = !DILocation(line: 3, scope: !6)
-!11 = !DILocation(line: 4, scope: !6)
-!12 = !DIFile(filename: "b.c", directory: "/tmp")
-!13 = !{i32 1, !"Debug Info Version", i32 3}
+!llvm.module.flags = !{!4}
+!llvm.dbg.cu = !{!5}
+
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "x", scope: !2, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "b.c", directory: "/tmp")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = !{i32 1, !"Debug Info Version", i32 3}
+!5 = distinct !DICompileUnit(language: DW_LANG_C89, file: !2, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, globals: !6)
+!6 = !{!0}
+!7 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !2, file: !2, line: 2, type: !8, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !5)
+!8 = !DISubroutineType(types: !9)
+!9 = !{null}!10 = !DILocalVariable(name: "y", scope: !11, file: !2, line: 3, type: !3)!11 = distinct !DILexicalBlock(scope: !7, file: !2, line: 2)!12 = !DIExpression()!13 = !DILocation(line: 3, scope: !11)!14 = !DILocation(line: 4, scope: !11)
\ No newline at end of file
diff --git a/llvm/test/Transforms/StripSymbols/2010-08-25-crash.ll b/llvm/test/Transforms/StripSymbols/2010-08-25-crash.ll
index 69e4f26..8b65553 100644
--- a/llvm/test/Transforms/StripSymbols/2010-08-25-crash.ll
+++ b/llvm/test/Transforms/StripSymbols/2010-08-25-crash.ll
@@ -1,23 +1,29 @@
; RUN: opt -strip-dead-debug-info -disable-output < %s
-define i32 @foo() nounwind ssp !dbg !0 {
+source_filename = "test/Transforms/StripSymbols/2010-08-25-crash.ll"
+
+; Function Attrs: nounwind ssp
+define i32 @foo() #0 !dbg !9 {
entry:
- ret i32 0, !dbg !8
+ ret i32 0, !dbg !12
}
-!llvm.dbg.cu = !{!2}
-!llvm.module.flags = !{!14}
+attributes #0 = { nounwind ssp }
-!0 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !2, file: !10, scope: !1, type: !3)
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!8}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 2.8 (trunk 112062)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3)
!1 = !DIFile(filename: "/tmp/a.c", directory: "/Volumes/Lalgate/clean/D.CW")
-!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.8 (trunk 112062)", isOptimized: true, emissionKind: FullDebug, file: !10, enums: !11, retainedTypes: !11, globals: !13)
-!3 = !DISubroutineType(types: !4)
-!4 = !{!5}
-!5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!6 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "i", linkageName: "i", line: 2, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !7))
-!7 = !DIDerivedType(tag: DW_TAG_const_type, file: !10, scope: !1, baseType: !5)
-!8 = !DILocation(line: 3, column: 13, scope: !9)
-!9 = distinct !DILexicalBlock(line: 3, column: 11, file: !10, scope: !0)
-!10 = !DIFile(filename: "/tmp/a.c", directory: "/Volumes/Lalgate/clean/D.CW")
-!11 = !{}
-!13 = !{!6}
-!14 = !{i32 1, !"Debug Info Version", i32 3}
+!2 = !{}
+!3 = !{!4}
+!4 = !DIGlobalVariableExpression(var: !5)
+!5 = !DIGlobalVariable(name: "i", linkageName: "i", scope: !1, file: !1, line: 2, type: !6, isLocal: true, isDefinition: true)
+!6 = !DIDerivedType(tag: DW_TAG_const_type, scope: !1, file: !1, baseType: !7)
+!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!8 = !{i32 1, !"Debug Info Version", i32 3}
+!9 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !1, file: !1, line: 3, type: !10, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0)
+!10 = !DISubroutineType(types: !11)
+!11 = !{!7}
+!12 = !DILocation(line: 3, column: 13, scope: !13)
+!13 = distinct !DILexicalBlock(scope: !9, file: !1, line: 3, column: 11)
+
diff --git a/llvm/test/Transforms/StripSymbols/strip-dead-debug-info.ll b/llvm/test/Transforms/StripSymbols/strip-dead-debug-info.ll
index a29427e..0e252d7 100644
--- a/llvm/test/Transforms/StripSymbols/strip-dead-debug-info.ll
+++ b/llvm/test/Transforms/StripSymbols/strip-dead-debug-info.ll
@@ -4,21 +4,23 @@
; CHECK-NOT: "bar"
; CHECK-NOT: "abcd"
-@xyz = global i32 2, !dbg !17
+source_filename = "test/Transforms/StripSymbols/strip-dead-debug-info.ll"
+
+@xyz = global i32 2, !dbg !0
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0
; Function Attrs: nounwind readnone ssp
-define i32 @fn() #1 !dbg !6 {
+define i32 @fn() #1 !dbg !10 {
entry:
- ret i32 0, !dbg !18
+ ret i32 0, !dbg !13
}
; Function Attrs: nounwind readonly ssp
-define i32 @foo(i32 %i) #2 !dbg !10 {
+define i32 @foo(i32 %i) #2 !dbg !15 {
entry:
- tail call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !15, metadata !DIExpression()), !dbg !20
+ tail call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !18, metadata !19), !dbg !20
%.0 = load i32, i32* @xyz, align 4
ret i32 %.0, !dbg !21
}
@@ -27,31 +29,30 @@
attributes #1 = { nounwind readnone ssp }
attributes #2 = { nounwind readonly ssp }
-!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!25}
+!llvm.dbg.cu = !{!4}
+!llvm.module.flags = !{!9}
-!0 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !{}, retainedTypes: !{}, globals: !24)
-!1 = !DIFile(filename: "g.c", directory: "/tmp/")
-!2 = !{null}
-!3 = distinct !DISubprogram(name: "bar", line: 5, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, file: !1, scope: null, type: !4)
-!4 = !DISubroutineType(types: !2)
-!5 = !DIFile(filename: "g.c", directory: "/tmp/")
-!6 = distinct !DISubprogram(name: "fn", linkageName: "fn", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, file: !1, scope: null, type: !7)
-!7 = !DISubroutineType(types: !8)
-!8 = !{!9}
-!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!10 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, file: !1, scope: null, type: !11)
+!0 = !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "xyz", scope: !2, file: !2, line: 3, type: !3, isLocal: false, isDefinition: true)
+!2 = !DIFile(filename: "g.c", directory: "/tmp/")
+!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!4 = distinct !DICompileUnit(language: DW_LANG_C89, file: !2, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6)
+!5 = !{}
+!6 = !{!7, !0}
+!7 = !DIGlobalVariableExpression(var: !8)
+!8 = !DIGlobalVariable(name: "abcd", scope: !2, file: !2, line: 2, type: !3, isLocal: true, isDefinition: true)
+!9 = !{i32 1, !"Debug Info Version", i32 3}
+!10 = distinct !DISubprogram(name: "fn", linkageName: "fn", scope: null, file: !2, line: 6, type: !11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !4)
!11 = !DISubroutineType(types: !12)
-!12 = !{!9, !9}
-!13 = !DILocalVariable(name: "bb", line: 5, scope: !14, file: !5, type: !9)
-!14 = distinct !DILexicalBlock(line: 5, column: 0, file: !1, scope: !3)
-!15 = !DILocalVariable(name: "i", line: 7, arg: 1, scope: !10, file: !5, type: !9)
-!16 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "abcd", line: 2, isLocal: true, isDefinition: true, scope: !5, file: !5, type: !9))
-!17 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "xyz", line: 3, isLocal: false, isDefinition: true, scope: !5, file: !5, type: !9))
-!18 = !DILocation(line: 6, scope: !19)
-!19 = distinct !DILexicalBlock(line: 6, column: 0, file: !1, scope: !6)
-!20 = !DILocation(line: 7, scope: !10)
+!12 = !{!3}
+!13 = !DILocation(line: 6, scope: !14)
+!14 = distinct !DILexicalBlock(scope: !10, file: !2, line: 6)
+!15 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: null, file: !2, line: 7, type: !16, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !4)
+!16 = !DISubroutineType(types: !17)
+!17 = !{!3, !3}
+!18 = !DILocalVariable(name: "i", arg: 1, scope: !15, file: !2, line: 7, type: !3)
+!19 = !DIExpression()
+!20 = !DILocation(line: 7, scope: !15)
!21 = !DILocation(line: 10, scope: !22)
-!22 = distinct !DILexicalBlock(line: 7, column: 0, file: !1, scope: !10)
-!24 = !{!16, !17}
-!25 = !{i32 1, !"Debug Info Version", i32 3}
+!22 = distinct !DILexicalBlock(scope: !15, file: !2, line: 7)
+
diff --git a/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-containingtypes.ll b/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-containingtypes.ll
index f21710a..4afab40 100644
--- a/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-containingtypes.ll
+++ b/llvm/test/Transforms/Util/strip-nonlinetable-debuginfo-containingtypes.ll
@@ -26,67 +26,69 @@
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
+; CHECK: define
; Function Attrs: inlinehint nounwind ssp uwtable
-; CHECK: define
-define linkonce_odr void @_ZN1BC1Ev(%struct.B* %this) unnamed_addr #1 align 2 !dbg !24 {
+define linkonce_odr void @_ZN1BC1Ev(%struct.B* %this) unnamed_addr #1 align 2 !dbg !25 {
entry:
%this.addr = alloca %struct.B*, align 8
store %struct.B* %this, %struct.B** %this.addr, align 8
; CHECK-NOT: @llvm.dbg.declare
- call void @llvm.dbg.declare(metadata %struct.B** %this.addr, metadata !29, metadata !31), !dbg !32
+ call void @llvm.dbg.declare(metadata %struct.B** %this.addr, metadata !30, metadata !32), !dbg !33
%this1 = load %struct.B*, %struct.B** %this.addr, align 8
+ call void @_ZN1BC2Ev(%struct.B* %this1) #2, !dbg !34
+ ret void, !dbg !34
; CHECK: call void @_ZN1BC2Ev(%struct.B* %this1){{.*}} !dbg !
- call void @_ZN1BC2Ev(%struct.B* %this1) #2, !dbg !33
- ret void, !dbg !33
}
attributes #0 = { nounwind readnone }
attributes #1 = { inlinehint nounwind ssp uwtable }
attributes #2 = { nounwind }
-!llvm.dbg.cu = !{!1}
-!llvm.module.flags = !{!20, !21, !22}
-!llvm.ident = !{!23}
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!21, !22, !23}
+!llvm.ident = !{!24}
; CHECK-NEG-NOT: !DI{{Basic|Composite|Derived}}Type
-!0 = distinct !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "b", scope: !1, file: !2, line: 5, type: !5, isLocal: false, isDefinition: true))
-!1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 4.0.0 (trunk 282583) (llvm/trunk 282611)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !3, globals: !4)
-!2 = !DIFile(filename: "t.cpp", directory: "/")
-!3 = !{}
-!4 = !{!0}
-!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !2, line: 4, size: 64, align: 64, elements: !6, vtableHolder: !8, identifier: "_ZTS1B")
-!6 = !{!7}
-!7 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !5, baseType: !8)
-!8 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !2, line: 1, size: 64, align: 64, elements: !9, vtableHolder: !8, identifier: "_ZTS1A")
-!9 = !{!10, !16}
-!10 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$A", scope: !2, file: !2, baseType: !11, size: 64, flags: DIFlagArtificial)
-!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64)
-!12 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", baseType: !13, size: 64)
-!13 = !DISubroutineType(types: !14)
-!14 = !{!15}
-!15 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!0 = distinct !DIGlobalVariableExpression(var: !1)
+!1 = !DIGlobalVariable(name: "b", scope: !2, file: !3, line: 5, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 4.0.0 (trunk 282583) (llvm/trunk 282611)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "t.cpp", directory: "/")
+!4 = !{}
+!5 = !{!0}
+!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !3, line: 4, size: 64, align: 64, elements: !7, vtableHolder: !9, identifier: "_ZTS1B")
+!7 = !{!8}
+!8 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !6, baseType: !9)
+!9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !3, line: 1, size: 64, align: 64, elements: !10, vtableHolder: !9, identifier: "_ZTS1A")
+!10 = !{!11, !17}
+!11 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$A", scope: !3, file: !3, baseType: !12, size: 64, flags: DIFlagArtificial)
+!12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64)
+!13 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", baseType: !14, size: 64)
+!14 = !DISubroutineType(types: !15)
+!15 = !{!16}
+!16 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!17 = !DISubprogram(name: "~A", scope: !9, file: !3, line: 2, type: !18, isLocal: false, isDefinition: false, scopeLine: 2, containingType: !9, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, flags: DIFlagPrototyped, isOptimized: false)
+!18 = !DISubroutineType(types: !19)
+!19 = !{null, !20}
+!20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!21 = !{i32 2, !"Dwarf Version", i32 4}
+!22 = !{i32 2, !"Debug Info Version", i32 3}
+!23 = !{i32 1, !"PIC Level", i32 2}
+!24 = !{!"clang version 4.0.0 (trunk 282583) (llvm/trunk 282611)"}
; Only referenced by the type system.
; CHECK-NEG-NOT: !DISubprogram(name: "~A"
-!16 = !DISubprogram(name: "~A", scope: !8, file: !2, line: 2, type: !17, isLocal: false, isDefinition: false, scopeLine: 2, containingType: !8, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, flags: DIFlagPrototyped, isOptimized: false)
-!17 = !DISubroutineType(types: !18)
-!18 = !{null, !19}
-!19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!20 = !{i32 2, !"Dwarf Version", i32 4}
-!21 = !{i32 2, !"Debug Info Version", i32 3}
-!22 = !{i32 1, !"PIC Level", i32 2}
-!23 = !{!"clang version 4.0.0 (trunk 282583) (llvm/trunk 282611)"}
+!25 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC1Ev", scope: !6, file: !3, line: 4, type: !26, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !2, declaration: !29, variables: !4)
+!26 = !DISubroutineType(types: !27)
+!27 = !{null, !28}
+!28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!29 = !DISubprogram(name: "B", scope: !6, type: !26, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
+!30 = !DILocalVariable(name: "this", arg: 1, scope: !25, type: !31, flags: DIFlagArtificial | DIFlagObjectPointer)
+!31 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64)
+!32 = !DIExpression()
+!33 = !DILocation(line: 0, scope: !25)
+!34 = !DILocation(line: 4, column: 8, scope: !25)
+
; CHECK: !DISubprogram(name: "B", scope: ![[FILE:.*]], file: ![[FILE]],
; CHECK-NOT: containingType:
-!24 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC1Ev", scope: !5, file: !2, line: 4, type: !25, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !1, declaration: !28, variables: !3)
-!25 = !DISubroutineType(types: !26)
-!26 = !{null, !27}
-!27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
; CHECK-NEG-NOT: !DISubprogram(name: "B", {{.*}}, isDefinition: false
-!28 = !DISubprogram(name: "B", scope: !5, type: !25, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
-!29 = !DILocalVariable(name: "this", arg: 1, scope: !24, type: !30, flags: DIFlagArtificial | DIFlagObjectPointer)
-!30 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 64, align: 64)
-!31 = !DIExpression()
-!32 = !DILocation(line: 0, scope: !24)
-!33 = !DILocation(line: 4, column: 8, scope: !24)