diff options
Diffstat (limited to 'llvm/test/Transforms')
9 files changed, 49 insertions, 26 deletions
diff --git a/llvm/test/Transforms/GCOVProfiling/return-block.ll b/llvm/test/Transforms/GCOVProfiling/return-block.ll index 424e0b581f0..51dde5724fe 100644 --- a/llvm/test/Transforms/GCOVProfiling/return-block.ll +++ b/llvm/test/Transforms/GCOVProfiling/return-block.ll @@ -22,7 +22,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" -@A = common global i32 0, align 4 +@A = common global i32 0, align 4, !dbg !9 ; Function Attrs: nounwind uwtable define void @test() #0 !dbg !4 { @@ -61,7 +61,7 @@ attributes #2 = { nounwind } !6 = !DISubroutineType(types: !7) !7 = !{null} !8 = !{!9} -!9 = !DIGlobalVariable(name: "A", line: 3, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10, variable: i32* @A) +!9 = !DIGlobalVariable(name: "A", line: 3, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10) !10 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !11 = !{i32 2, !"Dwarf Version", i32 4} !12 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/llvm/test/Transforms/GlobalMerge/debug-info.ll b/llvm/test/Transforms/GlobalMerge/debug-info.ll new file mode 100644 index 00000000000..ba0109adf62 --- /dev/null +++ b/llvm/test/Transforms/GlobalMerge/debug-info.ll @@ -0,0 +1,23 @@ +; RUN: opt -global-merge -global-merge-max-offset=100 -S -o - %s | FileCheck %s + +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 + +define void @use1() { + %x = load i32, i32* @a + %y = load i32, i32* @b + ret void +} + +; CHECK: [[A]] = distinct !DIGlobalVariable(name: "a", scope: null, isLocal: false, isDefinition: true) +; CHECK: [[B]] = distinct !DIGlobalVariable(name: "b", scope: null, isLocal: false, isDefinition: true, expr: [[EXPR:![0-9]+]]) +; CHECK: [[EXPR]] = !DIExpression(DW_OP_plus, 4) + + +!0 = distinct !DIGlobalVariable(name: "a") +!1 = distinct !DIGlobalVariable(name: "b") diff --git a/llvm/test/Transforms/GlobalOpt/2009-03-05-dbg.ll b/llvm/test/Transforms/GlobalOpt/2009-03-05-dbg.ll index 3f6e269a960..587ec9bf7f3 100644 --- a/llvm/test/Transforms/GlobalOpt/2009-03-05-dbg.ll +++ b/llvm/test/Transforms/GlobalOpt/2009-03-05-dbg.ll @@ -2,7 +2,7 @@ ; 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 ; <i32*> [#uses=3] +@Stop = internal global i32 0, !dbg !0 ; <i32*> [#uses=3] define i32 @foo(i32 %i) nounwind ssp { entry: @@ -55,7 +55,7 @@ return: ; preds = %bb2 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!1} -!0 = !DIGlobalVariable(name: "Stop", line: 2, isLocal: true, isDefinition: true, scope: !1, file: !1, type: !2, variable: i32* @Stop) +!0 = !DIGlobalVariable(name: "Stop", line: 2, isLocal: true, isDefinition: true, scope: !1, file: !1, 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, enums: !21, retainedTypes: !21, 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: !1, type: !2) diff --git a/llvm/test/Transforms/Inline/alloca-dbgdeclare.ll b/llvm/test/Transforms/Inline/alloca-dbgdeclare.ll index d06a9299d92..44ca11adaf1 100644 --- a/llvm/test/Transforms/Inline/alloca-dbgdeclare.ll +++ b/llvm/test/Transforms/Inline/alloca-dbgdeclare.ll @@ -21,8 +21,8 @@ target triple = "aarch64-apple-darwin" %struct.A = type { i32, [2 x double] } -@a = global %struct.A zeroinitializer, align 8 -@b = global %struct.A zeroinitializer, align 8 +@a = global %struct.A zeroinitializer, align 8, !dbg !26 +@b = global %struct.A zeroinitializer, align 8, !dbg !27 ; Function Attrs: nounwind declare void @_Z3fn31A(%struct.A* nocapture readonly %p1) #0 @@ -107,8 +107,8 @@ attributes #3 = { noreturn nounwind } !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 = !DIGlobalVariable(name: "a", line: 4, isLocal: false, isDefinition: true, scope: null, file: !16, type: !4, variable: %struct.A* @a) -!27 = !DIGlobalVariable(name: "b", line: 4, isLocal: false, isDefinition: true, scope: null, file: !16, type: !4, variable: %struct.A* @b) +!26 = !DIGlobalVariable(name: "a", line: 4, isLocal: false, isDefinition: true, scope: null, file: !16, type: !4) +!27 = !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)"} diff --git a/llvm/test/Transforms/LoopVectorize/dbg.value.ll b/llvm/test/Transforms/LoopVectorize/dbg.value.ll index d7d3ff6d9f9..c25801fc37b 100644 --- a/llvm/test/Transforms/LoopVectorize/dbg.value.ll +++ b/llvm/test/Transforms/LoopVectorize/dbg.value.ll @@ -4,9 +4,9 @@ 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" target triple = "x86_64-apple-macosx10.8.0" -@A = global [1024 x i32] zeroinitializer, align 16 -@B = global [1024 x i32] zeroinitializer, align 16 -@C = global [1024 x i32] zeroinitializer, align 16 +@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 ; CHECK-LABEL: @test( define i32 @test() #0 !dbg !3 { @@ -55,12 +55,12 @@ attributes #1 = { nounwind readnone } !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 = !DIGlobalVariable(name: "A", line: 1, isLocal: false, isDefinition: true, scope: null, file: !4, type: !13, variable: [1024 x i32]* @A) +!12 = !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 = !DIGlobalVariable(name: "B", line: 2, isLocal: false, isDefinition: true, scope: null, file: !4, type: !13, variable: [1024 x i32]* @B) -!17 = !DIGlobalVariable(name: "C", line: 3, isLocal: false, isDefinition: true, scope: null, file: !4, type: !13, variable: [1024 x i32]* @C) +!16 = !DIGlobalVariable(name: "B", line: 2, isLocal: false, isDefinition: true, scope: null, file: !4, type: !13) +!17 = !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) diff --git a/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll b/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll index dc3e6de8c3c..9ffa8ca36ee 100644 --- a/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll +++ b/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll @@ -13,7 +13,7 @@ ; Coverage for this profile should be 100% ; CHECK-NOT: warning: cov-zero-samples.cc:1: -@N = global i64 8000000000, align 8 +@N = global i64 8000000000, align 8, !dbg !12 @.str = private unnamed_addr constant [11 x i8] c"sum is %d\0A\00", align 1 ; Function Attrs: nounwind uwtable @@ -98,7 +98,7 @@ declare i32 @printf(i8*, ...) !9 = !DISubroutineType(types: !10) !10 = !{!7} !11 = !{!12} -!12 = !DIGlobalVariable(name: "N", scope: !0, file: !1, line: 3, type: !13, isLocal: false, isDefinition: true, variable: i64* @N) +!12 = !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} diff --git a/llvm/test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll b/llvm/test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll index 872444d0165..94e32dedb61 100644 --- a/llvm/test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll +++ b/llvm/test/Transforms/SimplifyCFG/PR27615-simplify-cond-br.ll @@ -9,9 +9,9 @@ ; ModuleID = './csmith107.i.debug.ll' source_filename = "./csmith107.i.debug.ll" -@a = global i16 0 -@b = global i32 0 -@c = global i16* null +@a = global i16 0, !dbg !4 +@b = global i32 0, !dbg !6 +@c = global i16* null, !dbg !10 ; Function Attrs: nounwind @@ -46,13 +46,13 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #4 !1 = !DIFile(filename: "csmith107.i.c", directory: "/tmp") !2 = !{} !3 = !{!4, !6, !10} -!4 = !DIGlobalVariable(name: "a", scope: null, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, variable: i16* @a) +!4 = !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 = !DIGlobalVariable(name: "b", scope: null, file: !1, line: 3, type: !7, isLocal: false, isDefinition: true, variable: i32* @b) +!6 = !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 = !DIGlobalVariable(name: "c", scope: null, file: !1, line: 4, type: !11, isLocal: false, isDefinition: true, variable: i16** @c) +!10 = !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} diff --git a/llvm/test/Transforms/StripSymbols/2010-06-30-StripDebug.ll b/llvm/test/Transforms/StripSymbols/2010-06-30-StripDebug.ll index cb6c26e9aa4..0d08627907d 100644 --- a/llvm/test/Transforms/StripSymbols/2010-06-30-StripDebug.ll +++ b/llvm/test/Transforms/StripSymbols/2010-06-30-StripDebug.ll @@ -2,7 +2,7 @@ ; CHECK-NOT: call void @llvm.dbg.value -@x = common global i32 0 ; <i32*> [#uses=0] +@x = common global i32 0, !dbg !8 ; <i32*> [#uses=0] define void @foo() nounwind readnone optsize ssp !dbg !0 { entry: @@ -23,7 +23,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !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 = !DIGlobalVariable(name: "x", line: 1, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !7, variable: i32* @x) +!8 = !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) diff --git a/llvm/test/Transforms/StripSymbols/strip-dead-debug-info.ll b/llvm/test/Transforms/StripSymbols/strip-dead-debug-info.ll index 91074808df4..2116db49d00 100644 --- a/llvm/test/Transforms/StripSymbols/strip-dead-debug-info.ll +++ b/llvm/test/Transforms/StripSymbols/strip-dead-debug-info.ll @@ -4,7 +4,7 @@ ; CHECK-NOT: "bar" ; CHECK-NOT: "abcd" -@xyz = global i32 2 +@xyz = global i32 2, !dbg !17 ; Function Attrs: nounwind readnone declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0 @@ -47,7 +47,7 @@ attributes #2 = { nounwind readonly ssp } !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 = !DIGlobalVariable(name: "abcd", line: 2, isLocal: true, isDefinition: true, scope: !5, file: !5, type: !9) -!17 = !DIGlobalVariable(name: "xyz", line: 3, isLocal: false, isDefinition: true, scope: !5, file: !5, type: !9, variable: i32* @xyz) +!17 = !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) |

