diff options
Diffstat (limited to 'test/DebugInfo')
298 files changed, 3865 insertions, 1559 deletions
diff --git a/test/DebugInfo/AArch64/big-endian.ll b/test/DebugInfo/AArch64/big-endian.ll index 45f49da63077..22b7af9df3d4 100644 --- a/test/DebugInfo/AArch64/big-endian.ll +++ b/test/DebugInfo/AArch64/big-endian.ll @@ -9,7 +9,7 @@ target triple = "aarch64_be--none-eabi" !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) !1 = !DIFile(filename: "-", directory: "/work/validation") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/AArch64/bitfields.ll b/test/DebugInfo/AArch64/bitfields.ll index 5f0caab286b8..867b5be91ee1 100644 --- a/test/DebugInfo/AArch64/bitfields.ll +++ b/test/DebugInfo/AArch64/bitfields.ll @@ -54,7 +54,7 @@ target triple = "aarch64_be--linux-gnu" !llvm.module.flags = !{!13, !14, !15} !llvm.ident = !{!16} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) !1 = !DIFile(filename: "bitfields.c", directory: "/") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/AArch64/cfi-eof-prologue.ll b/test/DebugInfo/AArch64/cfi-eof-prologue.ll index 756443a951dd..c4681ca12fbe 100644 --- a/test/DebugInfo/AArch64/cfi-eof-prologue.ll +++ b/test/DebugInfo/AArch64/cfi-eof-prologue.ll @@ -26,7 +26,7 @@ target triple = "aarch64-apple-ios" @_ZTV1B = external unnamed_addr constant [4 x i8*] ; Function Attrs: nounwind -define %struct.B* @_ZN1BC2Ev(%struct.B* %this) unnamed_addr #0 align 2 { +define %struct.B* @_ZN1BC2Ev(%struct.B* %this) unnamed_addr #0 align 2 !dbg !28 { entry: tail call void @llvm.dbg.value(metadata %struct.B* %this, i64 0, metadata !30, metadata !38), !dbg !39 %0 = getelementptr inbounds %struct.B, %struct.B* %this, i64 0, i32 0, !dbg !40 @@ -39,7 +39,7 @@ entry: declare %struct.A* @_ZN1AC2Ev(%struct.A*) ; Function Attrs: nounwind -define %struct.B* @_ZN1BC1Ev(%struct.B* %this) unnamed_addr #0 align 2 { +define %struct.B* @_ZN1BC1Ev(%struct.B* %this) unnamed_addr #0 align 2 !dbg !32 { entry: tail call void @llvm.dbg.value(metadata %struct.B* %this, i64 0, metadata !34, metadata !38), !dbg !44 tail call void @llvm.dbg.value(metadata %struct.B* %this, i64 0, metadata !45, metadata !38) #3, !dbg !47 @@ -61,7 +61,7 @@ attributes #3 = { nounwind } !llvm.module.flags = !{!35, !36} !llvm.ident = !{!37} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 224279) (llvm/trunk 224283)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !27, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 224279) (llvm/trunk 224283)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !27, globals: !2, imports: !2) !1 = !DIFile(filename: "<stdin>", directory: "") !2 = !{} !3 = !{!4, !13} @@ -89,13 +89,13 @@ attributes #3 = { nounwind } !25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") !26 = !DISubprogram(name: "~A", line: 3, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !"_ZTS1A", type: !23, containingType: !"_ZTS1A") !27 = !{!28, !32} -!28 = !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, function: %struct.B* (%struct.B*)* @_ZN1BC2Ev, declaration: !8, variables: !29) +!28 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, declaration: !8, variables: !29) !29 = !{!30} -!30 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !31) +!30 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !31) !31 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1B") -!32 = !DISubprogram(name: "B", linkageName: "_ZN1BC1Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, function: %struct.B* (%struct.B*)* @_ZN1BC1Ev, declaration: !8, variables: !33) +!32 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC1Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, declaration: !8, variables: !33) !33 = !{!34} -!34 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !32, type: !31) +!34 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !32, type: !31) !35 = !{i32 2, !"Dwarf Version", i32 4} !36 = !{i32 2, !"Debug Info Version", i32 3} !37 = !{!"clang version 3.6.0 (trunk 224279) (llvm/trunk 224283)"} @@ -106,7 +106,7 @@ attributes #3 = { nounwind } !42 = !{!"vtable pointer", !43, i64 0} !43 = !{!"Simple C/C++ TBAA"} !44 = !DILocation(line: 0, scope: !32) -!45 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !31) +!45 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !31) !46 = !DILocation(line: 9, scope: !32) !47 = !DILocation(line: 0, scope: !28, inlinedAt: !46) !48 = !DILocation(line: 9, scope: !28, inlinedAt: !46) diff --git a/test/DebugInfo/AArch64/coalescing.ll b/test/DebugInfo/AArch64/coalescing.ll index b1d566197126..5f69895c7363 100644 --- a/test/DebugInfo/AArch64/coalescing.ll +++ b/test/DebugInfo/AArch64/coalescing.ll @@ -14,7 +14,7 @@ target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" target triple = "arm64-apple-ios" ; Function Attrs: nounwind optsize -define void @_Z5startv() #0 { +define void @_Z5startv() #0 !dbg !4 { entry: %size = alloca i32, align 4 %0 = bitcast i32* %size to i8*, !dbg !15 @@ -44,22 +44,22 @@ attributes #3 = { nounwind optsize } !llvm.module.flags = !{!12, !13} !llvm.ident = !{!14} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 223149) (llvm/trunk 223115)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 223149) (llvm/trunk 223115)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "<stdin>", directory: "") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "start", linkageName: "_Z5startv", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !6, type: !7, function: void ()* @_Z5startv, variables: !9) +!4 = distinct !DISubprogram(name: "start", linkageName: "_Z5startv", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !9) !5 = !DIFile(filename: "test1.c", directory: "") !6 = !DIFile(filename: "test1.c", directory: "") !7 = !DISubroutineType(types: !8) !8 = !{null} !9 = !{!10} -!10 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "size", line: 4, scope: !4, file: !6, type: !11) +!10 = !DILocalVariable(name: "size", line: 4, scope: !4, file: !6, type: !11) !11 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) !12 = !{i32 2, !"Dwarf Version", i32 2} !13 = !{i32 2, !"Debug Info Version", i32 3} !14 = !{!"clang version 3.6.0 (trunk 223149) (llvm/trunk 223115)"} !15 = !DILocation(line: 5, column: 3, scope: !4) -!16 = !DIExpression() +!16 = !DIExpression(DW_OP_deref) !17 = !DILocation(line: 4, column: 12, scope: !4) !18 = !DILocation(line: 8, column: 1, scope: !4) diff --git a/test/DebugInfo/AArch64/constant-dbgloc.ll b/test/DebugInfo/AArch64/constant-dbgloc.ll index a71b869f5366..aae518725fa4 100644 --- a/test/DebugInfo/AArch64/constant-dbgloc.ll +++ b/test/DebugInfo/AArch64/constant-dbgloc.ll @@ -13,7 +13,7 @@ target triple = "aarch64--linux-gnueabihf" ; CHECK: movn ; Function Attrs: nounwind -define i32 @main() { +define i32 @main() !dbg !4 { entry: %retval = alloca i32, align 4 store i32 0, i32* %retval @@ -23,11 +23,11 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!8, !9} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !3) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !3) !1 = !DIFile(filename: "test.c", directory: "/home/user/clang/build") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, variables: !2) !5 = !DISubroutineType(types: !6) !6 = !{!7} !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/AArch64/dwarfdump.ll b/test/DebugInfo/AArch64/dwarfdump.ll index 3e95a6fe314f..57dcdf82d69e 100644 --- a/test/DebugInfo/AArch64/dwarfdump.ll +++ b/test/DebugInfo/AArch64/dwarfdump.ll @@ -18,7 +18,7 @@ ; CHECK-4: DW_AT_high_pc [DW_FORM_data4] (0x00000008) ; CHECK-3: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000008) -define i32 @main() nounwind { +define i32 @main() nounwind !dbg !3 { ret i32 0, !dbg !8 } @@ -27,10 +27,10 @@ attributes #0 = { nounwind } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!10} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 0, file: !9, enums: !1, retainedTypes: !1, subprograms: !2, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 0, file: !9, enums: !1, retainedTypes: !1, subprograms: !2, globals: !1, imports: !1) !1 = !{} !2 = !{!3} -!3 = !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !9, scope: !4, type: !5, function: i32 ()* @main, variables: !1) +!3 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !9, scope: !4, type: !5, variables: !1) !4 = !DIFile(filename: "tmp.c", directory: "/home/tim/llvm/build") !5 = !DISubroutineType(types: !6) !6 = !{!7} diff --git a/test/DebugInfo/AArch64/frameindices.ll b/test/DebugInfo/AArch64/frameindices.ll index 029077423368..5fb03dfc8834 100644 --- a/test/DebugInfo/AArch64/frameindices.ll +++ b/test/DebugInfo/AArch64/frameindices.ll @@ -42,7 +42,7 @@ target triple = "aarch64-apple-ios" @a = global i64 0, align 8 @b = global i32* null, align 8 -define void @_Z3f131A(%struct.A* nocapture readonly %p1) #0 { +define void @_Z3f131A(%struct.A* nocapture readonly %p1) #0 !dbg !25 { entry: %agg.tmp = alloca %struct.A, align 8 tail call void @llvm.dbg.declare(metadata %struct.A* %p1, metadata !30, metadata !46), !dbg !47 @@ -67,7 +67,7 @@ declare void @_Z2f91A(%struct.A*) #0 ; Function Attrs: nounwind declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #3 -define void @_Z3f111A(%struct.A* nocapture readonly %p1) #0 { +define void @_Z3f111A(%struct.A* nocapture readonly %p1) #0 !dbg !31 { entry: %agg.tmp.i = alloca %struct.A, align 8 tail call void @llvm.dbg.declare(metadata %struct.A* %p1, metadata !33, metadata !46), !dbg !63 @@ -83,7 +83,7 @@ entry: ret void, !dbg !73 } -define void @_Z3f16v() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define void @_Z3f16v() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !34 { entry: %agg.tmp.i.i = alloca %struct.A, align 8 %d = alloca %struct.B, align 1 @@ -160,7 +160,7 @@ attributes #5 = { builtin } !llvm.module.flags = !{!43, !44} !llvm.ident = !{!45} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !24, globals: !40, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !24, globals: !40, imports: !2) !1 = !DIFile(filename: "<stdin>", directory: "") !2 = !{} !3 = !{!4, !12, !14} @@ -185,21 +185,21 @@ attributes #5 = { builtin } !22 = !DISubroutineType(types: !23) !23 = !{null, !19} !24 = !{!25, !31, !34} -!25 = !DISubprogram(name: "f13", linkageName: "_Z3f131A", line: 13, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !5, scope: !26, type: !27, function: void (%struct.A*)* @_Z3f131A, variables: !29) +!25 = distinct !DISubprogram(name: "f13", linkageName: "_Z3f131A", line: 13, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !5, scope: !26, type: !27, variables: !29) !26 = !DIFile(filename: "test.cpp", directory: "") !27 = !DISubroutineType(types: !28) !28 = !{null, !"_ZTS1A"} !29 = !{!30} -!30 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "p1", line: 13, arg: 1, scope: !25, file: !26, type: !"_ZTS1A") -!31 = !DISubprogram(name: "f11", linkageName: "_Z3f111A", line: 17, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 17, file: !5, scope: !26, type: !27, function: void (%struct.A*)* @_Z3f111A, variables: !32) +!30 = !DILocalVariable(name: "p1", line: 13, arg: 1, scope: !25, file: !26, type: !"_ZTS1A") +!31 = distinct !DISubprogram(name: "f11", linkageName: "_Z3f111A", line: 17, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 17, file: !5, scope: !26, type: !27, variables: !32) !32 = !{!33} -!33 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "p1", line: 17, arg: 1, scope: !31, file: !26, type: !"_ZTS1A") -!34 = !DISubprogram(name: "f16", linkageName: "_Z3f16v", line: 18, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !5, scope: !26, type: !35, function: void ()* @_Z3f16v, variables: !37) +!33 = !DILocalVariable(name: "p1", line: 17, arg: 1, scope: !31, file: !26, type: !"_ZTS1A") +!34 = distinct !DISubprogram(name: "f16", linkageName: "_Z3f16v", line: 18, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !5, scope: !26, type: !35, variables: !37) !35 = !DISubroutineType(types: !36) !36 = !{null} !37 = !{!38, !39} -!38 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "c", line: 19, scope: !34, file: !26, type: !"_ZTS1A") -!39 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "d", line: 20, scope: !34, file: !26, type: !"_ZTS1B") +!38 = !DILocalVariable(name: "c", line: 19, scope: !34, file: !26, type: !"_ZTS1A") +!39 = !DILocalVariable(name: "d", line: 20, scope: !34, file: !26, type: !"_ZTS1B") !40 = !{!41, !42} !41 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !26, type: !20, variable: i64* @a) !42 = !DIGlobalVariable(name: "b", line: 7, isLocal: false, isDefinition: true, scope: null, file: !26, type: !12, variable: i32** @b) @@ -234,7 +234,7 @@ attributes #5 = { builtin } !71 = !DILocation(line: 15, column: 3, scope: !25, inlinedAt: !66) !72 = !DILocation(line: 16, column: 1, scope: !25, inlinedAt: !66) !73 = !DILocation(line: 17, column: 27, scope: !31) -!74 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "p1", line: 17, arg: 1, scope: !31, file: !26, type: !"_ZTS1A") +!74 = !DILocalVariable(name: "p1", line: 17, arg: 1, scope: !31, file: !26, type: !"_ZTS1A") !75 = distinct !DILocation(line: 22, column: 3, scope: !34) !76 = !DIExpression(DW_OP_bit_piece, 8, 120) !77 = !DILocation(line: 17, column: 12, scope: !31, inlinedAt: !75) diff --git a/test/DebugInfo/AArch64/prologue_end.ll b/test/DebugInfo/AArch64/prologue_end.ll new file mode 100644 index 000000000000..a70112229959 --- /dev/null +++ b/test/DebugInfo/AArch64/prologue_end.ll @@ -0,0 +1,43 @@ +; RUN: llc -disable-fp-elim -O0 %s -mtriple aarch64-apple-darwin -o - | FileCheck %s + +; int func(void); +; void prologue_end_test() { +; func(); +; func(); +; } + +define void @prologue_end_test() nounwind uwtable !dbg !4 { + ; CHECK: prologue_end_test: + ; CHECK: .cfi_startproc + ; CHECK: stp x29, x30 + ; CHECK: mov x29, sp + ; CHECK: sub sp, sp + ; CHECK: .loc 1 3 3 prologue_end + ; CHECK: bl _func + ; CHECK: bl _func +entry: + %call = call i32 @func(), !dbg !11 + %call1 = call i32 @func(), !dbg !12 + ret void, !dbg !13 +} + +declare i32 @func() + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!7, !8, !9} +!llvm.ident = !{!10} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 242129)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!1 = !DIFile(filename: "foo.c", directory: "/tmp") +!2 = !{} +!3 = !{!4} +!4 = distinct !DISubprogram(name: "prologue_end_test", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, variables: !2) +!5 = !DISubroutineType(types: !6) +!6 = !{null} +!7 = !{i32 2, !"Dwarf Version", i32 2} +!8 = !{i32 2, !"Debug Info Version", i32 3} +!9 = !{i32 1, !"PIC Level", i32 2} +!10 = !{!"clang version 3.7.0 (trunk 242129)"} +!11 = !DILocation(line: 3, column: 3, scope: !4) +!12 = !DILocation(line: 4, column: 3, scope: !4) +!13 = !DILocation(line: 5, column: 1, scope: !4) diff --git a/test/DebugInfo/AArch64/struct_by_value.ll b/test/DebugInfo/AArch64/struct_by_value.ll index dc9ac42e8a0f..edbef82557cb 100644 --- a/test/DebugInfo/AArch64/struct_by_value.ll +++ b/test/DebugInfo/AArch64/struct_by_value.ll @@ -31,7 +31,7 @@ target triple = "arm64-apple-ios3.0.0" %struct.five = type { i32, i32, i32, i32, i32 } ; Function Attrs: nounwind ssp -define i32 @return_five_int(%struct.five* %f) #0 { +define i32 @return_five_int(%struct.five* %f) #0 !dbg !4 { entry: call void @llvm.dbg.declare(metadata %struct.five* %f, metadata !17, metadata !DIExpression(DW_OP_deref)), !dbg !18 %a = getelementptr inbounds %struct.five, %struct.five* %f, i32 0, i32 0, !dbg !19 @@ -48,11 +48,11 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!16, !20} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "LLVM version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "LLVM version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "struct_by_value.c", directory: "") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "return_five_int", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 14, file: !1, scope: !5, type: !6, function: i32 (%struct.five*)* @return_five_int, variables: !2) +!4 = distinct !DISubprogram(name: "return_five_int", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 14, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "struct_by_value.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{!8, !9} @@ -65,7 +65,7 @@ attributes #1 = { nounwind readnone } !14 = !DIDerivedType(tag: DW_TAG_member, name: "d", line: 6, size: 32, align: 32, offset: 96, file: !1, scope: !9, baseType: !8) !15 = !DIDerivedType(tag: DW_TAG_member, name: "e", line: 7, size: 32, align: 32, offset: 128, file: !1, scope: !9, baseType: !8) !16 = !{i32 2, !"Dwarf Version", i32 2} -!17 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "f", line: 13, arg: 1, scope: !4, file: !5, type: !9) +!17 = !DILocalVariable(name: "f", line: 13, arg: 1, scope: !4, file: !5, type: !9) !18 = !DILocation(line: 13, scope: !4) !19 = !DILocation(line: 16, scope: !4) !20 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/ARM/PR16736.ll b/test/DebugInfo/ARM/PR16736.ll index 9d4992210a24..dd299a2a97d0 100644 --- a/test/DebugInfo/ARM/PR16736.ll +++ b/test/DebugInfo/ARM/PR16736.ll @@ -1,5 +1,5 @@ ; RUN: llc -filetype=asm < %s | FileCheck %s -; CHECK: @DEBUG_VALUE: h:x <- [R{{.*}}+{{.*}}] +; CHECK: @DEBUG_VALUE: h:x <- [%R{{.*}}+{{.*}}] ; generated from: ; clang -cc1 -triple thumbv7 -S -O1 arm.cpp -g ; @@ -13,7 +13,7 @@ target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:64:64- target triple = "thumbv7-apple-ios" ; Function Attrs: nounwind -define arm_aapcscc void @_Z1hiiiif(i32, i32, i32, i32, float %x) #0 { +define arm_aapcscc void @_Z1hiiiif(i32, i32, i32, i32, float %x) #0 !dbg !4 { entry: tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !12, metadata !DIExpression()), !dbg !18 tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !13, metadata !DIExpression()), !dbg !18 @@ -41,11 +41,11 @@ attributes #3 = { nounwind } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!17, !21} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 190804) (llvm/trunk 190797)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 190804) (llvm/trunk 190797)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "/<unknown>", directory: "") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "h", linkageName: "_Z1hiiiif", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !6, type: !7, function: void (i32, i32, i32, i32, float)* @_Z1hiiiif, variables: !11) +!4 = distinct !DISubprogram(name: "h", linkageName: "_Z1hiiiif", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !11) !5 = !DIFile(filename: "/arm.cpp", directory: "") !6 = !DIFile(filename: "/arm.cpp", directory: "") !7 = !DISubroutineType(types: !8) @@ -53,11 +53,11 @@ attributes #3 = { nounwind } !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !10 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float) !11 = !{!12, !13, !14, !15, !16} -!12 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "", line: 3, arg: 1, scope: !4, file: !6, type: !9) -!13 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "", line: 3, arg: 2, scope: !4, file: !6, type: !9) -!14 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "", line: 3, arg: 3, scope: !4, file: !6, type: !9) -!15 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "", line: 3, arg: 4, scope: !4, file: !6, type: !9) -!16 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 3, arg: 5, scope: !4, file: !6, type: !10) +!12 = !DILocalVariable(name: "", line: 3, arg: 1, scope: !4, file: !6, type: !9) +!13 = !DILocalVariable(name: "", line: 3, arg: 2, scope: !4, file: !6, type: !9) +!14 = !DILocalVariable(name: "", line: 3, arg: 3, scope: !4, file: !6, type: !9) +!15 = !DILocalVariable(name: "", line: 3, arg: 4, scope: !4, file: !6, type: !9) +!16 = !DILocalVariable(name: "x", line: 3, arg: 5, scope: !4, file: !6, type: !10) !17 = !{i32 2, !"Dwarf Version", i32 4} !18 = !DILocation(line: 3, scope: !4) !19 = !DILocation(line: 4, scope: !4) diff --git a/test/DebugInfo/ARM/bitfield.ll b/test/DebugInfo/ARM/bitfield.ll index 9b41e4e4f7bc..4c528d06df11 100644 --- a/test/DebugInfo/ARM/bitfield.ll +++ b/test/DebugInfo/ARM/bitfield.ll @@ -26,7 +26,7 @@ target triple = "thumbv7-apple-ios" !llvm.module.flags = !{!11, !12, !13, !14, !15} !llvm.ident = !{!16} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) !1 = !DIFile(filename: "test.i", directory: "/") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/ARM/cfi-eof-prologue.ll b/test/DebugInfo/ARM/cfi-eof-prologue.ll index 07e4d8a717b6..7430551fd610 100644 --- a/test/DebugInfo/ARM/cfi-eof-prologue.ll +++ b/test/DebugInfo/ARM/cfi-eof-prologue.ll @@ -27,7 +27,7 @@ target triple = "thumbv7-apple-ios" @_ZTV1B = external unnamed_addr constant [4 x i8*] ; Function Attrs: nounwind -define %struct.B* @_ZN1BC2Ev(%struct.B* %this) unnamed_addr #0 align 2 { +define %struct.B* @_ZN1BC2Ev(%struct.B* %this) unnamed_addr #0 align 2 !dbg !28 { entry: tail call void @llvm.dbg.value(metadata %struct.B* %this, i64 0, metadata !30, metadata !40), !dbg !41 %0 = getelementptr inbounds %struct.B, %struct.B* %this, i32 0, i32 0, !dbg !42 @@ -40,7 +40,7 @@ entry: declare %struct.A* @_ZN1AC2Ev(%struct.A*) ; Function Attrs: nounwind -define %struct.B* @_ZN1BC1Ev(%struct.B* %this) unnamed_addr #0 align 2 { +define %struct.B* @_ZN1BC1Ev(%struct.B* %this) unnamed_addr #0 align 2 !dbg !32 { entry: tail call void @llvm.dbg.value(metadata %struct.B* %this, i64 0, metadata !34, metadata !40), !dbg !46 tail call void @llvm.dbg.value(metadata %struct.B* %this, i64 0, metadata !47, metadata !40) #3, !dbg !49 @@ -62,7 +62,7 @@ attributes #3 = { nounwind } !llvm.module.flags = !{!35, !36, !37, !38} !llvm.ident = !{!39} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 224279) (llvm/trunk 224283)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !27, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 224279) (llvm/trunk 224283)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !27, globals: !2, imports: !2) !1 = !DIFile(filename: "<stdin>", directory: "") !2 = !{} !3 = !{!4, !13} @@ -90,13 +90,13 @@ attributes #3 = { nounwind } !25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") !26 = !DISubprogram(name: "~A", line: 3, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !"_ZTS1A", type: !23, containingType: !"_ZTS1A") !27 = !{!28, !32} -!28 = !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, function: %struct.B* (%struct.B*)* @_ZN1BC2Ev, declaration: !8, variables: !29) +!28 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, declaration: !8, variables: !29) !29 = !{!30} -!30 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !31) +!30 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !31) !31 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !"_ZTS1B") -!32 = !DISubprogram(name: "B", linkageName: "_ZN1BC1Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, function: %struct.B* (%struct.B*)* @_ZN1BC1Ev, declaration: !8, variables: !33) +!32 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC1Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !9, declaration: !8, variables: !33) !33 = !{!34} -!34 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !32, type: !31) +!34 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !32, type: !31) !35 = !{i32 2, !"Dwarf Version", i32 4} !36 = !{i32 2, !"Debug Info Version", i32 3} !37 = !{i32 1, !"wchar_size", i32 4} @@ -109,7 +109,7 @@ attributes #3 = { nounwind } !44 = !{!"vtable pointer", !45, i64 0} !45 = !{!"Simple C/C++ TBAA"} !46 = !DILocation(line: 0, scope: !32) -!47 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !31) +!47 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !31) !48 = !DILocation(line: 9, scope: !32) !49 = !DILocation(line: 0, scope: !28, inlinedAt: !48) !50 = !DILocation(line: 9, scope: !28, inlinedAt: !48) diff --git a/test/DebugInfo/ARM/constant-dbgloc.ll b/test/DebugInfo/ARM/constant-dbgloc.ll index c4a5703f3e8b..5fd219af86c2 100644 --- a/test/DebugInfo/ARM/constant-dbgloc.ll +++ b/test/DebugInfo/ARM/constant-dbgloc.ll @@ -13,7 +13,7 @@ target triple = "armv7--linux-gnueabihf" ; CHECK: mvn ; Function Attrs: nounwind -define i32 @main() { +define i32 @main() !dbg !4 { entry: %retval = alloca i32, align 4 store i32 0, i32* %retval @@ -23,11 +23,11 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!8, !9} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !3) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !3) !1 = !DIFile(filename: "test.c", directory: "/home/user/clang/build") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, variables: !2) !5 = !DISubroutineType(types: !6) !6 = !{!7} !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/ARM/float-args.ll b/test/DebugInfo/ARM/float-args.ll new file mode 100644 index 000000000000..9ec7db2bdf07 --- /dev/null +++ b/test/DebugInfo/ARM/float-args.ll @@ -0,0 +1,45 @@ +; RUN: %llc_dwarf -filetype=obj -mattr=+vfp2 -float-abi=hard < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s +; RUN: %llc_dwarf -filetype=obj -mattr=-vfp2 -float-abi=soft < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s +; REQUIRES: object-emission + +; Generated by clang -O1 -g from the following C source: +; float foo(float p) { +; return p; +; } + +; When using the soft-float calling convention, we have to look through a +; bitcast to find the register which contains the argument. + +; CHECK: 0x{{[0-9a-f]*}}: DW_TAG_formal_parameter +; CHECK-NEXT: DW_AT_location + +target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" +target triple = "armv7--none-eabi" + +define float @foo(float %p) !dbg !4 { +entry: + tail call void @llvm.dbg.value(metadata float %p, i64 0, metadata !9, metadata !15), !dbg !16 + ret float %p, !dbg !18 +} + +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!10, !11} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!1 = !DIFile(filename: "test.c", directory: "") +!2 = !{} +!3 = !{!4} +!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, variables: !8) +!5 = !DISubroutineType(types: !6) +!6 = !{!7, !7} +!7 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float) +!8 = !{!9} +!9 = !DILocalVariable(name: "p", arg: 1, scope: !4, file: !1, line: 1, type: !7) +!10 = !{i32 2, !"Dwarf Version", i32 4} +!11 = !{i32 2, !"Debug Info Version", i32 3} +!15 = !DIExpression() +!16 = !DILocation(line: 1, column: 17, scope: !4) +!17 = !DILocation(line: 2, column: 12, scope: !4) +!18 = !DILocation(line: 2, column: 3, scope: !4) diff --git a/test/DebugInfo/ARM/header.ll b/test/DebugInfo/ARM/header.ll index 6723f093a59b..bb1f141c84d6 100644 --- a/test/DebugInfo/ARM/header.ll +++ b/test/DebugInfo/ARM/header.ll @@ -12,17 +12,17 @@ ; CHECK: .section __DWARF,__debug_str,regular,debug -define void @f() { +define void @f() !dbg !4 { ret void, !dbg !9 } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!7, !8} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "foo", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "foo", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "/foo/test.c", directory: "/foo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, function: void ()* @f, variables: !2) +!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, variables: !2) !5 = !DISubroutineType(types: !6) !6 = !{null} !7 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/DebugInfo/ARM/lowerbdgdeclare_vla.ll b/test/DebugInfo/ARM/lowerbdgdeclare_vla.ll index daf26507a036..806bbc3b1d1f 100644 --- a/test/DebugInfo/ARM/lowerbdgdeclare_vla.ll +++ b/test/DebugInfo/ARM/lowerbdgdeclare_vla.ll @@ -17,7 +17,7 @@ target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64- target triple = "thumbv7-apple-ios8.0.0" ; Function Attrs: nounwind optsize readnone -define void @run(float %r) #0 { +define void @run(float %r) #0 !dbg !4 { entry: tail call void @llvm.dbg.declare(metadata float %r, metadata !11, metadata !DIExpression()), !dbg !22 %conv = fptosi float %r to i32, !dbg !23 @@ -67,25 +67,25 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!20, !33} !llvm.ident = !{!21} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "<unknown>", directory: "/Volumes/Data/radar/15464571") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "run", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !5, scope: !6, type: !7, function: void (float)* @run, variables: !10) +!4 = distinct !DISubprogram(name: "run", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !5, scope: !6, type: !7, variables: !10) !5 = !DIFile(filename: "test.c", directory: "/Volumes/Data/radar/15464571") !6 = !DIFile(filename: "test.c", directory: "/Volumes/Data/radar/15464571") !7 = !DISubroutineType(types: !8) !8 = !{null, !9} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float) !10 = !{!11, !12, !14, !18} -!11 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "r", line: 1, arg: 1, scope: !4, file: !6, type: !9) -!12 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "count", line: 3, scope: !4, file: !6, type: !13) +!11 = !DILocalVariable(name: "r", line: 1, arg: 1, scope: !4, file: !6, type: !9) +!12 = !DILocalVariable(name: "count", line: 3, scope: !4, file: !6, type: !13) !13 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!14 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "vla", line: 4, scope: !4, file: !6, type: !15) +!14 = !DILocalVariable(name: "vla", line: 4, scope: !4, file: !6, type: !15) !15 = !DICompositeType(tag: DW_TAG_array_type, align: 32, baseType: !9, elements: !16) !16 = !{!17} !17 = !DISubrange(count: -1) -!18 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 6, scope: !19, file: !6, type: !13) +!18 = !DILocalVariable(name: "i", line: 6, scope: !19, file: !6, type: !13) !19 = distinct !DILexicalBlock(line: 6, column: 0, file: !5, scope: !4) !20 = !{i32 2, !"Dwarf Version", i32 2} !21 = !{!"clang version 3.4 "} diff --git a/test/DebugInfo/ARM/multiple-constant-uses-drops-dbgloc.ll b/test/DebugInfo/ARM/multiple-constant-uses-drops-dbgloc.ll index e68c5b824163..de3bee248a1f 100644 --- a/test/DebugInfo/ARM/multiple-constant-uses-drops-dbgloc.ll +++ b/test/DebugInfo/ARM/multiple-constant-uses-drops-dbgloc.ll @@ -19,7 +19,7 @@ target triple = "armv7--linux-gnueabihf" @b = common global i32 0, align 4 ; Function Attrs: nounwind -define void @proc() #0 { +define void @proc() #0 !dbg !4 { entry: store i8 65, i8* @ch, align 1, !dbg !17 store i32 0, i32* @b, align 4, !dbg !18 @@ -32,11 +32,11 @@ attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"= !llvm.module.flags = !{!12, !13, !14, !15} !llvm.ident = !{!16} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !3) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !3) !1 = !DIFile(filename: "test.c", directory: "/home/user/clang/build") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "proc", scope: !1, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @proc, variables: !2) +!4 = distinct !DISubprogram(name: "proc", scope: !1, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, variables: !2) !5 = !DISubroutineType(types: !6) !6 = !{null} !7 = !{!8, !10} diff --git a/test/DebugInfo/ARM/prologue_end.ll b/test/DebugInfo/ARM/prologue_end.ll new file mode 100644 index 000000000000..b663b98e0387 --- /dev/null +++ b/test/DebugInfo/ARM/prologue_end.ll @@ -0,0 +1,46 @@ +; RUN: llc -disable-fp-elim -O0 %s -mtriple armv7-apple-darwin -o - | FileCheck %s +; RUN: llc -disable-fp-elim -O0 %s -mtriple thumbv7-apple-darwin -o - | FileCheck %s + +; int func(void); +; void prologue_end_test() { +; func(); +; func(); +; } + +define void @prologue_end_test() nounwind uwtable !dbg !4 { + ; CHECK: prologue_end_test: + ; CHECK: .cfi_startproc + ; CHECK: push {r7, lr} + ; CHECK: {{mov r7, sp|add r7, sp}} + ; CHECK: sub sp + ; CHECK: .loc 1 3 3 prologue_end + ; CHECK: bl {{_func|Ltmp}} + ; CHECK: bl {{_func|Ltmp}} +entry: + %call = call i32 @func(), !dbg !13 + %call1 = call i32 @func(), !dbg !14 + ret void, !dbg !15 +} + +declare i32 @func() + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!7, !8, !9, !10, !11} +!llvm.ident = !{!12} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 242129)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!1 = !DIFile(filename: "foo.c", directory: "/tmp") +!2 = !{} +!3 = !{!4} +!4 = distinct !DISubprogram(name: "prologue_end_test", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, variables: !2) +!5 = !DISubroutineType(types: !6) +!6 = !{null} +!7 = !{i32 2, !"Dwarf Version", i32 2} +!8 = !{i32 2, !"Debug Info Version", i32 3} +!9 = !{i32 1, !"wchar_size", i32 4} +!10 = !{i32 1, !"min_enum_size", i32 4} +!11 = !{i32 1, !"PIC Level", i32 2} +!12 = !{!"clang version 3.7.0 (trunk 242129)"} +!13 = !DILocation(line: 3, column: 3, scope: !4) +!14 = !DILocation(line: 4, column: 3, scope: !4) +!15 = !DILocation(line: 5, column: 1, scope: !4) diff --git a/test/DebugInfo/ARM/s-super-register.ll b/test/DebugInfo/ARM/s-super-register.ll index def87695ccce..887d37e27635 100644 --- a/test/DebugInfo/ARM/s-super-register.ll +++ b/test/DebugInfo/ARM/s-super-register.ll @@ -9,7 +9,7 @@ target triple = "thumbv7-apple-macosx10.6.7" ; 0x9d DW_OP_bit_piece ; CHECK: Location description: 90 {{.. .. ((93 ..)|(9d .. ..)) $}} -define void @_Z3foov() optsize ssp { +define void @_Z3foov() optsize ssp !dbg !1 { entry: %call = tail call float @_Z3barv() optsize, !dbg !11 tail call void @llvm.dbg.value(metadata float %call, i64 0, metadata !5, metadata !DIExpression()), !dbg !11 @@ -40,15 +40,15 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!20} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 (trunk 130845)", isOptimized: true, emissionKind: 1, file: !18, enums: !19, retainedTypes: !19, subprograms: !16, imports: null) -!1 = !DISubprogram(name: "foo", linkageName: "_Z3foov", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !18, scope: !2, type: !3, function: void ()* @_Z3foov, variables: !17) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 (trunk 130845)", isOptimized: true, emissionKind: 1, file: !18, enums: !19, retainedTypes: !19, subprograms: !16, imports: null) +!1 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !18, scope: !2, type: !3, variables: !17) !2 = !DIFile(filename: "k.cc", directory: "/private/tmp") !3 = !DISubroutineType(types: !4) !4 = !{null} -!5 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "k", line: 6, scope: !6, file: !2, type: !7) +!5 = !DILocalVariable(name: "k", line: 6, scope: !6, file: !2, type: !7) !6 = distinct !DILexicalBlock(line: 5, column: 12, file: !18, scope: !1) !7 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float) -!8 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "y", line: 8, scope: !9, file: !2, type: !7) +!8 = !DILocalVariable(name: "y", line: 8, scope: !9, file: !2, type: !7) !9 = distinct !DILexicalBlock(line: 7, column: 25, file: !18, scope: !10) !10 = distinct !DILexicalBlock(line: 7, column: 3, file: !18, scope: !6) !11 = !DILocation(line: 6, column: 18, scope: !6) diff --git a/test/DebugInfo/ARM/selectiondag-deadcode.ll b/test/DebugInfo/ARM/selectiondag-deadcode.ll index 1b6528269f7a..fe5e87658dde 100644 --- a/test/DebugInfo/ARM/selectiondag-deadcode.ll +++ b/test/DebugInfo/ARM/selectiondag-deadcode.ll @@ -1,7 +1,7 @@ ; RUN: llc -filetype=asm < %s | FileCheck %s target triple = "thumbv7-apple-ios7.0.0" %class.Matrix3.0.6.10 = type { [9 x float] } -define arm_aapcscc void @_Z9GetMatrixv(%class.Matrix3.0.6.10* noalias nocapture sret %agg.result) #0 { +define arm_aapcscc void @_Z9GetMatrixv(%class.Matrix3.0.6.10* noalias nocapture sret %agg.result) #0 !dbg !39 { br i1 fcmp oeq (float fadd (float fadd (float fmul (float undef, float undef), float fmul (float undef, float undef)), float fmul (float undef, float undef)), float 0.000000e+00), label %_ZN7Vector39NormalizeEv.exit, label %1 tail call arm_aapcscc void @_ZL4Sqrtd() #3 br label %_ZN7Vector39NormalizeEv.exit @@ -21,7 +21,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 declare arm_aapcscc void @_ZL4Sqrtd() #2 !4 = !DICompositeType(tag: DW_TAG_class_type, name: "Matrix3", line: 20, size: 288, align: 32, file: !5, identifier: "_ZTS7Matrix3") !5 = !DIFile(filename: "test.ii", directory: "/Volumes/Data/radar/15094721") -!39 = !DISubprogram(name: "GetMatrix", linkageName: "_Z9GetMatrixv", line: 32, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 32, file: !5, scope: !40, type: !41, function: void (%class.Matrix3.0.6.10*)* @_Z9GetMatrixv) +!39 = distinct !DISubprogram(name: "GetMatrix", linkageName: "_Z9GetMatrixv", line: 32, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 32, file: !5, scope: !40, type: !41) !40 = !DIFile(filename: "test.ii", directory: "/Volumes/Data/radar/15094721") !41 = !DISubroutineType(types: null) -!45 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "matrix", line: 35, scope: !39, file: !40, type: !4) +!45 = !DILocalVariable(name: "matrix", line: 35, scope: !39, file: !40, type: !4) diff --git a/test/DebugInfo/ARM/single-constant-use-preserves-dbgloc.ll b/test/DebugInfo/ARM/single-constant-use-preserves-dbgloc.ll index 396eb4fe1946..9bd7becb35b8 100644 --- a/test/DebugInfo/ARM/single-constant-use-preserves-dbgloc.ll +++ b/test/DebugInfo/ARM/single-constant-use-preserves-dbgloc.ll @@ -16,7 +16,7 @@ target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" target triple = "armv7--linux-gnueabihf" ; Function Attrs: nounwind -define i32 @main() { +define i32 @main() !dbg !4 { entry: %retval = alloca i32, align 4 %x = alloca i32, align 4 @@ -48,17 +48,17 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!8, !9} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !3) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !3) !1 = !DIFile(filename: "test.c", directory: "/home/user/clang/build") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, variables: !2) !5 = !DISubroutineType(types: !6) !6 = !{!7} !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !8 = !{i32 2, !"Dwarf Version", i32 4} !9 = !{i32 2, !"Debug Info Version", i32 3} -!10 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "x", scope: !4, file: !1, line: 3, type: !7) +!10 = !DILocalVariable(name: "x", scope: !4, file: !1, line: 3, type: !7) !11 = !DIExpression() !12 = !DILocation(line: 3, column: 9, scope: !4) !13 = !DILocation(line: 4, column: 9, scope: !14) diff --git a/test/DebugInfo/ARM/tls.ll b/test/DebugInfo/ARM/tls.ll index e349120b6075..4cb707ad4956 100644 --- a/test/DebugInfo/ARM/tls.ll +++ b/test/DebugInfo/ARM/tls.ll @@ -1,5 +1,8 @@ -; RUN: llc -O0 -filetype=asm -mtriple=armv7-linux-gnuehabi < %s | FileCheck %s -; +; RUN: llc -O0 -filetype=asm -mtriple=armv7-linux-gnuehabi < %s \ +; RUN: | FileCheck %s --check-prefix=CHECK +; RUN: llc -O0 -filetype=asm -mtriple=armv7-linux-gnuehabi -emulated-tls < %s \ +; RUN: | FileCheck %s --check-prefix=EMU + ; Generated with clang with source ; __thread int x; @@ -16,7 +19,10 @@ ; The debug relocation of the address of the tls variable ; CHECK: .long x(tlsldo) -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +; TODO: Add expected output for -emulated-tls tests. +; EMU-NOT: .long x(tlsldo) + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) !1 = !DIFile(filename: "tls.c", directory: "/tmp") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/COFF/asan-module-ctor.ll b/test/DebugInfo/COFF/asan-module-ctor.ll index 3f8b129ca9b6..f132eb425706 100644 --- a/test/DebugInfo/COFF/asan-module-ctor.ll +++ b/test/DebugInfo/COFF/asan-module-ctor.ll @@ -24,7 +24,7 @@ target triple = "i686-pc-win32" @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_ctor }] ; Function Attrs: nounwind sanitize_address -define i32 @foo() #0 { +define i32 @foo() #0 !dbg !4 { entry: ret i32 0, !dbg !10 } @@ -82,14 +82,14 @@ attributes #0 = { nounwind sanitize_address "less-precise-fpmad"="false" "no-fra !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "asan.c", directory: "D:\5C") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 ()* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "asan.c", directory: "D:C") !6 = !DISubroutineType(types: !2) -!7 = !{i32 2, !"Dwarf Version", i32 4} +!7 = !{i32 2, !"CodeView", i32 1} !8 = !{i32 1, !"Debug Info Version", i32 3} !9 = !{!"clang version 3.5.0 "} !10 = !DILocation(line: 2, scope: !4) diff --git a/test/DebugInfo/COFF/asan-module-without-functions.ll b/test/DebugInfo/COFF/asan-module-without-functions.ll index 88eec67a4bdb..fe337fb24769 100644 --- a/test/DebugInfo/COFF/asan-module-without-functions.ll +++ b/test/DebugInfo/COFF/asan-module-without-functions.ll @@ -45,9 +45,9 @@ define internal void @asan.module_dtor() { !llvm.module.flags = !{!3, !4} !llvm.ident = !{!5} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2) !1 = !DIFile(filename: "asan.c", directory: "D:\5C") !2 = !{} -!3 = !{i32 2, !"Dwarf Version", i32 4} +!3 = !{i32 2, !"CodeView", i32 1} !4 = !{i32 1, !"Debug Info Version", i32 3} !5 = !{!"clang version 3.5.0 "} diff --git a/test/DebugInfo/COFF/asm.ll b/test/DebugInfo/COFF/asm.ll index bc2a11d066b5..f3e52df54be0 100644 --- a/test/DebugInfo/COFF/asm.ll +++ b/test/DebugInfo/COFF/asm.ll @@ -1,7 +1,7 @@ ; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s -; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ32 %s +; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview | FileCheck --check-prefix=OBJ32 %s ; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -O0 < %s | FileCheck --check-prefix=X64 %s -; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ64 %s +; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview | FileCheck --check-prefix=OBJ64 %s ; This LL file was generated by running clang on the following code: ; D:\asm.c: @@ -19,7 +19,6 @@ ; X86: calll _g ; X86-NEXT: [[RETURN_STMT:.*]]: ; X86: ret -; X86-NEXT: L{{.*}}: ; X86-NEXT: [[END_OF_F:^L.*]]: ; ; X86-LABEL: .section .debug$S,"dr" @@ -95,6 +94,7 @@ ; OBJ32-NEXT: 0x44 IMAGE_REL_I386_SECREL _f ; OBJ32-NEXT: 0x48 IMAGE_REL_I386_SECTION _f ; OBJ32-NEXT: ] +; OBJ32: CodeViewDebugInfo [ ; OBJ32: Subsection [ ; OBJ32-NEXT: Type: 0xF1 ; OBJ32-NOT: ] @@ -125,20 +125,21 @@ ; OBJ32-NEXT: ColEnd: 0 ; OBJ32-NEXT: ] ; OBJ32-NEXT: ] -; OBJ32: } ; X64-LABEL: f: ; X64-NEXT: .L{{.*}}:{{$}} ; X64-NEXT: [[START:.*]]:{{$}} ; X64: # BB -; X64: subq $40, %rsp +; X64: pushq %rbp +; X64-NEXT: subq $32, %rsp +; X64-NEXT: leaq 32(%rsp), %rbp ; X64-NEXT: [[ASM_LINE:.*]]:{{$}} ; X64: [[CALL_LINE:.*]]:{{$}} ; X64: callq g ; X64-NEXT: [[EPILOG_AND_RET:.*]]: -; X64: addq $40, %rsp +; X64: addq $32, %rsp +; X64-NEXT: popq %rbp ; X64-NEXT: ret -; X64-NEXT: .L{{.*}}: ; X64-NEXT: [[END_OF_F:.*]]: ; ; X64-LABEL: .section .debug$S,"dr" @@ -224,22 +225,22 @@ ; OBJ64: ProcStart { ; OBJ64-NEXT: DisplayName: f ; OBJ64-NEXT: Section: f -; OBJ64-NEXT: CodeSize: 0xE +; OBJ64-NEXT: CodeSize: 0x17 ; OBJ64-NEXT: } ; OBJ64-NEXT: ProcEnd ; OBJ64-NEXT: ] ; OBJ64: FunctionLineTable [ ; OBJ64-NEXT: Name: f ; OBJ64-NEXT: Flags: 0x1 -; OBJ64-NEXT: CodeSize: 0xE +; OBJ64-NEXT: CodeSize: 0x17 ; OBJ64-NEXT: FilenameSegment [ ; OBJ64-NEXT: Filename: D:\asm.c ; OBJ64-NEXT: +0x0: 3 ; FIXME: An empty __asm stmt creates an extra entry. ; See PR18679 for the details. -; OBJ64-NEXT: +0x4: 4 -; OBJ64-NEXT: +0x4: 5 -; OBJ64-NEXT: +0x9: 6 +; OBJ64-NEXT: +0xA: 4 +; OBJ64-NEXT: +0xC: 5 +; OBJ64-NEXT: +0x11: 6 ; OBJ64-NEXT: ColStart: 0 ; OBJ64-NEXT: ColEnd: 0 ; OBJ64-NEXT: ColStart: 0 @@ -250,10 +251,9 @@ ; OBJ64-NEXT: ColEnd: 0 ; OBJ64-NEXT: ] ; OBJ64-NEXT: ] -; OBJ64: } ; Function Attrs: nounwind -define void @f() #0 { +define void @f() #0 !dbg !4 { entry: call void asm sideeffect inteldialect ".align 4", "~{dirflag},~{fpsr},~{flags}"() #2, !dbg !12 call void @g(), !dbg !13 @@ -270,16 +270,16 @@ attributes #2 = { nounwind } !llvm.module.flags = !{!9, !10} !llvm.ident = !{!11} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "<unknown>", directory: "D:\5C") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, function: void ()* @f, variables: !2) +!4 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !2) !5 = !DIFile(filename: "asm.c", directory: "D:\5C") !6 = !DIFile(filename: "asm.c", directory: "D:C") !7 = !DISubroutineType(types: !8) !8 = !{null} -!9 = !{i32 2, !"Dwarf Version", i32 4} +!9 = !{i32 2, !"CodeView", i32 1} !10 = !{i32 1, !"Debug Info Version", i32 3} !11 = !{!"clang version 3.5 "} !12 = !DILocation(line: 4, scope: !4) diff --git a/test/DebugInfo/COFF/cpp-mangling.ll b/test/DebugInfo/COFF/cpp-mangling.ll index 137377847aae..25461baa2266 100644 --- a/test/DebugInfo/COFF/cpp-mangling.ll +++ b/test/DebugInfo/COFF/cpp-mangling.ll @@ -29,15 +29,15 @@ attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"= !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "<stdin>", directory: "D:\5C") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "bar", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !5, scope: !6, type: !7, function: i32 (i32)* @"\01?bar@foo@@YAHH@Z", variables: !2) +!4 = distinct !DISubprogram(name: "bar", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !5, scope: !6, type: !7, variables: !2) !5 = !DIFile(filename: "src.cpp", directory: "D:\5C") !6 = !DIFile(filename: "src.cpp", directory: "D:C") !7 = !DISubroutineType(types: !2) -!8 = !{i32 2, !"Dwarf Version", i32 4} +!8 = !{i32 2, !"CodeView", i32 1} !9 = !{i32 2, !"Debug Info Version", i32 3} !10 = !{!"clang version 3.6.0 "} !11 = !DILocation(line: 3, scope: !4) diff --git a/test/DebugInfo/COFF/multifile.ll b/test/DebugInfo/COFF/multifile.ll index 3dedacebc140..70bc0022cfb2 100644 --- a/test/DebugInfo/COFF/multifile.ll +++ b/test/DebugInfo/COFF/multifile.ll @@ -26,7 +26,6 @@ ; X86: calll _g ; X86-NEXT: [[RETURN_STMT:.*]]: ; X86: ret -; X86-NEXT: L{{.*}}: ; X86-NEXT: [[END_OF_F:.*]]: ; ; X86-LABEL: .section .debug$S,"dr" @@ -158,7 +157,6 @@ ; OBJ32-NEXT: ColEnd: 0 ; OBJ32-NEXT: ] ; OBJ32-NEXT: ] -; OBJ32: } ; X64-LABEL: f: ; X64-NEXT: .L{{.*}}:{{$}} @@ -174,7 +172,6 @@ ; X64-NEXT: [[EPILOG_AND_RET:.*]]: ; X64: addq $40, %rsp ; X64-NEXT: ret -; X64-NEXT: .L{{.*}}: ; X64-NEXT: [[END_OF_F:.*]]: ; ; X64-LABEL: .section .debug$S,"dr" @@ -326,10 +323,9 @@ ; OBJ64-NEXT: ColEnd: 0 ; OBJ64-NEXT: ] ; OBJ64-NEXT: ] -; OBJ64: } ; Function Attrs: nounwind -define void @f() #0 { +define void @f() #0 !dbg !4 { entry: call void @g(), !dbg !12 call void @g(), !dbg !15 @@ -346,16 +342,16 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" " !llvm.module.flags = !{!9, !10} !llvm.ident = !{!11} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "<unknown>", directory: "D:\5C") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, function: void ()* @f, variables: !2) +!4 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !2) !5 = !DIFile(filename: "input.c", directory: "D:\5C") !6 = !DIFile(filename: "input.c", directory: "D:C") !7 = !DISubroutineType(types: !8) !8 = !{null} -!9 = !{i32 2, !"Dwarf Version", i32 4} +!9 = !{i32 2, !"CodeView", i32 1} !10 = !{i32 1, !"Debug Info Version", i32 3} !11 = !{!"clang version 3.5 "} !12 = !DILocation(line: 1, scope: !13) diff --git a/test/DebugInfo/COFF/multifunction.ll b/test/DebugInfo/COFF/multifunction.ll index bbf97dd4afc0..4c044fa9c4fa 100644 --- a/test/DebugInfo/COFF/multifunction.ll +++ b/test/DebugInfo/COFF/multifunction.ll @@ -28,7 +28,6 @@ ; X86: calll _z ; X86-NEXT: [[X_RETURN:.*]]: ; X86: ret -; X86-NEXT: L{{.*}}: ; X86-NEXT: [[END_OF_X:.*]]: ; ; X86-LABEL: _y: @@ -37,7 +36,6 @@ ; X86: calll _z ; X86-NEXT: [[Y_RETURN:.*]]: ; X86: ret -; X86-NEXT: L{{.*}}: ; X86-NEXT: [[END_OF_Y:.*]]: ; ; X86-LABEL: _f: @@ -50,7 +48,6 @@ ; X86: calll _z ; X86-NEXT: [[F_RETURN:.*]]: ; X86: ret -; X86-NEXT: L{{.*}}: ; X86-NEXT: [[END_OF_F:.*]]: ; ; X86-LABEL: .section .debug$S,"dr" @@ -310,7 +307,6 @@ ; OBJ32-NEXT: ColEnd: 73 ; OBJ32-NEXT: ] ; OBJ32-NEXT: ] -; OBJ32: } ; X64-LABEL: x: ; X64-NEXT: .L{{.*}}: @@ -322,7 +318,6 @@ ; X64-NEXT: [[X_EPILOG_AND_RET:.*]]: ; X64: addq $40, %rsp ; X64-NEXT: ret -; X64-NEXT: .L{{.*}}: ; X64-NEXT: [[END_OF_X:.*]]: ; ; X64-LABEL: y: @@ -335,7 +330,6 @@ ; X64-NEXT: [[Y_EPILOG_AND_RET:.*]]: ; X64: addq $40, %rsp ; X64-NEXT: ret -; X64-NEXT: .L{{.*}}: ; X64-NEXT: [[END_OF_Y:.*]]: ; ; X64-LABEL: f: @@ -352,7 +346,6 @@ ; X64-NEXT: [[F_EPILOG_AND_RET:.*]]: ; X64: addq $40, %rsp ; X64-NEXT: ret -; X64-NEXT: .L{{.*}}: ; X64-NEXT: [[END_OF_F:.*]]: ; ; X64-LABEL: .section .debug$S,"dr" @@ -633,10 +626,9 @@ ; OBJ64-NEXT: ColEnd: 73 ; OBJ64-NEXT: ] ; OBJ64-NEXT: ] -; OBJ64: } ; Function Attrs: nounwind -define void @x() #0 { +define void @x() #0 !dbg !4 { entry: call void @z(), !dbg !14 ret void, !dbg !15 @@ -645,14 +637,14 @@ entry: declare void @z() #1 ; Function Attrs: nounwind -define void @y() #0 { +define void @y() #0 !dbg !9 { entry: call void @z(), !dbg !16 ret void, !dbg !17 } ; Function Attrs: nounwind -define void @f() #0 { +define void @f() #0 !dbg !10 { entry: call void @x(), !dbg !18 call void @y(), !dbg !19 @@ -667,18 +659,18 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" " !llvm.module.flags = !{!11, !12} !llvm.ident = !{!13} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "<unknown>", directory: "D:\5C") !2 = !{} !3 = !{!4, !9, !10} -!4 = !DISubprogram(name: "x", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, function: void ()* @x, variables: !2) +!4 = distinct !DISubprogram(name: "x", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !2) !5 = !DIFile(filename: "source.c", directory: "D:\5C") !6 = !DIFile(filename: "source.c", directory: "D:C") !7 = !DISubroutineType(types: !8) !8 = !{null} -!9 = !DISubprogram(name: "y", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !5, scope: !6, type: !7, function: void ()* @y, variables: !2) -!10 = !DISubprogram(name: "f", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 11, file: !5, scope: !6, type: !7, function: void ()* @f, variables: !2) -!11 = !{i32 2, !"Dwarf Version", i32 4} +!9 = distinct !DISubprogram(name: "y", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !5, scope: !6, type: !7, variables: !2) +!10 = distinct !DISubprogram(name: "f", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 11, file: !5, scope: !6, type: !7, variables: !2) +!11 = !{i32 2, !"CodeView", i32 1} !12 = !{i32 1, !"Debug Info Version", i32 3} !13 = !{!"clang version 3.5 "} !14 = !DILocation(line: 4, column: 42, scope: !4) diff --git a/test/DebugInfo/COFF/simple.ll b/test/DebugInfo/COFF/simple.ll index 0d9857c7831d..2103df07f6dc 100644 --- a/test/DebugInfo/COFF/simple.ll +++ b/test/DebugInfo/COFF/simple.ll @@ -17,7 +17,6 @@ ; X86: calll _g ; X86-NEXT: [[RETURN_STMT:.*]]: ; X86: ret -; X86-NEXT: L{{.*}}: ; X86-NEXT: [[END_OF_F:.*]]: ; ; X86-LABEL: .section .debug$S,"dr" @@ -113,7 +112,6 @@ ; OBJ32-NEXT: ColEnd: 0 ; OBJ32-NEXT: ] ; OBJ32-NEXT: ] -; OBJ32: } ; X64-LABEL: f: ; X64-NEXT: .L{{.*}}:{{$}} @@ -125,7 +123,6 @@ ; X64-NEXT: [[EPILOG_AND_RET:.*]]: ; X64: addq $40, %rsp ; X64-NEXT: ret -; X64-NEXT: .L{{.*}}: ; X64-NEXT: [[END_OF_F:.*]]: ; ; X64-LABEL: .section .debug$S,"dr" @@ -228,10 +225,9 @@ ; OBJ64-NEXT: ColEnd: 0 ; OBJ64-NEXT: ] ; OBJ64-NEXT: ] -; OBJ64: } ; Function Attrs: nounwind -define void @f() #0 { +define void @f() #0 !dbg !4 { entry: call void @g(), !dbg !12 ret void, !dbg !13 @@ -246,16 +242,16 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" " !llvm.module.flags = !{!9, !10} !llvm.ident = !{!11} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "<unknown>", directory: "D:\5C") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, function: void ()* @f, variables: !2) +!4 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !2) !5 = !DIFile(filename: "test.c", directory: "D:\5C") !6 = !DIFile(filename: "test.c", directory: "D:C") !7 = !DISubroutineType(types: !8) !8 = !{null} -!9 = !{i32 2, !"Dwarf Version", i32 4} +!9 = !{i32 2, !"CodeView", i32 1} !10 = !{i32 1, !"Debug Info Version", i32 3} !11 = !{!"clang version 3.5 "} !12 = !DILocation(line: 4, scope: !4) diff --git a/test/DebugInfo/COFF/tail-call-without-lexical-scopes.ll b/test/DebugInfo/COFF/tail-call-without-lexical-scopes.ll index 054a2e89a8fb..28b8d2859efa 100644 --- a/test/DebugInfo/COFF/tail-call-without-lexical-scopes.ll +++ b/test/DebugInfo/COFF/tail-call-without-lexical-scopes.ll @@ -62,15 +62,15 @@ attributes #2 = { nounwind } !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "test.cpp", directory: "D:\5C") !2 = !{} !3 = !{!4, !7} -!4 = !DISubprogram(name: "spam", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 7, file: !1, scope: !5, type: !6, function: void ()* @"\01?spam@@YAXXZ", variables: !2) +!4 = distinct !DISubprogram(name: "spam", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 7, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "test.cpp", directory: "D:C") !6 = !DISubroutineType(types: !2) -!7 = !DISubprogram(name: "bar", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) -!8 = !{i32 2, !"Dwarf Version", i32 4} +!7 = distinct !DISubprogram(name: "bar", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) +!8 = !{i32 2, !"CodeView", i32 1} !9 = !{i32 1, !"Debug Info Version", i32 3} !10 = !{!"clang version 3.5.0 "} !11 = !DILocation(line: 8, scope: !4) diff --git a/test/DebugInfo/2009-10-16-Phi.ll b/test/DebugInfo/Generic/2009-10-16-Phi.ll index e14653f6fcf2..e14653f6fcf2 100644 --- a/test/DebugInfo/2009-10-16-Phi.ll +++ b/test/DebugInfo/Generic/2009-10-16-Phi.ll diff --git a/test/DebugInfo/2009-11-03-InsertExtractValue.ll b/test/DebugInfo/Generic/2009-11-03-InsertExtractValue.ll index f8382af3abc7..c992a43c858c 100644 --- a/test/DebugInfo/2009-11-03-InsertExtractValue.ll +++ b/test/DebugInfo/Generic/2009-11-03-InsertExtractValue.ll @@ -9,7 +9,7 @@ !2 = !DISubroutineType(types: !3) !3 = !{null} !4 = !DIFile(filename: "/foo", directory: "bar.cpp") -!5 = !DICompileUnit(language: DW_LANG_C99, isOptimized: true, emissionKind: 0, file: !4, enums: !{}, retainedTypes: !{}) +!5 = distinct !DICompileUnit(language: DW_LANG_C99, isOptimized: true, emissionKind: 0, file: !4, enums: !{}, retainedTypes: !{}) define <{i32, i32}> @f1() { ; CHECK: !dbgx ![[NUMBER:[0-9]+]] diff --git a/test/DebugInfo/2009-11-05-DeadGlobalVariable.ll b/test/DebugInfo/Generic/2009-11-05-DeadGlobalVariable.ll index 32d4c0ac6c39..40dacf8848b2 100644 --- a/test/DebugInfo/2009-11-05-DeadGlobalVariable.ll +++ b/test/DebugInfo/Generic/2009-11-05-DeadGlobalVariable.ll @@ -2,7 +2,7 @@ ; Here variable bar is optimized away. Do not trip over while trying to generate debug info. -define i32 @foo() nounwind uwtable readnone ssp { +define i32 @foo() nounwind uwtable readnone ssp !dbg !5 { entry: ret i32 42, !dbg !15 } @@ -10,10 +10,10 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!18} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: 0, file: !17, enums: !1, retainedTypes: !1, subprograms: !3, globals: !12) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: 0, file: !17, enums: !1, retainedTypes: !1, subprograms: !3, globals: !12) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !17, scope: !6, type: !7, function: i32 ()* @foo) +!5 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !17, scope: !6, type: !7) !6 = !DIFile(filename: "fb.c", directory: "/private/tmp") !7 = !DISubroutineType(types: !8) !8 = !{!9} diff --git a/test/DebugInfo/2009-11-06-NamelessGlobalVariable.ll b/test/DebugInfo/Generic/2009-11-06-NamelessGlobalVariable.ll index 79f949b438f8..a871a257cc8b 100644 --- a/test/DebugInfo/2009-11-06-NamelessGlobalVariable.ll +++ b/test/DebugInfo/Generic/2009-11-06-NamelessGlobalVariable.ll @@ -4,7 +4,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!9} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: 0, file: !8, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: 0, file: !8, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3) !2 = !{} !3 = !{!5} !5 = !DIGlobalVariable(name: "a", line: 2, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i32* @0) diff --git a/test/DebugInfo/2009-11-10-CurrentFn.ll b/test/DebugInfo/Generic/2009-11-10-CurrentFn.ll index 228edec93c42..b0961135ebf0 100644 --- a/test/DebugInfo/2009-11-10-CurrentFn.ll +++ b/test/DebugInfo/Generic/2009-11-10-CurrentFn.ll @@ -1,6 +1,6 @@ ; RUN: llc < %s -o /dev/null -define void @bar(i32 %i) nounwind uwtable ssp { +define void @bar(i32 %i) nounwind uwtable ssp !dbg !5 { entry: tail call void (...) @foo() nounwind, !dbg !14 ret void, !dbg !16 @@ -13,15 +13,15 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!18} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: 0, file: !17, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 139632)", isOptimized: true, emissionKind: 0, file: !17, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "bar", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !17, scope: !6, type: !7, function: void (i32)* @bar, variables: !9) +!5 = distinct !DISubprogram(name: "bar", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !17, scope: !6, type: !7, variables: !9) !6 = !DIFile(filename: "cf.c", directory: "/private/tmp") !7 = !DISubroutineType(types: !8) !8 = !{null} !9 = !{!11} -!11 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 3, arg: 1, scope: !5, file: !17, type: !12) +!11 = !DILocalVariable(name: "i", line: 3, arg: 1, scope: !5, file: !17, type: !12) !12 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !13 = !DILocation(line: 3, column: 14, scope: !5) !14 = !DILocation(line: 4, column: 3, scope: !15) diff --git a/test/DebugInfo/2010-01-05-DbgScope.ll b/test/DebugInfo/Generic/2010-01-05-DbgScope.ll index d5baa1984227..c6d7ca85847f 100644 --- a/test/DebugInfo/2010-01-05-DbgScope.ll +++ b/test/DebugInfo/Generic/2010-01-05-DbgScope.ll @@ -13,8 +13,8 @@ entry: !0 = !DILocation(line: 571, column: 3, scope: !1) !1 = distinct !DILexicalBlock(line: 1, column: 1, file: !11, scope: !2) -!2 = !DISubprogram(name: "foo", linkageName: "foo", line: 561, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !3, type: !4) -!3 = !DICompileUnit(language: DW_LANG_C99, producer: "clang 1.1", isOptimized: true, emissionKind: 0, file: !11, enums: !12, retainedTypes: !12, subprograms: !13) +!2 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 561, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !3, type: !4) +!3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang 1.1", isOptimized: true, emissionKind: 0, file: !11, enums: !12, retainedTypes: !12, subprograms: !13) !4 = !DISubroutineType(types: !5) !5 = !{!6} !6 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) diff --git a/test/DebugInfo/2010-03-12-llc-crash.ll b/test/DebugInfo/Generic/2010-03-12-llc-crash.ll index 60e657ce5ce6..aaa013c803f5 100644 --- a/test/DebugInfo/2010-03-12-llc-crash.ll +++ b/test/DebugInfo/Generic/2010-03-12-llc-crash.ll @@ -1,5 +1,5 @@ ; RUN: llc -O0 < %s -o /dev/null -; llc should not crash on this invalid input. +; llc should not crash on this optimized out debug info. ; PR6588 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone @@ -9,10 +9,10 @@ entry: ret void } -!0 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "sy", line: 890, arg: 0, scope: !1, file: !2, type: !7) -!1 = !DISubprogram(name: "foo", linkageName: "foo", line: 892, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !8, scope: !3, type: !4) +!0 = !DILocalVariable(name: "sy", line: 890, arg: 1, scope: !1, file: !2, type: !7) +!1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 892, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !8, scope: !3, type: !4) !2 = !DIFile(filename: "qpainter.h", directory: "QtGui") -!3 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang 1.1", isOptimized: true, emissionKind: 0, file: !9, enums: !10, retainedTypes: !10) +!3 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang 1.1", isOptimized: true, emissionKind: 0, file: !9, enums: !10, retainedTypes: !10) !4 = !DISubroutineType(types: !6) !5 = !DIFile(filename: "splineeditor.cpp", directory: "src") !6 = !{null} diff --git a/test/DebugInfo/2010-03-19-DbgDeclare.ll b/test/DebugInfo/Generic/2010-03-19-DbgDeclare.ll index 40d96e1d443e..fe7eaebc4ed5 100644 --- a/test/DebugInfo/2010-03-19-DbgDeclare.ll +++ b/test/DebugInfo/Generic/2010-03-19-DbgDeclare.ll @@ -9,12 +9,12 @@ entry: } !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!5} -!2 = !DICompileUnit(language: DW_LANG_Mips_Assembler, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 1, file: !4, enums: !3, retainedTypes: !3, subprograms: !3, globals: !3, imports: !3) +!2 = distinct !DICompileUnit(language: DW_LANG_Mips_Assembler, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 1, file: !4, enums: !3, retainedTypes: !3, subprograms: !3, globals: !3, imports: !3) !3 = !{} !0 = !DILocation(line: 662302, column: 26, scope: !1) -!1 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "foo", scope: !6) +!1 = !DILocalVariable(name: "foo", scope: !6) !4 = !DIFile(filename: "scratch.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch") -!6 = !DISubprogram() +!6 = distinct !DISubprogram() declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !5 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/2010-03-24-MemberFn.ll b/test/DebugInfo/Generic/2010-03-24-MemberFn.ll index 627364ea4f00..5f63ce295fad 100644 --- a/test/DebugInfo/2010-03-24-MemberFn.ll +++ b/test/DebugInfo/Generic/2010-03-24-MemberFn.ll @@ -2,7 +2,7 @@ ; Here _ZN1S3fooEv is defined in header file identified as AT_decl_file no. 2 in debug info. %struct.S = type <{ i8 }> -define i32 @_Z3barv() nounwind ssp { +define i32 @_Z3barv() nounwind ssp !dbg !3 { entry: %retval = alloca i32 ; <i32*> [#uses=2] %0 = alloca i32 ; <i32*> [#uses=2] @@ -20,7 +20,7 @@ return: ; preds = %entry ret i32 %retval1, !dbg !16 } -define linkonce_odr i32 @_ZN1S3fooEv(%struct.S* %this) nounwind ssp align 2 { +define linkonce_odr i32 @_ZN1S3fooEv(%struct.S* %this) nounwind ssp align 2 !dbg !12 { entry: %this_addr = alloca %struct.S* ; <%struct.S**> [#uses=1] %retval = alloca i32 ; <i32*> [#uses=1] @@ -39,25 +39,25 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!5} !llvm.module.flags = !{!28} -!0 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "s1", line: 3, scope: !1, file: !4, type: !9) +!0 = !DILocalVariable(name: "s1", line: 3, scope: !1, file: !4, type: !9) !1 = distinct !DILexicalBlock(line: 3, column: 0, file: !25, scope: !2) !2 = distinct !DILexicalBlock(line: 3, column: 0, file: !25, scope: !3) -!3 = !DISubprogram(name: "bar", linkageName: "_Z3barv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 3, file: !25, scope: !4, type: !6, function: i32 ()* @_Z3barv) +!3 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 3, file: !25, scope: !4, type: !6) !4 = !DIFile(filename: "one.cc", directory: "/tmp/") -!5 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !25, enums: !27, retainedTypes: !27, subprograms: !24, imports: null) +!5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !25, enums: !27, retainedTypes: !27, subprograms: !24, imports: null) !6 = !DISubroutineType(types: !7) !7 = !{!8} !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !9 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", line: 2, size: 8, align: 8, file: !26, scope: !4, elements: !11) !10 = !DIFile(filename: "one.h", directory: "/tmp/") !11 = !{!12} -!12 = !DISubprogram(name: "foo", linkageName: "_ZN1S3fooEv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 3, file: !26, scope: !9, type: !13, function: i32 (%struct.S*)* @_ZN1S3fooEv) +!12 = distinct !DISubprogram(name: "foo", linkageName: "_ZN1S3fooEv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 3, file: !26, scope: !9, type: !13) !13 = !DISubroutineType(types: !14) !14 = !{!8, !15} !15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !25, scope: !4, baseType: !9) !16 = !DILocation(line: 3, scope: !1) !17 = !DILocation(line: 3, scope: !3) -!18 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 3, arg: 0, scope: !12, file: !10, type: !19) +!18 = !DILocalVariable(name: "this", line: 3, arg: 1, scope: !12, file: !10, type: !19) !19 = !DIDerivedType(tag: DW_TAG_const_type, size: 64, align: 64, flags: DIFlagArtificial, file: !25, scope: !4, baseType: !20) !20 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !25, scope: !4, baseType: !9) !21 = !DILocation(line: 3, scope: !12) diff --git a/test/DebugInfo/2010-04-06-NestedFnDbgInfo.ll b/test/DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll index 45ed4962f7b4..a85ad9adcf7d 100644 --- a/test/DebugInfo/2010-04-06-NestedFnDbgInfo.ll +++ b/test/DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll @@ -13,7 +13,7 @@ ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_low_pc ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_linkage_name {{.*}} "_ZZN1B2fnEvEN1A3fooEv" +; CHECK: DW_AT_name {{.*}} "foo" ; And just double check that there's no out of line definition that references ; this subprogram. ; CHECK-NOT: DW_AT_specification {{.*}} {[[FOO_INL]]} @@ -21,7 +21,7 @@ %class.A = type { i8 } %class.B = type { i8 } -define i32 @main() ssp { +define i32 @main() ssp !dbg !2 { entry: %retval = alloca i32, align 4 ; <i32*> [#uses=3] %b = alloca %class.A, align 1 ; <%class.A*> [#uses=1] @@ -35,7 +35,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone -define linkonce_odr i32 @_ZN1B2fnEv(%class.A* %this) ssp align 2 { +define linkonce_odr i32 @_ZN1B2fnEv(%class.A* %this) ssp align 2 !dbg !10 { entry: %retval = alloca i32, align 4 ; <i32*> [#uses=2] %this.addr = alloca %class.A*, align 8 ; <%class.A**> [#uses=2] @@ -54,7 +54,7 @@ entry: ret i32 %0, !dbg !32 } -define internal i32 @_ZZN1B2fnEvEN1A3fooEv(%class.A* %this) ssp align 2 { +define internal i32 @_ZZN1B2fnEvEN1A3fooEv(%class.A* %this) ssp align 2 !dbg !23 { entry: %retval = alloca i32, align 4 ; <i32*> [#uses=2] %this.addr = alloca %class.A*, align 8 ; <%class.A**> [#uses=2] @@ -70,40 +70,40 @@ entry: !llvm.module.flags = !{!40} !37 = !{!2, !10, !23} -!0 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "b", line: 16, scope: !1, file: !3, type: !8) +!0 = !DILocalVariable(name: "b", line: 16, scope: !1, file: !3, type: !8) !1 = distinct !DILexicalBlock(line: 15, column: 12, file: !38, scope: !2) -!2 = !DISubprogram(name: "main", linkageName: "main", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 15, file: !38, scope: !3, type: !5, function: i32 ()* @main) +!2 = distinct !DISubprogram(name: "main", linkageName: "main", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 15, file: !38, scope: !3, type: !5) !3 = !DIFile(filename: "one.cc", directory: "/tmp") -!4 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang 1.5", isOptimized: false, emissionKind: 0, file: !38, enums: !39, retainedTypes: !39, subprograms: !37, imports: null) +!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang 1.5", isOptimized: false, emissionKind: 0, file: !38, enums: !39, retainedTypes: !39, subprograms: !37, imports: null) !5 = !DISubroutineType(types: !6) !6 = !{!7} !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !8 = !DICompositeType(tag: DW_TAG_class_type, name: "B", line: 2, size: 8, align: 8, file: !38, scope: !3, elements: !9) !9 = !{!10} -!10 = !DISubprogram(name: "fn", linkageName: "_ZN1B2fnEv", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 4, file: !38, scope: !8, type: !11, function: i32 (%class.A*)* @_ZN1B2fnEv) +!10 = distinct !DISubprogram(name: "fn", linkageName: "_ZN1B2fnEv", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 4, file: !38, scope: !8, type: !11) !11 = !DISubroutineType(types: !12) !12 = !{!7, !13} !13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !38, scope: !3, baseType: !8) !14 = !DILocation(line: 16, column: 5, scope: !1) !15 = !DILocation(line: 17, column: 3, scope: !1) !16 = !DILocation(line: 18, column: 1, scope: !2) -!17 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 4, arg: 0, scope: !10, file: !3, type: !13) +!17 = !DILocalVariable(name: "this", line: 4, arg: 1, scope: !10, file: !3, type: !13) !18 = !DILocation(line: 4, column: 7, scope: !10) -!19 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 9, scope: !20, file: !3, type: !21) +!19 = !DILocalVariable(name: "a", line: 9, scope: !20, file: !3, type: !21) !20 = distinct !DILexicalBlock(line: 4, column: 12, file: !38, scope: !10) !21 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 5, size: 8, align: 8, file: !38, scope: !10, elements: !22) !22 = !{!23} -!23 = !DISubprogram(name: "foo", linkageName: "_ZZN1B2fnEvEN1A3fooEv", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !38, scope: !21, type: !24, function: i32 (%class.A*)* @_ZZN1B2fnEvEN1A3fooEv) +!23 = distinct !DISubprogram(name: "foo", linkageName: "_ZZN1B2fnEvEN1A3fooEv", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !38, scope: !21, type: !24) !24 = !DISubroutineType(types: !25) !25 = !{!7, !26} !26 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !38, scope: !3, baseType: !21) !27 = !DILocation(line: 9, column: 7, scope: !20) -!28 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 10, scope: !20, file: !3, type: !7) +!28 = !DILocalVariable(name: "i", line: 10, scope: !20, file: !3, type: !7) !29 = !DILocation(line: 10, column: 9, scope: !20) !30 = !DILocation(line: 10, column: 5, scope: !20) !31 = !DILocation(line: 11, column: 5, scope: !20) !32 = !DILocation(line: 12, column: 3, scope: !10) -!33 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 7, arg: 0, scope: !23, file: !3, type: !26) +!33 = !DILocalVariable(name: "this", line: 7, arg: 1, scope: !23, file: !3, type: !26) !34 = !DILocation(line: 7, column: 11, scope: !23) !35 = !DILocation(line: 7, column: 19, scope: !36) !36 = distinct !DILexicalBlock(line: 7, column: 17, file: !38, scope: !23) diff --git a/test/DebugInfo/2010-04-19-FramePtr.ll b/test/DebugInfo/Generic/2010-04-19-FramePtr.ll index ed6a4fdb54e1..3b7280028c01 100644 --- a/test/DebugInfo/2010-04-19-FramePtr.ll +++ b/test/DebugInfo/Generic/2010-04-19-FramePtr.ll @@ -4,7 +4,7 @@ ; RUN: grep -v DW_AT_APPLE_omit_frame_ptr %t -define i32 @foo() nounwind ssp { +define i32 @foo() nounwind ssp !dbg !1 { entry: %retval = alloca i32 ; <i32*> [#uses=2] %0 = alloca i32 ; <i32*> [#uses=2] @@ -24,9 +24,9 @@ return: ; preds = %entry !9 = !{!1} !0 = !DILocation(line: 2, scope: !1) -!1 = !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !10, scope: null, type: !4, function: i32 ()* @foo) +!1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !10, scope: null, type: !4) !2 = !DIFile(filename: "a.c", directory: "/tmp") -!3 = !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !10, enums: !11, retainedTypes: !11, subprograms: !9, imports: null) +!3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !10, enums: !11, retainedTypes: !11, subprograms: !9, imports: null) !4 = !DISubroutineType(types: !5) !5 = !{!6} !6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/2010-05-03-DisableFramePtr.ll b/test/DebugInfo/Generic/2010-05-03-DisableFramePtr.ll index 660e9dba498b..c67ed73dac6c 100644 --- a/test/DebugInfo/2010-05-03-DisableFramePtr.ll +++ b/test/DebugInfo/Generic/2010-05-03-DisableFramePtr.ll @@ -18,10 +18,10 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!3} !llvm.module.flags = !{!19} -!0 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "userUPP", line: 7, arg: 0, scope: !1, file: !2, type: !6) -!1 = !DISubprogram(name: "DisposeDMNotificationUPP", linkageName: "DisposeDMNotificationUPP", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !16, scope: null, type: !4) +!0 = !DILocalVariable(name: "userUPP", line: 7, arg: 1, scope: !1, file: !2, type: !6) +!1 = distinct !DISubprogram(name: "DisposeDMNotificationUPP", linkageName: "DisposeDMNotificationUPP", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !16, scope: null, type: !4) !2 = !DIFile(filename: "t.c", directory: "/Users/echeng/LLVM/radars/r7937664/") -!3 = !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 9999)", isOptimized: true, emissionKind: 0, file: !16, enums: !17, retainedTypes: !17, subprograms: !18) +!3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 9999)", isOptimized: true, emissionKind: 0, file: !16, enums: !17, retainedTypes: !17, subprograms: !18) !4 = !DISubroutineType(types: !5) !5 = !{null, !6} !6 = !DIDerivedType(tag: DW_TAG_typedef, name: "DMNotificationUPP", line: 6, file: !16, scope: !2, baseType: !7) diff --git a/test/DebugInfo/2010-05-03-OriginDIE.ll b/test/DebugInfo/Generic/2010-05-03-OriginDIE.ll index da1e57caba14..9ebfb06cc5e3 100644 --- a/test/DebugInfo/2010-05-03-OriginDIE.ll +++ b/test/DebugInfo/Generic/2010-05-03-OriginDIE.ll @@ -52,28 +52,28 @@ declare void @uuid_LtoB(i8*, i8*) !llvm.module.flags = !{!41} !0 = !DILocation(line: 808, scope: !1) !1 = distinct !DILexicalBlock(line: 807, column: 0, file: !39, scope: !2) -!2 = !DISubprogram(name: "gpt2gpm", linkageName: "gpt2gpm", line: 807, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !39, scope: null, type: !5) +!2 = distinct !DISubprogram(name: "gpt2gpm", linkageName: "gpt2gpm", line: 807, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !39, scope: null, type: !5) !3 = !DIFile(filename: "G.c", directory: "/tmp") -!4 = !DICompileUnit(language: DW_LANG_C89, producer: "llvm-gcc", isOptimized: true, emissionKind: 0, file: !39, enums: !18, retainedTypes: !18, subprograms: !40) +!4 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "llvm-gcc", isOptimized: true, emissionKind: 0, file: !39, enums: !18, retainedTypes: !18, subprograms: !40) !5 = !DISubroutineType(types: !6) !6 = !{null} !7 = !DILocation(line: 810, scope: !1) -!8 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "data", line: 201, arg: 0, scope: !9, file: !10, type: !11) -!9 = !DISubprogram(name: "_OSSwapInt64", linkageName: "_OSSwapInt64", line: 202, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !10, scope: null, type: !5) +!8 = !DILocalVariable(name: "data", line: 201, arg: 1, scope: !9, file: !10, type: !11) +!9 = distinct !DISubprogram(name: "_OSSwapInt64", linkageName: "_OSSwapInt64", line: 202, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !10, scope: null, type: !5) !10 = !DIFile(filename: "OSByteOrder.h", directory: "/usr/include/libkern/ppc") !11 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint64_t", line: 59, file: !36, scope: !3, baseType: !13) !12 = !DIFile(filename: "stdint.h", directory: "/usr/4.2.1/include") !13 = !DIBasicType(tag: DW_TAG_base_type, name: "long long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned) !14 = !DILocation(line: 202, scope: !9, inlinedAt: !7) -!15 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "base", line: 92, arg: 0, scope: !16, file: !10, type: !17) -!16 = !DISubprogram(name: "OSReadSwapInt64", linkageName: "OSReadSwapInt64", line: 95, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !38, scope: null, type: !5) +!15 = !DILocalVariable(name: "base", line: 92, arg: 2, scope: !16, file: !10, type: !17) +!16 = distinct !DISubprogram(name: "OSReadSwapInt64", linkageName: "OSReadSwapInt64", line: 95, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !38, scope: null, type: !5) !17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !39, scope: !3, baseType: null) !18 = !{} -!19 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "byteOffset", line: 94, arg: 0, scope: !16, file: !10, type: !20) +!19 = !DILocalVariable(name: "byteOffset", line: 94, arg: 3, scope: !16, file: !10, type: !20) !20 = !DIDerivedType(tag: DW_TAG_typedef, name: "uintptr_t", line: 114, file: !37, scope: !3, baseType: !22) !21 = !DIFile(filename: "types.h", directory: "/usr/include/ppc") !22 = !DIBasicType(tag: DW_TAG_base_type, name: "long unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) -!23 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "u", line: 100, scope: !24, file: !10, type: !25) +!23 = !DILocalVariable(name: "u", line: 100, scope: !24, file: !10, type: !25) !24 = distinct !DILexicalBlock(line: 95, column: 0, file: !38, scope: !16) !25 = !DICompositeType(tag: DW_TAG_union_type, line: 97, size: 64, align: 64, file: !38, scope: !16, elements: !26) !26 = !{!27, !28} @@ -84,7 +84,7 @@ declare void @uuid_LtoB(i8*, i8*) !31 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) !32 = !{!33} !33 = !DISubrange(count: 2) -!34 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "addr", line: 96, scope: !24, file: !10, type: !35) +!34 = !DILocalVariable(name: "addr", line: 96, scope: !24, file: !10, type: !35) !35 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !39, scope: !3, baseType: !11) !36 = !DIFile(filename: "stdint.h", directory: "/usr/4.2.1/include") !37 = !DIFile(filename: "types.h", directory: "/usr/include/ppc") diff --git a/test/DebugInfo/2010-05-10-MultipleCU.ll b/test/DebugInfo/Generic/2010-05-10-MultipleCU.ll index 6513165ac248..486dbf0e940c 100644 --- a/test/DebugInfo/2010-05-10-MultipleCU.ll +++ b/test/DebugInfo/Generic/2010-05-10-MultipleCU.ll @@ -7,12 +7,12 @@ ; CHECK: Compile Unit: ; CHECK: Compile Unit: -define i32 @foo() nounwind readnone ssp { +define i32 @foo() nounwind readnone ssp !dbg !2 { return: ret i32 42, !dbg !0 } -define i32 @bar() nounwind readnone ssp { +define i32 @bar() nounwind readnone ssp !dbg !10 { return: ret i32 21, !dbg !8 } @@ -24,17 +24,17 @@ return: !0 = !DILocation(line: 3, scope: !1) !1 = distinct !DILexicalBlock(line: 2, column: 0, file: !18, scope: !2) -!2 = !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !18, scope: !3, type: !5, function: i32 ()* @foo) +!2 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !18, scope: !3, type: !5) !3 = !DIFile(filename: "a.c", directory: "/tmp/") -!4 = !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !18, enums: !19, retainedTypes: !19, subprograms: !16) +!4 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !18, enums: !19, retainedTypes: !19, subprograms: !16) !5 = !DISubroutineType(types: !6) !6 = !{!7} !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !8 = !DILocation(line: 3, scope: !9) !9 = distinct !DILexicalBlock(line: 2, column: 0, file: !20, scope: !10) -!10 = !DISubprogram(name: "bar", linkageName: "bar", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !20, scope: !11, type: !13, function: i32 ()* @bar) +!10 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !20, scope: !11, type: !13) !11 = !DIFile(filename: "b.c", directory: "/tmp/") -!12 = !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !20, enums: !19, retainedTypes: !19, subprograms: !17) +!12 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !20, enums: !19, retainedTypes: !19, subprograms: !17) !13 = !DISubroutineType(types: !14) !14 = !{!15} !15 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll b/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll index 27a0535bc8c3..f01cf6db905c 100644 --- a/test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll +++ b/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll @@ -12,7 +12,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone -define i32 @bar() nounwind ssp { +define i32 @bar() nounwind ssp !dbg !6 { entry: %0 = load i32, i32* @i, align 4, !dbg !17 ; <i32> [#uses=2] tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !59, metadata !DIExpression()), !dbg !19 @@ -25,20 +25,20 @@ entry: !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!28} -!0 = !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24) +!0 = distinct !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24) !1 = !DIFile(filename: "bar.c", directory: "/tmp/") -!2 = !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports: !20) +!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports: !20) !3 = !DISubroutineType(types: !4) !4 = !{!5, !5} !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = !DISubprogram(name: "bar", linkageName: "bar", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !27, scope: !1, type: !7, function: i32 ()* @bar) +!6 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !27, scope: !1, type: !7) !7 = !DISubroutineType(types: !8) !8 = !{!5} -!9 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "j", line: 9, arg: 0, scope: !0, file: !1, type: !5) -!10 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "xyz", line: 10, scope: !11, file: !1, type: !12) +!9 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5) +!10 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12) -!59 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "j", line: 9, arg: 0, scope: !0, file: !1, type: !5) -!60 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "xyz", line: 10, scope: !11, file: !1, type: !12) +!59 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5) +!60 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12) !11 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !0) !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13) diff --git a/test/DebugInfo/2010-07-19-Crash.ll b/test/DebugInfo/Generic/2010-07-19-Crash.ll index fbfe9f80189d..9565a2f09cbc 100644 --- a/test/DebugInfo/2010-07-19-Crash.ll +++ b/test/DebugInfo/Generic/2010-07-19-Crash.ll @@ -2,7 +2,7 @@ ; PR7662 ; Do not add variables to !11 because it is a declaration entry. -define i32 @bar() nounwind readnone ssp { +define i32 @bar() nounwind readnone ssp !dbg !0 { entry: ret i32 42, !dbg !9 } @@ -12,14 +12,14 @@ entry: !llvm.dbg.sp = !{!0, !6, !11} !llvm.dbg.lv.foo = !{!7} -!0 = !DISubprogram(name: "bar", linkageName: "bar", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !12, scope: !1, type: !3, function: i32 ()* @bar) +!0 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !12, scope: !1, type: !3) !1 = !DIFile(filename: "one.c", directory: "/private/tmp") -!2 = !DICompileUnit(language: DW_LANG_C99, producer: "clang 2.8", isOptimized: true, emissionKind: 0, file: !12, enums: !14, retainedTypes: !14, subprograms: !13) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang 2.8", isOptimized: true, emissionKind: 0, file: !12, enums: !14, retainedTypes: !14, subprograms: !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 = !DISubprogram(name: "foo", linkageName: "foo", line: 7, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !12, scope: !1, type: !3) -!7 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "one", line: 8, scope: !8, file: !1, type: !5) +!6 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 7, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !12, scope: !1, type: !3) +!7 = !DILocalVariable(name: "one", line: 8, scope: !8, file: !1, type: !5) !8 = distinct !DILexicalBlock(line: 7, column: 18, file: !12, scope: !6) !9 = !DILocation(line: 4, column: 3, scope: !10) !10 = distinct !DILexicalBlock(line: 3, column: 11, file: !12, scope: !0) diff --git a/test/DebugInfo/2010-10-01-crash.ll b/test/DebugInfo/Generic/2010-10-01-crash.ll index 5c736ba85552..712c32a7f627 100644 --- a/test/DebugInfo/2010-10-01-crash.ll +++ b/test/DebugInfo/Generic/2010-10-01-crash.ll @@ -1,6 +1,6 @@ ; RUN: llc -O0 %s -o /dev/null -define void @CGRectStandardize(i32* sret %agg.result, i32* byval %rect) nounwind ssp { +define void @CGRectStandardize(i32* sret %agg.result, i32* byval %rect) nounwind ssp !dbg !0 { entry: call void @llvm.dbg.declare(metadata i32* %rect, metadata !23, metadata !DIExpression()), !dbg !24 ret void @@ -13,11 +13,11 @@ declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!27} -!0 = !DISubprogram(name: "CGRectStandardize", linkageName: "CGRectStandardize", line: 54, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !1, scope: null, function: void (i32*, i32*)* @CGRectStandardize) +!0 = distinct !DISubprogram(name: "CGRectStandardize", linkageName: "CGRectStandardize", line: 54, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !1, scope: null) !1 = !DIFile(filename: "GSFusedSilica.m", directory: "/Volumes/Data/Users/sabre/Desktop") -!2 = !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 2.9 (trunk 115292)", isOptimized: true, runtimeVersion: 1, emissionKind: 0, file: !25, enums: !26, retainedTypes: !26) +!2 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 2.9 (trunk 115292)", isOptimized: true, runtimeVersion: 1, emissionKind: 0, file: !25, enums: !26, retainedTypes: !26, subprograms: !{!0}) !5 = !DIDerivedType(tag: DW_TAG_typedef, name: "CGRect", line: 49, file: !25, baseType: null) -!23 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "rect", line: 53, arg: 0, scope: !0, file: !1, type: !5) +!23 = !DILocalVariable(name: "rect", line: 53, arg: 2, scope: !0, file: !1, type: !5) !24 = !DILocation(line: 53, column: 33, scope: !0) !25 = !DIFile(filename: "GSFusedSilica.m", directory: "/Volumes/Data/Users/sabre/Desktop") !26 = !{} diff --git a/test/DebugInfo/Generic/Inputs/gmlt.ll b/test/DebugInfo/Generic/Inputs/gmlt.ll new file mode 100644 index 000000000000..b03a80b4deae --- /dev/null +++ b/test/DebugInfo/Generic/Inputs/gmlt.ll @@ -0,0 +1,153 @@ +; REQUIRES: object-emission +; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump - | FileCheck %s + +; Generated from the following source compiled with clang++ -gmlt: +; void f1() {} +; void __attribute__((section("__TEXT,__bar"))) f2() {} +; void __attribute__((always_inline)) f3() { f1(); } +; void f4() { f3(); } + +; Check that +; * -gmlt includes no DW_TAG_subprograms for subprograms without inlined +; subroutines. +; * yet still produces DW_AT_ranges and a range list in debug_ranges that +; describes those subprograms + +; CHECK: DW_TAG_compile_unit +; CHECK: DW_AT_ranges [DW_FORM_sec_offset] (0x00000000 +; CHECK-NOT: {{DW_TAG|NULL}} + +; Omitting the subprograms without inlined subroutines is not possible +; currently on Darwin as dsymutil will drop the whole CU if it has no subprograms +; (which happens with this optimization if there are no inlined subroutines). + +; DARWIN: DW_TAG_subprogram +; DARWIN-NOT: DW_TAG +; DARWIN: DW_AT_name {{.*}} "f1" +; DARWIN-NOT: {{DW_TAG|NULL}} +; DARWIN: DW_TAG_subprogram +; DARWIN-NOT: DW_TAG +; DARWIN: DW_AT_name {{.*}} "f2" +; DARWIN-NOT: {{DW_TAG|NULL}} +; DARWIN: DW_TAG_subprogram +; DARWIN-NOT: DW_TAG +; Can't check the abstract_origin value across the DARWIN/CHECK checking and +; ordering, so don't bother - just trust me, it refers to f3 down there. +; DARWIN: DW_AT_abstract_origin +; DARWIN-NOT: {{DW_TAG|NULL}} + + +; FIXME: Emitting separate abstract definitions is inefficient when we could +; just attach the DW_AT_name to the inlined_subroutine directly. Except that +; would produce many string relocations. Implement string indexing in the +; skeleton CU to address the relocation problem, then remove abstract +; definitions from -gmlt here. + +; CHECK: DW_TAG_subprogram +; CHECK-NEXT: DW_AT_name {{.*}} "f3" + +; FIXME: We don't really need DW_AT_inline, consumers can ignore this due to +; the absence of high_pc/low_pc/ranges and know that they just need it for +; retrieving the name of a concrete inlined instance + +; CHECK-NOT: {{DW_TAG|DW_AT|NULL}} + +; Check that we only provide the minimal attributes on a subprogram to save space. +; CHECK: DW_TAG_subprogram +; CHECK-NEXT: DW_AT_low_pc +; CHECK-NEXT: DW_AT_high_pc +; CHECK-NEXT: DW_AT_name +; CHECK-NOT: {{DW_TAG|DW_AT}} +; CHECK: DW_TAG_inlined_subroutine + +; As mentioned above - replace DW_AT_abstract_origin with DW_AT_name to save +; space once we have support for string indexing in non-dwo sections + +; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "f3" +; CHECK-NEXT: DW_AT_low_pc +; CHECK-NEXT: DW_AT_high_pc +; CHECK-NEXT: DW_AT_call_file +; CHECK-NEXT: DW_AT_call_line + +; Make sure we don't have any other subprograms here (subprograms with no +; inlined subroutines are omitted by design to save space) + +; CHECK-NOT: {{DW_TAG|DW_AT}} +; CHECK: NULL +; CHECK-NOT: {{DW_TAG|DW_AT}} +; CHECK: NULL + + +; CHECK: .debug_ranges contents: + +; ... some addresses (depends on platform (such as platforms with function +; reordering in the linker), and looks wonky on platforms with zero values +; written in relocation places (dumper needs to be fixed to read the +; relocations rather than interpret that as the end of a range list)) + +; CHECK: 00000000 <End of list> + + +; Check that we don't emit any pubnames or pubtypes under -gmlt +; CHECK: .debug_pubnames contents: +; CHECK-NOT: Offset + +; CHECK: .debug_pubtypes contents: +; CHECK-NOT: Offset + +; CHECK: .apple{{.*}} contents: + +; Function Attrs: nounwind uwtable +define void @_Z2f1v() #0 !dbg !4 { +entry: + ret void, !dbg !13 +} + +; Function Attrs: nounwind uwtable +define void @_Z2f2v() #0 section "__TEXT,__bar" !dbg !7 { +entry: + ret void, !dbg !14 +} + +; Function Attrs: alwaysinline nounwind uwtable +define void @_Z2f3v() #1 !dbg !8 { +entry: + call void @_Z2f1v(), !dbg !15 + ret void, !dbg !16 +} + +; Function Attrs: nounwind uwtable +define void @_Z2f4v() #0 !dbg !9 { +entry: + call void @_Z2f1v() #2, !dbg !17 + ret void, !dbg !19 +} + +attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { alwaysinline nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #2 = { nounwind } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!10, !11} +!llvm.ident = !{!12} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !DIFile(filename: "gmlt.cpp", directory: "/tmp/dbginfo") +!2 = !{} +!3 = !{!4, !7, !8, !9} +!4 = distinct !DISubprogram(name: "f1", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) +!5 = !DIFile(filename: "gmlt.cpp", directory: "/tmp/dbginfo") +!6 = !DISubroutineType(types: !2) +!7 = distinct !DISubprogram(name: "f2", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) +!8 = distinct !DISubprogram(name: "f3", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) +!9 = distinct !DISubprogram(name: "f4", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !5, type: !6, variables: !2) +!10 = !{i32 2, !"Dwarf Version", i32 4} +!11 = !{i32 2, !"Debug Info Version", i32 3} +!12 = !{!"clang version 3.6.0 "} +!13 = !DILocation(line: 1, column: 12, scope: !4) +!14 = !DILocation(line: 2, column: 53, scope: !7) +!15 = !DILocation(line: 3, column: 44, scope: !8) +!16 = !DILocation(line: 3, column: 50, scope: !8) +!17 = !DILocation(line: 3, column: 44, scope: !8, inlinedAt: !18) +!18 = !DILocation(line: 4, column: 13, scope: !9) +!19 = !DILocation(line: 4, column: 19, scope: !9) diff --git a/test/DebugInfo/PR20038.ll b/test/DebugInfo/Generic/PR20038.ll index 8691895f41ac..3e9145f03e85 100644 --- a/test/DebugInfo/PR20038.ll +++ b/test/DebugInfo/Generic/PR20038.ll @@ -1,6 +1,9 @@ ; REQUIRES: object-emission -; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s +; For some reason, the output when targetting sparc is not quite as expected. +; XFAIL: sparc + +; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=Enable < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s ; IR generated from clang -O0 with: ; struct C { @@ -52,7 +55,7 @@ @b = external global i8 ; Function Attrs: nounwind -define void @_Z4fun4v() #0 { +define void @_Z4fun4v() #0 !dbg !12 { entry: %this.addr.i.i = alloca %struct.C*, align 8, !dbg !21 %this.addr.i = alloca %struct.C*, align 8, !dbg !22 @@ -86,7 +89,7 @@ cleanup.done: ; preds = %cleanup.action, %la } ; Function Attrs: alwaysinline nounwind -define void @_ZN1CD1Ev(%struct.C* %this) unnamed_addr #1 align 2 { +define void @_ZN1CD1Ev(%struct.C* %this) unnamed_addr #1 align 2 !dbg !17 { entry: %this.addr.i = alloca %struct.C*, align 8, !dbg !37 %this.addr = alloca %struct.C*, align 8 @@ -100,7 +103,7 @@ entry: } ; Function Attrs: alwaysinline nounwind -define void @_ZN1CD2Ev(%struct.C* %this) unnamed_addr #1 align 2 { +define void @_ZN1CD2Ev(%struct.C* %this) unnamed_addr #1 align 2 !dbg !16 { entry: %this.addr = alloca %struct.C*, align 8 store %struct.C* %this, %struct.C** %this.addr, align 8 @@ -120,7 +123,7 @@ attributes #2 = { nounwind readnone } !llvm.module.flags = !{!18, !19} !llvm.ident = !{!20} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !11, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !11, globals: !2, imports: !2) !1 = !DIFile(filename: "<stdin>", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} @@ -132,12 +135,12 @@ attributes #2 = { nounwind readnone } !9 = !{null, !10} !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1C") !11 = !{!12, !16, !17} -!12 = !DISubprogram(name: "fun4", linkageName: "_Z4fun4v", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !5, scope: !13, type: !14, function: void ()* @_Z4fun4v, variables: !2) +!12 = distinct !DISubprogram(name: "fun4", linkageName: "_Z4fun4v", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !5, scope: !13, type: !14, variables: !2) !13 = !DIFile(filename: "PR20038.cpp", directory: "/tmp/dbginfo") !14 = !DISubroutineType(types: !15) !15 = !{null} -!16 = !DISubprogram(name: "~C", linkageName: "_ZN1CD2Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !5, scope: !"_ZTS1C", type: !8, function: void (%struct.C*)* @_ZN1CD2Ev, declaration: !7, variables: !2) -!17 = !DISubprogram(name: "~C", linkageName: "_ZN1CD1Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !5, scope: !"_ZTS1C", type: !8, function: void (%struct.C*)* @_ZN1CD1Ev, declaration: !7, variables: !2) +!16 = distinct !DISubprogram(name: "~C", linkageName: "_ZN1CD2Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !5, scope: !"_ZTS1C", type: !8, declaration: !7, variables: !2) +!17 = distinct !DISubprogram(name: "~C", linkageName: "_ZN1CD1Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !5, scope: !"_ZTS1C", type: !8, declaration: !7, variables: !2) !18 = !{i32 2, !"Dwarf Version", i32 4} !19 = !{i32 2, !"Debug Info Version", i32 3} !20 = !{!"clang version 3.5.0 "} @@ -149,15 +152,15 @@ attributes #2 = { nounwind readnone } !26 = distinct !DILexicalBlock(line: 5, column: 0, file: !5, scope: !12) !27 = !DILocation(line: 5, scope: !28) !28 = distinct !DILexicalBlock(line: 5, column: 0, file: !5, scope: !12) -!29 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !30) +!29 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !30) !30 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1C") !31 = !DILocation(line: 0, scope: !17, inlinedAt: !22) -!32 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30) +!32 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30) !33 = !DILocation(line: 0, scope: !16, inlinedAt: !21) -!129 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !30) -!132 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30) -!232 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30) +!129 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !30) +!132 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30) +!232 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !16, type: !30) !34 = !DILocation(line: 5, scope: !35) !35 = distinct !DILexicalBlock(line: 5, column: 0, file: !5, scope: !36) diff --git a/test/DebugInfo/accel-table-hash-collisions.ll b/test/DebugInfo/Generic/accel-table-hash-collisions.ll index 5e109a7de5ed..ff9c7851826f 100644 --- a/test/DebugInfo/accel-table-hash-collisions.ll +++ b/test/DebugInfo/Generic/accel-table-hash-collisions.ll @@ -69,7 +69,7 @@ !llvm.module.flags = !{!17, !18, !19} !llvm.ident = !{!20} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 231548) (llvm/trunk 231547)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 231548) (llvm/trunk 231547)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) !1 = !DIFile(filename: "hash-collisions.c", directory: "/tmp") !2 = !{} !3 = !{!4, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16} diff --git a/test/DebugInfo/array.ll b/test/DebugInfo/Generic/array.ll index f6c79f77c6f2..2f181e3b5953 100644 --- a/test/DebugInfo/array.ll +++ b/test/DebugInfo/Generic/array.ll @@ -1,7 +1,7 @@ ; RUN: %llc_dwarf -O0 < %s | FileCheck %s ; Do not emit AT_upper_bound for an unbounded array. ; radar 9241695 -define i32 @main() nounwind ssp { +define i32 @main() nounwind ssp !dbg !0 { entry: %retval = alloca i32, align 4 %a = alloca [0 x i32], align 4 @@ -15,13 +15,13 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!16} -!0 = !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 3, file: !14, scope: !1, type: !3, function: i32 ()* @main) +!0 = distinct !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 3, file: !14, scope: !1, type: !3) !1 = !DIFile(filename: "array.c", directory: "/private/tmp") -!2 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 129138)", isOptimized: false, emissionKind: 0, file: !14, enums: !15, retainedTypes: !15, subprograms: !13, imports: null) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 129138)", isOptimized: false, emissionKind: 0, file: !14, enums: !15, retainedTypes: !15, subprograms: !13, imports: null) !3 = !DISubroutineType(types: !4) !4 = !{!5} !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 4, scope: !7, file: !1, type: !8) +!6 = !DILocalVariable(name: "a", line: 4, scope: !7, file: !1, type: !8) !7 = distinct !DILexicalBlock(line: 3, column: 12, file: !14, scope: !0) !8 = !DICompositeType(tag: DW_TAG_array_type, align: 32, file: !14, scope: !2, baseType: !5, elements: !9) !9 = !{!10} diff --git a/test/DebugInfo/block-asan.ll b/test/DebugInfo/Generic/block-asan.ll index 393816b34857..92119631444c 100644 --- a/test/DebugInfo/block-asan.ll +++ b/test/DebugInfo/Generic/block-asan.ll @@ -20,7 +20,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" %struct.__block_byref_x = type { i8*, %struct.__block_byref_x*, i32, i32, i32 } ; Function Attrs: nounwind ssp uwtable -define void @foo() #0 { +define void @foo() #0 !dbg !4 { entry: %x = alloca %struct.__block_byref_x, align 8 call void @llvm.dbg.declare(metadata %struct.__block_byref_x* %x, metadata !12, metadata !22), !dbg !23 @@ -58,11 +58,11 @@ attributes #3 = { nounwind } !llvm.module.flags = !{!8, !9, !10} !llvm.ident = !{!11} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 (trunk 223120) (llvm/trunk 223119)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 (trunk 223120) (llvm/trunk 223119)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "block.c", directory: "/tmp") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: void ()* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "block.c", directory: "/tmp") !6 = !DISubroutineType(types: !7) !7 = !{null} @@ -70,7 +70,7 @@ attributes #3 = { nounwind } !9 = !{i32 2, !"Debug Info Version", i32 3} !10 = !{i32 1, !"PIC Level", i32 2} !11 = !{!"clang version 3.6.0 (trunk 223120) (llvm/trunk 223119)"} -!12 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "x", line: 4, scope: !4, file: !5, type: !13) +!12 = !DILocalVariable(name: "x", line: 4, scope: !4, file: !5, type: !13) !13 = !DICompositeType(tag: DW_TAG_structure_type, size: 224, flags: DIFlagBlockByrefStruct, file: !1, scope: !5, elements: !14) !14 = !{!15, !17, !18, !20, !21} !15 = !DIDerivedType(tag: DW_TAG_member, name: "__isa", size: 64, align: 64, file: !1, scope: !5, baseType: !16) diff --git a/test/DebugInfo/bug_null_debuginfo.ll b/test/DebugInfo/Generic/bug_null_debuginfo.ll index 5aaa3834a5f1..09e36db42b49 100644 --- a/test/DebugInfo/bug_null_debuginfo.ll +++ b/test/DebugInfo/Generic/bug_null_debuginfo.ll @@ -3,6 +3,6 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!2} -!0 = !DICompileUnit(language: DW_LANG_C99, isOptimized: false, emissionKind: 0, file: !1, globals: null) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, isOptimized: false, emissionKind: 0, file: !1, globals: null) !1 = !DIFile(filename: "t", directory: "") !2 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/constant-pointers.ll b/test/DebugInfo/Generic/constant-pointers.ll index 8e0a242f1bad..af0b6b0743c0 100644 --- a/test/DebugInfo/constant-pointers.ll +++ b/test/DebugInfo/Generic/constant-pointers.ll @@ -19,7 +19,7 @@ ; CHECK: DW_AT_const_value [DW_FORM_udata] (0) ; Function Attrs: nounwind uwtable -define weak_odr void @_Z4funcILPv0ELPFvvE0ELi42EEvv() #0 { +define weak_odr void @_Z4funcILPv0ELPFvvE0ELi42EEvv() #0 !dbg !4 { entry: ret void, !dbg !18 } @@ -30,11 +30,11 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !llvm.module.flags = !{!15, !16} !llvm.ident = !{!17} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "constant-pointers.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "func<nullptr, nullptr, 42>", linkageName: "_Z4funcILPv0ELPFvvE0ELi42EEvv", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: void ()* @_Z4funcILPv0ELPFvvE0ELi42EEvv, templateParams: !8, variables: !2) +!4 = distinct !DISubprogram(name: "func<nullptr, nullptr, 42>", linkageName: "_Z4funcILPv0ELPFvvE0ELi42EEvv", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, templateParams: !8, variables: !2) !5 = !DIFile(filename: "constant-pointers.cpp", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !7) !7 = !{null} diff --git a/test/DebugInfo/constant-sdnodes-have-dbg-location.ll b/test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll index 1f502a2a262a..833774185182 100644 --- a/test/DebugInfo/constant-sdnodes-have-dbg-location.ll +++ b/test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll @@ -1,9 +1,9 @@ -; RUN: llc -debug < %s 2>&1 | FileCheck %s +; RUN: llc -debug -dag-dump-verbose < %s 2>&1 | FileCheck %s ; REQUIRES: asserts -; CHECK: 0x{{[0-9,a-f]+}}: i32 = Constant<-1>test.c:4:5 +; CHECK: t{{[0-9]+}}: i32 = Constant<-1>test.c:4:5 -define i32 @main() { +define i32 @main() !dbg !4 { entry: %retval = alloca i32, align 4 store i32 0, i32* %retval @@ -13,11 +13,11 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!8, !9} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !3) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !3) !1 = !DIFile(filename: "test.c", directory: "/home/user/clang-llvm/build") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, variables: !2) !5 = !DISubroutineType(types: !6) !6 = !{!7} !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/constantfp-sdnodes-have-dbg-location.ll b/test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll index 2f7ecd8b061e..6cf9178269c4 100644 --- a/test/DebugInfo/constantfp-sdnodes-have-dbg-location.ll +++ b/test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll @@ -1,9 +1,9 @@ -; RUN: llc -debug < %s 2>&1 | FileCheck %s +; RUN: llc -debug -dag-dump-verbose < %s 2>&1 | FileCheck %s ; REQUIRES: asserts -; CHECK: 0x{{[0-9,a-f]+}}: f64 = ConstantFP<1.500000e+00>test.c:3:5 +; CHECK: t{{[0-9]+}}: f64 = ConstantFP<1.500000e+00>test.c:3:5 -define double @f() { +define double @f() !dbg !4 { entry: ret double 1.500000e+00, !dbg !10 } @@ -11,11 +11,11 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!8, !9} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !3) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, subprograms: !3) !1 = !DIFile(filename: "test.c", directory: "/home/user/clang-llvm/build") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, function: double ()* @f, variables: !2) +!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, variables: !2) !5 = !DISubroutineType(types: !6) !6 = !{!7} !7 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float) diff --git a/test/DebugInfo/cross-cu-inlining.ll b/test/DebugInfo/Generic/cross-cu-inlining.ll index 436bdda6473b..d95b43400607 100644 --- a/test/DebugInfo/cross-cu-inlining.ll +++ b/test/DebugInfo/Generic/cross-cu-inlining.ll @@ -1,7 +1,7 @@ ; REQUIRES: object-emission -; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck -implicit-check-not=DW_TAG %s -; RUN: %llc_dwarf -dwarf-accel-tables=Enable -O0 -filetype=obj < %s | llvm-dwarfdump - | FileCheck --check-prefix=CHECK-ACCEL --check-prefix=CHECK %s +; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=Enable < %s | llvm-dwarfdump -debug-dump=info - | FileCheck -implicit-check-not=DW_TAG %s +; RUN: %llc_dwarf -dwarf-accel-tables=Enable -dwarf-linkage-names=Enable -O0 -filetype=obj < %s | llvm-dwarfdump - | FileCheck --check-prefix=CHECK-ACCEL --check-prefix=CHECK %s ; Build from source: ; $ clang++ a.cpp b.cpp -g -c -emit-llvm @@ -66,7 +66,7 @@ @i = external global i32 ; Function Attrs: uwtable -define i32 @main() #0 { +define i32 @main() #0 !dbg !4 { entry: %x.addr.i = alloca i32, align 4 %retval = alloca i32, align 4 @@ -84,7 +84,7 @@ entry: } ; Function Attrs: alwaysinline nounwind uwtable -define i32 @_Z4funci(i32 %x) #1 { +define i32 @_Z4funci(i32 %x) #1 !dbg !12 { entry: %x.addr = alloca i32, align 4 store i32 %x, i32* %x.addr, align 4 @@ -112,19 +112,19 @@ attributes #3 = { nounwind } !llvm.module.flags = !{!16, !17} !llvm.ident = !{!18, !18} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !7) !7 = !{!8} !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !10, enums: !2, retainedTypes: !2, subprograms: !11, globals: !2, imports: !2) +!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !10, enums: !2, retainedTypes: !2, subprograms: !11, globals: !2, imports: !2) !10 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo") !11 = !{!12} -!12 = !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !10, scope: !13, type: !14, function: i32 (i32)* @_Z4funci, variables: !2) +!12 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !10, scope: !13, type: !14, variables: !2) !13 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo") !14 = !DISubroutineType(types: !15) !15 = !{!8, !8} @@ -132,9 +132,9 @@ attributes #3 = { nounwind } !17 = !{i32 2, !"Debug Info Version", i32 3} !18 = !{!"clang version 3.5.0 "} !19 = !DILocation(line: 4, scope: !4) -!20 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 1, arg: 1, scope: !12, file: !13, type: !8) +!20 = !DILocalVariable(name: "x", line: 1, arg: 1, scope: !12, file: !13, type: !8) -!120 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 1, arg: 1, scope: !12, file: !13, type: !8) +!120 = !DILocalVariable(name: "x", line: 1, arg: 1, scope: !12, file: !13, type: !8) !21 = !DILocation(line: 1, scope: !12, inlinedAt: !19) !22 = !DILocation(line: 2, scope: !12, inlinedAt: !19) diff --git a/test/DebugInfo/cross-cu-linkonce-distinct.ll b/test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll index b8ce57e70352..1713ea112d44 100644 --- a/test/DebugInfo/cross-cu-linkonce-distinct.ll +++ b/test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll @@ -49,7 +49,7 @@ @y = global i32 (i32)* @_Z4funci, align 8 ; Function Attrs: inlinehint nounwind uwtable -define linkonce_odr i32 @_Z4funci(i32 %i) #0 { +define linkonce_odr i32 @_Z4funci(i32 %i) #0 !dbg !4 { %1 = alloca i32, align 4 store i32 %i, i32* %1, align 4 call void @llvm.dbg.declare(metadata i32* %1, metadata !22, metadata !DIExpression()), !dbg !23 @@ -68,11 +68,11 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!19, !20} !llvm.ident = !{!21, !21} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports: !2) !1 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i32)* @_Z4funci, variables: !2) +!4 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !7) !7 = !{!8, !8} @@ -80,16 +80,16 @@ attributes #1 = { nounwind readnone } !9 = !{!10} !10 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !5, type: !11, variable: i32 (i32)** @x) !11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !6) -!12 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !13, enums: !2, retainedTypes: !2, subprograms: !14, globals: !17, imports: !2) +!12 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !13, enums: !2, retainedTypes: !2, subprograms: !14, globals: !17, imports: !2) !13 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo") !14 = !{!15} -!15 = !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !13, scope: !16, type: !6, function: i32 (i32)* @_Z4funci, variables: !2) +!15 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !13, scope: !16, type: !6, variables: !2) !16 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo") !17 = !{!18} !18 = !DIGlobalVariable(name: "y", line: 4, isLocal: false, isDefinition: true, scope: null, file: !16, type: !11, variable: i32 (i32)** @y) !19 = !{i32 2, !"Dwarf Version", i32 4} !20 = !{i32 1, !"Debug Info Version", i32 3} !21 = !{!"clang version 3.5.0 "} -!22 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 1, arg: 1, scope: !4, file: !5, type: !8) +!22 = !DILocalVariable(name: "i", line: 1, arg: 1, scope: !4, file: !5, type: !8) !23 = !DILocation(line: 1, scope: !4) !24 = !DILocation(line: 2, scope: !4) diff --git a/test/DebugInfo/cross-cu-linkonce.ll b/test/DebugInfo/Generic/cross-cu-linkonce.ll index 3638825fc9c7..983871a1d0f1 100644 --- a/test/DebugInfo/cross-cu-linkonce.ll +++ b/test/DebugInfo/Generic/cross-cu-linkonce.ll @@ -29,7 +29,7 @@ @y = global i32 (i32)* @_Z4funci, align 8 ; Function Attrs: inlinehint nounwind uwtable -define linkonce_odr i32 @_Z4funci(i32 %i) #0 { +define linkonce_odr i32 @_Z4funci(i32 %i) #0 !dbg !4 { %1 = alloca i32, align 4 store i32 %i, i32* %1, align 4 call void @llvm.dbg.declare(metadata i32* %1, metadata !20, metadata !DIExpression()), !dbg !21 @@ -48,11 +48,11 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!17, !18} !llvm.ident = !{!19, !19} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !10, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !10, imports: !2) !1 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !5, scope: !6, type: !7, function: i32 (i32)* @_Z4funci, variables: !2) +!4 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !5, scope: !6, type: !7, variables: !2) !5 = !DIFile(filename: "func.h", directory: "/tmp/dbginfo") !6 = !DIFile(filename: "func.h", directory: "/tmp/dbginfo") !7 = !DISubroutineType(types: !8) @@ -61,13 +61,13 @@ attributes #1 = { nounwind readnone } !10 = !{!11} !11 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !6, type: !12, variable: i32 (i32)** @x) !12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !7) -!13 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !14, enums: !2, retainedTypes: !2, subprograms: !3, globals: !15, imports: !2) +!13 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !14, enums: !2, retainedTypes: !2, subprograms: !3, globals: !15, imports: !2) !14 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo") !15 = !{!16} !16 = !DIGlobalVariable(name: "y", line: 4, isLocal: false, isDefinition: true, scope: null, file: !6, type: !12, variable: i32 (i32)** @y) !17 = !{i32 2, !"Dwarf Version", i32 4} !18 = !{i32 1, !"Debug Info Version", i32 3} !19 = !{!"clang version 3.5.0 "} -!20 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 1, arg: 1, scope: !4, file: !6, type: !9) +!20 = !DILocalVariable(name: "i", line: 1, arg: 1, scope: !4, file: !6, type: !9) !21 = !DILocation(line: 1, scope: !4) !22 = !DILocation(line: 2, scope: !4) diff --git a/test/DebugInfo/cu-range-hole.ll b/test/DebugInfo/Generic/cu-range-hole.ll index 19a305483fb5..12651a844ef1 100644 --- a/test/DebugInfo/cu-range-hole.ll +++ b/test/DebugInfo/Generic/cu-range-hole.ll @@ -14,7 +14,7 @@ ; CHECK: DW_TAG_subprogram ; Function Attrs: nounwind uwtable -define i32 @b(i32 %c) #0 { +define i32 @b(i32 %c) #0 !dbg !5 { entry: %c.addr = alloca i32, align 4 store i32 %c, i32* %c.addr, align 4 @@ -38,7 +38,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 ; Function Attrs: nounwind uwtable -define i32 @d(i32 %e) #0 { +define i32 @d(i32 %e) #0 !dbg !10 { entry: %e.addr = alloca i32, align 4 store i32 %e, i32* %e.addr, align 4 @@ -56,19 +56,19 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!11, !12} !0 = !{!"clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)"} -!1 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: 1, file: !2, enums: !3, retainedTypes: !3, subprograms: !4, globals: !3, imports: !3) +!1 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: 1, file: !2, enums: !3, retainedTypes: !3, subprograms: !4, globals: !3, imports: !3) !2 = !DIFile(filename: "b.c", directory: "/usr/local/google/home/echristo") !3 = !{} !4 = !{!5, !10} -!5 = !DISubprogram(name: "b", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !2, scope: !6, type: !7, function: i32 (i32)* @b, variables: !3) +!5 = distinct !DISubprogram(name: "b", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !2, scope: !6, type: !7, variables: !3) !6 = !DIFile(filename: "b.c", directory: "/usr/local/google/home/echristo") !7 = !DISubroutineType(types: !8) !8 = !{!9, !9} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = !DISubprogram(name: "d", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !2, scope: !6, type: !7, function: i32 (i32)* @d, variables: !3) +!10 = distinct !DISubprogram(name: "d", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !2, scope: !6, type: !7, variables: !3) !11 = !{i32 2, !"Dwarf Version", i32 4} !12 = !{i32 1, !"Debug Info Version", i32 3} -!13 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "c", line: 1, arg: 1, scope: !5, file: !6, type: !9) +!13 = !DILocalVariable(name: "c", line: 1, arg: 1, scope: !5, file: !6, type: !9) !14 = !DILocation(line: 1, scope: !5) -!15 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "e", line: 3, arg: 1, scope: !10, file: !6, type: !9) +!15 = !DILocalVariable(name: "e", line: 3, arg: 1, scope: !10, file: !6, type: !9) !16 = !DILocation(line: 3, scope: !10) diff --git a/test/DebugInfo/cu-ranges.ll b/test/DebugInfo/Generic/cu-ranges.ll index 3cec5c88f385..ab5577984e69 100644 --- a/test/DebugInfo/cu-ranges.ll +++ b/test/DebugInfo/Generic/cu-ranges.ll @@ -18,7 +18,7 @@ ; CHECK: 00000000 <End of list> ; Function Attrs: nounwind uwtable -define i32 @foo(i32 %a) #0 section "__TEXT,__foo" { +define i32 @foo(i32 %a) #0 section "__TEXT,__foo" !dbg !4 { entry: %a.addr = alloca i32, align 4 store i32 %a, i32* %a.addr, align 4 @@ -32,7 +32,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 ; Function Attrs: nounwind uwtable -define i32 @bar(i32 %a) #0 { +define i32 @bar(i32 %a) #0 !dbg !9 { entry: %a.addr = alloca i32, align 4 store i32 %a, i32* %a.addr, align 4 @@ -49,23 +49,23 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!10, !11} !llvm.ident = !{!12} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/echristo") !2 = !{} !3 = !{!4, !9} -!4 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i32)* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/echristo") !6 = !DISubroutineType(types: !7) !7 = !{!8, !8} !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = !DISubprogram(name: "bar", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, function: i32 (i32)* @bar, variables: !2) +!9 = distinct !DISubprogram(name: "bar", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, variables: !2) !10 = !{i32 2, !"Dwarf Version", i32 4} !11 = !{i32 1, !"Debug Info Version", i32 3} !12 = !{!"clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)"} -!13 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 1, arg: 1, scope: !4, file: !5, type: !8) +!13 = !DILocalVariable(name: "a", line: 1, arg: 1, scope: !4, file: !5, type: !8) !14 = !DILocation(line: 1, scope: !4) !15 = !DILocation(line: 2, scope: !4) -!16 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 5, arg: 1, scope: !9, file: !5, type: !8) +!16 = !DILocalVariable(name: "a", line: 5, arg: 1, scope: !9, file: !5, type: !8) !17 = !DILocation(line: 5, scope: !9) !18 = !DILocation(line: 6, scope: !9) diff --git a/test/DebugInfo/X86/dbg-at-specficiation.ll b/test/DebugInfo/Generic/dbg-at-specficiation.ll index ccb5ab142cda..7302aaecb93f 100644 --- a/test/DebugInfo/X86/dbg-at-specficiation.ll +++ b/test/DebugInfo/Generic/dbg-at-specficiation.ll @@ -8,7 +8,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!12} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 140253)", isOptimized: true, emissionKind: 0, file: !11, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 140253)", isOptimized: true, emissionKind: 0, file: !11, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3) !2 = !{} !3 = !{!5} !5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: [10 x i32]* @a) diff --git a/test/DebugInfo/dead-argument-order.ll b/test/DebugInfo/Generic/dead-argument-order.ll index 2dd556d096d6..a6451a038cdb 100644 --- a/test/DebugInfo/dead-argument-order.ll +++ b/test/DebugInfo/Generic/dead-argument-order.ll @@ -36,7 +36,7 @@ %struct.S = type { i32 } ; Function Attrs: nounwind readnone uwtable -define i32 @_Z8function1Si(i32 %s.coerce, i32 %i) #0 { +define i32 @_Z8function1Si(i32 %s.coerce, i32 %i) #0 !dbg !9 { entry: tail call void @llvm.dbg.declare(metadata %struct.S* undef, metadata !14, metadata !DIExpression()), !dbg !20 tail call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !15, metadata !DIExpression()), !dbg !20 @@ -57,7 +57,7 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!16, !17} !llvm.ident = !{!18} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !8, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !8, globals: !2, imports: !2) !1 = !DIFile(filename: "dead-argument-order.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} @@ -66,13 +66,13 @@ attributes #1 = { nounwind readnone } !6 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 1, size: 32, align: 32, file: !1, scope: !"_ZTS1S", baseType: !7) !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !8 = !{!9} -!9 = !DISubprogram(name: "function", linkageName: "_Z8function1Si", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !10, type: !11, function: i32 (i32, i32)* @_Z8function1Si, variables: !13) +!9 = distinct !DISubprogram(name: "function", linkageName: "_Z8function1Si", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !10, type: !11, variables: !13) !10 = !DIFile(filename: "dead-argument-order.cpp", directory: "/tmp/dbginfo") !11 = !DISubroutineType(types: !12) !12 = !{!7, !4, !7} !13 = !{!14, !15} -!14 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "s", line: 2, arg: 1, scope: !9, file: !10, type: !"_ZTS1S") -!15 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 2, arg: 2, scope: !9, file: !10, type: !7) +!14 = !DILocalVariable(name: "s", line: 2, arg: 1, scope: !9, file: !10, type: !"_ZTS1S") +!15 = !DILocalVariable(name: "i", line: 2, arg: 2, scope: !9, file: !10, type: !7) !16 = !{i32 2, !"Dwarf Version", i32 4} !17 = !{i32 2, !"Debug Info Version", i32 3} !18 = !{!"clang version 3.5.0 "} diff --git a/test/DebugInfo/debug-info-always-inline.ll b/test/DebugInfo/Generic/debug-info-always-inline.ll index 5eaa67522181..5eaa67522181 100644 --- a/test/DebugInfo/debug-info-always-inline.ll +++ b/test/DebugInfo/Generic/debug-info-always-inline.ll diff --git a/test/DebugInfo/debug-info-qualifiers.ll b/test/DebugInfo/Generic/debug-info-qualifiers.ll index 1f8f6c419932..aa197dd9f6fa 100644 --- a/test/DebugInfo/debug-info-qualifiers.ll +++ b/test/DebugInfo/Generic/debug-info-qualifiers.ll @@ -35,7 +35,7 @@ %class.A = type { i8 } ; Function Attrs: nounwind -define void @_Z1gv() #0 { +define void @_Z1gv() #0 !dbg !17 { %a = alloca %class.A, align 1 %pl = alloca { i64, i64 }, align 8 %pr = alloca { i64, i64 }, align 8 @@ -61,7 +61,7 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!21, !22} !llvm.ident = !{!23} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !16, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !16, globals: !2, imports: !2) !1 = !DIFile(filename: "debug-info-qualifiers.cpp", directory: "") !2 = !{} !3 = !{!4} @@ -76,22 +76,22 @@ attributes #1 = { nounwind readnone } !13 = !DISubprogram(name: "r", linkageName: "_ZNKO1A1rEv", line: 7, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagObjectPointer | DIFlagRValueReference, isOptimized: false, scopeLine: 7, file: !5, scope: !"_ZTS1A", type: !14) !14 = !DISubroutineType(flags: DIFlagRValueReference, types: !9) !16 = !{!17} -!17 = !DISubprogram(name: "g", linkageName: "_Z1gv", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !5, scope: !18, type: !19, function: void ()* @_Z1gv, variables: !2) +!17 = distinct !DISubprogram(name: "g", linkageName: "_Z1gv", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !5, scope: !18, type: !19, variables: !2) !18 = !DIFile(filename: "debug-info-qualifiers.cpp", directory: "") !19 = !DISubroutineType(types: !20) !20 = !{null} !21 = !{i32 2, !"Dwarf Version", i32 4} !22 = !{i32 1, !"Debug Info Version", i32 3} !23 = !{!"clang version 3.5 "} -!24 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 11, scope: !17, file: !18, type: !4) +!24 = !DILocalVariable(name: "a", line: 11, scope: !17, file: !18, type: !4) !25 = !DILocation(line: 11, scope: !17) -!26 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "pl", line: 16, scope: !17, file: !18, type: !27) +!26 = !DILocalVariable(name: "pl", line: 16, scope: !17, file: !18, type: !27) !27 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !28, extraData: !"_ZTS1A") !28 = !DISubroutineType(flags: DIFlagLValueReference, types: !29) !29 = !{null, !30} !30 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") !31 = !DILocation(line: 16, scope: !17) -!32 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "pr", line: 21, scope: !17, file: !18, type: !33) +!32 = !DILocalVariable(name: "pr", line: 21, scope: !17, file: !18, type: !33) !33 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !34, extraData: !"_ZTS1A") !34 = !DISubroutineType(flags: DIFlagRValueReference, types: !29) !35 = !DILocation(line: 21, scope: !17) diff --git a/test/DebugInfo/debuginfofinder-forward-declaration.ll b/test/DebugInfo/Generic/debuginfofinder-forward-declaration.ll index db143260e02b..62c151bc8d76 100644 --- a/test/DebugInfo/debuginfofinder-forward-declaration.ll +++ b/test/DebugInfo/Generic/debuginfofinder-forward-declaration.ll @@ -27,7 +27,7 @@ !llvm.module.flags = !{!10, !11} !llvm.ident = !{!12} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (http://llvm.org/git/clang.git 247b30a043eb8f39ea3708e7e995089da0a6b00f) (http://llvm.org/git/llvm.git 6ecc7365a89c771fd229bdd9ffcc178684ea1aa5)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (http://llvm.org/git/clang.git 247b30a043eb8f39ea3708e7e995089da0a6b00f) (http://llvm.org/git/llvm.git 6ecc7365a89c771fd229bdd9ffcc178684ea1aa5)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) !1 = !DIFile(filename: "minimal.c", directory: "/tmp") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/debuginfofinder-multiple-cu.ll b/test/DebugInfo/Generic/debuginfofinder-multiple-cu.ll index 4088dd54f53f..a4d226b86a69 100644 --- a/test/DebugInfo/debuginfofinder-multiple-cu.ll +++ b/test/DebugInfo/Generic/debuginfofinder-multiple-cu.ll @@ -11,29 +11,29 @@ ;CHECK: Subprogram: f from /tmp/test1.c:1 ;CHECK: Subprogram: g from /tmp/test2.c:1 -define void @f() { +define void @f() !dbg !4 { ret void, !dbg !14 } -define void @g() { +define void @g() !dbg !11 { ret void, !dbg !15 } !llvm.dbg.cu = !{!0, !8} !llvm.module.flags = !{!13, !16} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (192092)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (192092)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "test1.c", directory: "/tmp") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void ()* @f, variables: !2) +!4 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "test1.c", directory: "/tmp") !6 = !DISubroutineType(types: !7) !7 = !{null} -!8 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (192092)", isOptimized: false, emissionKind: 0, file: !9, enums: !2, retainedTypes: !2, subprograms: !10, globals: !2, imports: !2) +!8 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (192092)", isOptimized: false, emissionKind: 0, file: !9, enums: !2, retainedTypes: !2, subprograms: !10, globals: !2, imports: !2) !9 = !DIFile(filename: "test2.c", directory: "/tmp") !10 = !{!11} -!11 = !DISubprogram(name: "g", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !9, scope: !12, type: !6, function: void ()* @g, variables: !2) +!11 = distinct !DISubprogram(name: "g", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !9, scope: !12, type: !6, variables: !2) !12 = !DIFile(filename: "test2.c", directory: "/tmp") !13 = !{i32 2, !"Dwarf Version", i32 4} !14 = !DILocation(line: 1, scope: !4) diff --git a/test/DebugInfo/Generic/def-line.ll b/test/DebugInfo/Generic/def-line.ll new file mode 100644 index 000000000000..3ab7feaf9545 --- /dev/null +++ b/test/DebugInfo/Generic/def-line.ll @@ -0,0 +1,93 @@ +; REQUIRES: object-emission + +; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s + +; Given the following source, ensure that the decl_line/file is correctly +; emitted and omitted on definitions if it mismatches/matches the declaration + +; struct foo { +; static void f1() { +; } +; static void f2(); +; static void f3(); +; }; +; void foo::f2() { +; f1(); // just to ensure f1 is emitted +; } +; #line 1 "bar.cpp" +; void foo::f3() { +; } + +; Skip the declarations +; CHECK: DW_TAG_subprogram +; CHECK: DW_TAG_subprogram +; CHECK: DW_TAG_subprogram + +; CHECK: DW_TAG_subprogram +; CHECK-NOT: {{DW_TAG|NULL|DW_AT_decl_file}} +; CHECK: DW_AT_decl_line {{.*}}7 +; CHECK-NOT: {{DW_TAG|NULL|DW_AT_decl_file}} +; CHECK: DW_AT_specification {{.*}}f2 +; CHECK-NOT: {{DW_TAG|NULL|DW_AT_decl_file}} + +; CHECK: DW_TAG_subprogram +; CHECK-NOT: {{DW_TAG|NULL|DW_AT_decl_line|DW_AT_decl_file}} +; CHECK: DW_AT_specification {{.*}}f1 + +; CHECK: DW_TAG_subprogram +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK: DW_AT_decl_file {{.*}}bar.cpp +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK: DW_AT_decl_line {{.*}}1 +; CHECK-NOT: {{DW_TAG|NULL}} +; CHECK: DW_AT_specification {{.*}}f3 + +; Function Attrs: uwtable +define void @_ZN3foo2f2Ev() #0 align 2 !dbg !12 { +entry: + call void @_ZN3foo2f1Ev(), !dbg !19 + ret void, !dbg !20 +} + +; Function Attrs: nounwind uwtable +define linkonce_odr void @_ZN3foo2f1Ev() #1 align 2 !dbg !15 { +entry: + ret void, !dbg !21 +} + +; Function Attrs: nounwind uwtable +define void @_ZN3foo2f3Ev() #1 align 2 !dbg !13 { +entry: + ret void, !dbg !22 +} + +attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!16, !17} +!llvm.ident = !{!18} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 249440) (llvm/trunk 249465)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !11) +!1 = !DIFile(filename: "def-line.cpp", directory: "/tmp/dbginfo") +!2 = !{} +!3 = !{!4} +!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !1, line: 1, size: 8, align: 8, elements: !5, identifier: "_ZTS3foo") +!5 = !{!6, !9, !10} +!6 = !DISubprogram(name: "f1", linkageName: "_ZN3foo2f1Ev", scope: !"_ZTS3foo", file: !1, line: 2, type: !7, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false) +!7 = !DISubroutineType(types: !8) +!8 = !{null} +!9 = !DISubprogram(name: "f2", linkageName: "_ZN3foo2f2Ev", scope: !"_ZTS3foo", file: !1, line: 4, type: !7, isLocal: false, isDefinition: false, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false) +!10 = !DISubprogram(name: "f3", linkageName: "_ZN3foo2f3Ev", scope: !"_ZTS3foo", file: !1, line: 5, type: !7, isLocal: false, isDefinition: false, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false) +!11 = !{!12, !13, !15} +!12 = distinct !DISubprogram(name: "f2", linkageName: "_ZN3foo2f2Ev", scope: !"_ZTS3foo", file: !1, line: 7, type: !7, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: false, declaration: !9, variables: !2) +!13 = distinct !DISubprogram(name: "f3", linkageName: "_ZN3foo2f3Ev", scope: !"_ZTS3foo", file: !14, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, declaration: !10, variables: !2) +!14 = !DIFile(filename: "bar.cpp", directory: "/tmp/dbginfo") +!15 = distinct !DISubprogram(name: "f1", linkageName: "_ZN3foo2f1Ev", scope: !"_ZTS3foo", file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, declaration: !6, variables: !2) +!16 = !{i32 2, !"Dwarf Version", i32 4} +!17 = !{i32 2, !"Debug Info Version", i32 3} +!18 = !{!"clang version 3.8.0 (trunk 249440) (llvm/trunk 249465)"} +!19 = !DILocation(line: 8, column: 3, scope: !12) +!20 = !DILocation(line: 9, column: 1, scope: !12) +!21 = !DILocation(line: 3, column: 3, scope: !15) +!22 = !DILocation(line: 2, column: 1, scope: !13) diff --git a/test/DebugInfo/Generic/discriminator.ll b/test/DebugInfo/Generic/discriminator.ll new file mode 100644 index 000000000000..6dbd558c5025 --- /dev/null +++ b/test/DebugInfo/Generic/discriminator.ll @@ -0,0 +1,52 @@ +; REQUIRES: object-emission + +; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s + +; Given the following source, ensure that the discriminator is emitted for +; the inlined callsite. + +;void xyz(); +;static void __attribute__((always_inline)) bar() { xyz(); } +;void foo() { +; bar(); bar(); +;} + +;CHECK: DW_TAG_inlined_subroutine +;CHECK-NOT: DW_AT_GNU_discriminator +;CHECK: DW_TAG_inlined_subroutine +;CHECK-NOT: {{DW_TAG|NULL}} +;CHECK: DW_AT_GNU_discriminator{{.*}}0x01 + +; Function Attrs: uwtable +define void @_Z3foov() #0 !dbg !4 { + tail call void @_Z3xyzv(), !dbg !11 + tail call void @_Z3xyzv(), !dbg !13 + ret void, !dbg !16 +} + +declare void @_Z3xyzv() #1 + +attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!8, !9} +!llvm.ident = !{!10} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 252497)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!1 = !DIFile(filename: "a.cc", directory: "/tmp") +!2 = !{} +!3 = !{!4, !7} +!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, variables: !2) +!5 = !DISubroutineType(types: !6) +!6 = !{null} +!7 = distinct !DISubprogram(name: "bar", linkageName: "_ZL3barv", scope: !1, file: !1, line: 2, type: !5, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, variables: !2) +!8 = !{i32 2, !"Dwarf Version", i32 4} +!9 = !{i32 2, !"Debug Info Version", i32 3} +!10 = !{!"clang version 3.8.0 (trunk 252497)"} +!11 = !DILocation(line: 2, column: 52, scope: !7, inlinedAt: !12) +!12 = distinct !DILocation(line: 4, column: 3, scope: !4) +!13 = !DILocation(line: 2, column: 52, scope: !7, inlinedAt: !14) +!14 = distinct !DILocation(line: 4, column: 10, scope: !15) +!15 = !DILexicalBlockFile(scope: !4, file: !1, discriminator: 1) +!16 = !DILocation(line: 5, column: 1, scope: !4) diff --git a/test/DebugInfo/dwarf-public-names.ll b/test/DebugInfo/Generic/dwarf-public-names.ll index bd340578bfb0..b98a8e7415c7 100644 --- a/test/DebugInfo/dwarf-public-names.ll +++ b/test/DebugInfo/Generic/dwarf-public-names.ll @@ -55,7 +55,7 @@ @global_variable = global %struct.C zeroinitializer, align 1 @_ZN2ns25global_namespace_variableE = global i32 1, align 4 -define void @_ZN1C15member_functionEv(%struct.C* %this) nounwind uwtable align 2 { +define void @_ZN1C15member_functionEv(%struct.C* %this) nounwind uwtable align 2 !dbg !3 { entry: %this.addr = alloca %struct.C*, align 8 store %struct.C* %this, %struct.C** %this.addr, align 8 @@ -67,18 +67,18 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone -define i32 @_ZN1C22static_member_functionEv() nounwind uwtable align 2 { +define i32 @_ZN1C22static_member_functionEv() nounwind uwtable align 2 !dbg !18 { entry: %0 = load i32, i32* @_ZN1C22static_member_variableE, align 4, !dbg !33 ret i32 %0, !dbg !33 } -define i32 @_Z15global_functionv() nounwind uwtable { +define i32 @_Z15global_functionv() nounwind uwtable !dbg !19 { entry: ret i32 -1, !dbg !34 } -define void @_ZN2ns25global_namespace_functionEv() nounwind uwtable { +define void @_ZN2ns25global_namespace_functionEv() nounwind uwtable !dbg !20 { entry: call void @_ZN1C15member_functionEv(%struct.C* @global_variable), !dbg !35 ret void, !dbg !36 @@ -90,10 +90,10 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!38} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (http://llvm.org/git/clang.git a09cd8103a6a719cb2628cdf0c91682250a17bd2) (http://llvm.org/git/llvm.git 47d03cec0afca0c01ae42b82916d1d731716cd20)", isOptimized: false, emissionKind: 0, file: !37, enums: !1, retainedTypes: !1, subprograms: !2, globals: !24, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (http://llvm.org/git/clang.git a09cd8103a6a719cb2628cdf0c91682250a17bd2) (http://llvm.org/git/llvm.git 47d03cec0afca0c01ae42b82916d1d731716cd20)", isOptimized: false, emissionKind: 0, file: !37, enums: !1, retainedTypes: !1, subprograms: !2, globals: !24, imports: !1) !1 = !{} !2 = !{!3, !18, !19, !20} -!3 = !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 9, file: !4, scope: null, type: !5, function: void (%struct.C*)* @_ZN1C15member_functionEv, declaration: !12, variables: !1) +!3 = distinct !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 9, file: !4, scope: null, type: !5, declaration: !12, variables: !1) !4 = !DIFile(filename: "dwarf-public-names.cpp", directory: "/usr2/kparzysz/s.hex/t") !5 = !DISubroutineType(types: !6) !6 = !{null, !7} @@ -108,9 +108,9 @@ attributes #1 = { nounwind readnone } !15 = !DISubroutineType(types: !16) !16 = !{!11} !17 = !{} ; previously: invalid DW_TAG_base_type -!18 = !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 13, file: !4, scope: null, type: !15, function: i32 ()* @_ZN1C22static_member_functionEv, declaration: !14, variables: !1) -!19 = !DISubprogram(name: "global_function", linkageName: "_Z15global_functionv", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 19, file: !4, scope: !4, type: !15, function: i32 ()* @_Z15global_functionv, variables: !1) -!20 = !DISubprogram(name: "global_namespace_function", linkageName: "_ZN2ns25global_namespace_functionEv", line: 24, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 24, file: !4, scope: !21, type: !22, function: void ()* @_ZN2ns25global_namespace_functionEv, variables: !1) +!18 = distinct !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 13, file: !4, scope: null, type: !15, declaration: !14, variables: !1) +!19 = distinct !DISubprogram(name: "global_function", linkageName: "_Z15global_functionv", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 19, file: !4, scope: !4, type: !15, variables: !1) +!20 = distinct !DISubprogram(name: "global_namespace_function", linkageName: "_ZN2ns25global_namespace_functionEv", line: 24, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 24, file: !4, scope: !21, type: !22, variables: !1) !21 = !DINamespace(name: "ns", line: 23, file: !4, scope: null) !22 = !DISubroutineType(types: !23) !23 = !{null} @@ -118,7 +118,7 @@ attributes #1 = { nounwind readnone } !25 = !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", line: 7, isLocal: false, isDefinition: true, scope: !8, file: !4, type: !11, variable: i32* @_ZN1C22static_member_variableE, declaration: !10) !26 = !DIGlobalVariable(name: "global_variable", line: 17, isLocal: false, isDefinition: true, scope: null, file: !4, type: !8, variable: %struct.C* @global_variable) !27 = !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", line: 27, isLocal: false, isDefinition: true, scope: !21, file: !4, type: !11, variable: i32* @_ZN2ns25global_namespace_variableE) -!28 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 9, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !3, file: !4, type: !29) +!28 = !DILocalVariable(name: "this", line: 9, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !3, file: !4, type: !29) !29 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !8) !30 = !DILocation(line: 9, scope: !3) !31 = !DILocation(line: 10, scope: !3) diff --git a/test/DebugInfo/empty.ll b/test/DebugInfo/Generic/empty.ll index ad26b500b354..f787039885b9 100644 --- a/test/DebugInfo/empty.ll +++ b/test/DebugInfo/Generic/empty.ll @@ -24,7 +24,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!5} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143523)", isOptimized: true, emissionKind: 0, file: !4, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143523)", isOptimized: true, emissionKind: 0, file: !4, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2) !2 = !{} !3 = !DIFile(filename: "empty.c", directory: "/home/nlewycky") !4 = !DIFile(filename: "empty.c", directory: "/home/nlewycky") diff --git a/test/DebugInfo/enum-types.ll b/test/DebugInfo/Generic/enum-types.ll index 7b50f5e9087c..e71fcbc52bfb 100644 --- a/test/DebugInfo/enum-types.ll +++ b/test/DebugInfo/Generic/enum-types.ll @@ -1,6 +1,6 @@ ; REQUIRES: object-emission ; -; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s +; RUN: %llc_dwarf -filetype=obj -O0 -dwarf-linkage-names=Enable < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s ; Make sure we can handle enums with the same identifier but in enum types of ; different compile units. @@ -21,7 +21,7 @@ ; CHECK: DW_AT_type [DW_FORM_ref_addr] {{.*}}[[ENUM]] ; Function Attrs: nounwind ssp uwtable -define void @_Z4topA2EA(i32 %sa) #0 { +define void @_Z4topA2EA(i32 %sa) #0 !dbg !7 { entry: %sa.addr = alloca i32, align 4 store i32 %sa, i32* %sa.addr, align 4 @@ -33,7 +33,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 ; Function Attrs: nounwind ssp uwtable -define void @_Z4topB2EA(i32 %sa) #0 { +define void @_Z4topB2EA(i32 %sa) #0 !dbg !17 { entry: %sa.addr = alloca i32, align 4 store i32 %sa, i32* %sa.addr, align 4 @@ -48,31 +48,31 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!19, !20} !llvm.ident = !{!21, !21} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 214102:214133) (llvm/trunk 214102:214132)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !6, globals: !11, imports: !11) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 214102:214133) (llvm/trunk 214102:214132)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !6, globals: !11, imports: !11) !1 = !DIFile(filename: "a.cpp", directory: "") !2 = !{!3} !3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "EA", line: 1, size: 32, align: 32, file: !1, elements: !4, identifier: "_ZTS2EA") !4 = !{!5} !5 = !DIEnumerator(name: "EA_0", value: 0) ; [ DW_TAG_enumerator ] [EA_0 :: 0] !6 = !{!7} -!7 = !DISubprogram(name: "topA", linkageName: "_Z4topA2EA", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !8, type: !9, function: void (i32)* @_Z4topA2EA, variables: !11) +!7 = distinct !DISubprogram(name: "topA", linkageName: "_Z4topA2EA", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !8, type: !9, variables: !11) !8 = !DIFile(filename: "a.cpp", directory: "") !9 = !DISubroutineType(types: !10) !10 = !{null, !"_ZTS2EA"} !11 = !{} -!12 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 214102:214133) (llvm/trunk 214102:214132)", isOptimized: false, emissionKind: 1, file: !13, enums: !14, retainedTypes: !14, subprograms: !16, globals: !11, imports: !11) +!12 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 214102:214133) (llvm/trunk 214102:214132)", isOptimized: false, emissionKind: 1, file: !13, enums: !14, retainedTypes: !14, subprograms: !16, globals: !11, imports: !11) !13 = !DIFile(filename: "b.cpp", directory: "") !14 = !{!15} !15 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "EA", line: 1, size: 32, align: 32, file: !13, elements: !4, identifier: "_ZTS2EA") !16 = !{!17} -!17 = !DISubprogram(name: "topB", linkageName: "_Z4topB2EA", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !13, scope: !18, type: !9, function: void (i32)* @_Z4topB2EA, variables: !11) +!17 = distinct !DISubprogram(name: "topB", linkageName: "_Z4topB2EA", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !13, scope: !18, type: !9, variables: !11) !18 = !DIFile(filename: "b.cpp", directory: "") !19 = !{i32 2, !"Dwarf Version", i32 2} !20 = !{i32 2, !"Debug Info Version", i32 3} !21 = !{!"clang version 3.5.0 (trunk 214102:214133) (llvm/trunk 214102:214132)"} -!22 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "sa", line: 5, arg: 1, scope: !7, file: !8, type: !"_ZTS2EA") +!22 = !DILocalVariable(name: "sa", line: 5, arg: 1, scope: !7, file: !8, type: !"_ZTS2EA") !23 = !DILocation(line: 5, column: 14, scope: !7) !24 = !DILocation(line: 6, column: 1, scope: !7) -!25 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "sa", line: 5, arg: 1, scope: !17, file: !18, type: !"_ZTS2EA") +!25 = !DILocalVariable(name: "sa", line: 5, arg: 1, scope: !17, file: !18, type: !"_ZTS2EA") !26 = !DILocation(line: 5, column: 14, scope: !17) !27 = !DILocation(line: 6, column: 1, scope: !17) diff --git a/test/DebugInfo/enum.ll b/test/DebugInfo/Generic/enum.ll index fd07a92ae41b..6d1bddc2f728 100644 --- a/test/DebugInfo/enum.ll +++ b/test/DebugInfo/Generic/enum.ll @@ -36,7 +36,7 @@ @a = global i64 0, align 8 ; Function Attrs: nounwind uwtable -define void @_Z4funcv() #0 { +define void @_Z4funcv() #0 !dbg !13 { entry: %b = alloca i32, align 4 call void @llvm.dbg.declare(metadata i32* %b, metadata !20, metadata !DIExpression()), !dbg !22 @@ -53,7 +53,7 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!19, !24} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !11, subprograms: !12, globals: !17, imports: !11) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !11, subprograms: !12, globals: !17, imports: !11) !1 = !DIFile(filename: "enum.cpp", directory: "/tmp") !2 = !{!3, !8} !3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "e1", line: 1, size: 64, align: 64, file: !1, elements: !4) @@ -66,14 +66,14 @@ attributes #1 = { nounwind readnone } !10 = !DIEnumerator(name: "X", value: 0) ; [ DW_TAG_enumerator ] [X :: 0] !11 = !{} !12 = !{!13} -!13 = !DISubprogram(name: "func", linkageName: "_Z4funcv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !14, type: !15, function: void ()* @_Z4funcv, variables: !11) +!13 = distinct !DISubprogram(name: "func", linkageName: "_Z4funcv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !14, type: !15, variables: !11) !14 = !DIFile(filename: "enum.cpp", directory: "/tmp") !15 = !DISubroutineType(types: !16) !16 = !{null} !17 = !{!18} !18 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !14, type: !3, variable: i64* @a) !19 = !{i32 2, !"Dwarf Version", i32 3} -!20 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "b", line: 4, scope: !13, file: !14, type: !21) +!20 = !DILocalVariable(name: "b", line: 4, scope: !13, file: !14, type: !21) !21 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !22 = !DILocation(line: 4, scope: !13) !23 = !DILocation(line: 5, scope: !13) diff --git a/test/DebugInfo/global.ll b/test/DebugInfo/Generic/global.ll index cf2d26b36acd..6cac9a2de05e 100644 --- a/test/DebugInfo/global.ll +++ b/test/DebugInfo/Generic/global.ll @@ -16,7 +16,7 @@ ; CHECK: DW_TAG_variable ; Function Attrs: nounwind readnone uwtable -define i32 @main() #0 { +define i32 @main() #0 !dbg !4 { entry: ret i32 0, !dbg !12 } @@ -26,11 +26,11 @@ attributes #0 = { nounwind readnone uwtable "less-precise-fpmad"="false" "no-fra !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!11, !13} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports: !2) !1 = !DIFile(filename: "global.cpp", directory: "/tmp") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "global.cpp", directory: "/tmp") !6 = !DISubroutineType(types: !7) !7 = !{!8} diff --git a/test/DebugInfo/gmlt.test b/test/DebugInfo/Generic/gmlt.test index 0514dbfc461a..0514dbfc461a 100644 --- a/test/DebugInfo/gmlt.test +++ b/test/DebugInfo/Generic/gmlt.test diff --git a/test/DebugInfo/Generic/gvn.ll b/test/DebugInfo/Generic/gvn.ll new file mode 100644 index 000000000000..f9fb7ab5520f --- /dev/null +++ b/test/DebugInfo/Generic/gvn.ll @@ -0,0 +1,114 @@ +; RUN: opt < %s -gvn -S | FileCheck %s +; +; Produced at -O2 from: +; int a, b; +; void f1(int *p1) { +; if (b) +; a = 1; +; if (a && *p1) +; f4(); +; } +; int f2(int); +; void f3(void) { +; a = f2(1); +; f1(&a); +; } +target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" +target triple = "arm64-apple-ios" + +@a = common global i32 0, align 4 +@b = common global i32 0, align 4 + +; Function Attrs: nounwind +define void @f3() #0 !dbg !12 { +entry: + ; Verify that the call still has a debug location after GVN. + ; CHECK: %call = tail call i32 @f2(i32 1) #{{[0-9]}}, !dbg + %call = tail call i32 @f2(i32 1) #3, !dbg !36 + store i32 %call, i32* @a, align 4, !dbg !36, !tbaa !25 + tail call void @llvm.dbg.value(metadata i32* @a, i64 0, metadata !11, metadata !21) #3, !dbg !39 + %0 = load i32, i32* @b, align 4, !dbg !39, !tbaa !25 + %tobool.i = icmp eq i32 %0, 0, !dbg !39 + br i1 %tobool.i, label %if.end.i, label %land.lhs.true.i.thread, !dbg !40 + +land.lhs.true.i.thread: ; preds = %entry + store i32 1, i32* @a, align 4, !dbg !41, !tbaa !25 + br label %if.then.3.i, !dbg !42 + +if.end.i: ; preds = %entry + ; This instruction has no debug location -- in this + ; particular case it was removed by a bug in SimplifyCFG. + %.pr = load i32, i32* @a, align 4 + + ; GVN is supposed to replace the load of %.pr with a direct reference to %call. + ; CHECK: %tobool2.i = icmp eq i32 %call, 0, !dbg + %tobool2.i = icmp eq i32 %.pr, 0, !dbg !43 + br i1 %tobool2.i, label %f1.exit, label %if.then.3.i, !dbg !43 + +if.then.3.i: ; preds = %if.end.i, %land.lhs.true.i.thread + %call.i = tail call i32 bitcast (i32 (...)* @f4 to i32 ()*)() #3, !dbg !44 + br label %f1.exit, !dbg !44 + +f1.exit: ; preds = %if.end.i, %if.then.3.i + ret void, !dbg !45 +} + +declare i32 @f2(i32) +declare i32 @f4(...) + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2 + +attributes #0 = { nounwind } +attributes #2 = { nounwind readnone } +attributes #3 = { nounwind } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!18, !19} +!llvm.ident = !{!20} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 245562) (llvm/trunk 245569)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3, globals: !15) +!1 = !DIFile(filename: "test.c", directory: "/") +!2 = !{} +!3 = !{!4, !12} +!4 = distinct !DISubprogram(name: "f1", scope: !1, file: !1, line: 2, type: !6, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, variables: !10) +!6 = !DISubroutineType(types: !7) +!7 = !{null, !8} +!8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64) +!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!10 = !{!11} +!11 = !DILocalVariable(name: "p1", arg: 1, scope: !4, file: !1, line: 2, type: !8) +!12 = distinct !DISubprogram(name: "f3", scope: !1, file: !1, line: 9, type: !13, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, variables: !2) +!13 = !DISubroutineType(types: !14) +!14 = !{null} +!15 = !{!16, !17} +!16 = !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 1, type: !9, isLocal: false, isDefinition: true, variable: i32* @a) +!17 = !DIGlobalVariable(name: "b", scope: !0, file: !1, line: 1, type: !9, isLocal: false, isDefinition: true, variable: i32* @b) +!18 = !{i32 2, !"Dwarf Version", i32 2} +!19 = !{i32 2, !"Debug Info Version", i32 3} +!20 = !{!"clang version 3.8.0 (trunk 245562) (llvm/trunk 245569)"} +!21 = !DIExpression() +!22 = !DILocation(line: 2, scope: !4) +!23 = !DILocation(line: 3, scope: !24) +!24 = distinct !DILexicalBlock(scope: !4, file: !1, line: 3) +!25 = !{!26, !26, i64 0} +!26 = !{!"int", !27, i64 0} +!27 = !{!"omnipotent char", !28, i64 0} +!28 = !{!"Simple C/C++ TBAA"} +!29 = !DILocation(line: 3, scope: !4) +!30 = !DILocation(line: 4, scope: !24) +!31 = !DILocation(line: 5, scope: !32) +!32 = distinct !DILexicalBlock(scope: !4, file: !1, line: 5) +!33 = !DILocation(line: 5, scope: !4) +!34 = !DILocation(line: 6, scope: !32) +!35 = !DILocation(line: 7, scope: !4) +!36 = !DILocation(line: 5, scope: !32, inlinedAt: !37) +!37 = distinct !DILocation(line: 11, scope: !12) +!38 = !DILocation(line: 10, scope: !12) +!39 = !DILocation(line: 2, scope: !4, inlinedAt: !37) +!40 = !DILocation(line: 3, scope: !24, inlinedAt: !37) +!41 = !DILocation(line: 3, scope: !4, inlinedAt: !37) +!42 = !DILocation(line: 4, scope: !24, inlinedAt: !37) +!43 = !DILocation(line: 5, scope: !4, inlinedAt: !37) +!44 = !DILocation(line: 6, scope: !32, inlinedAt: !37) +!45 = !DILocation(line: 12, scope: !12) diff --git a/test/DebugInfo/incorrect-variable-debugloc.ll b/test/DebugInfo/Generic/incorrect-variable-debugloc.ll index 930f8c92cf65..cf713ee3b970 100644 --- a/test/DebugInfo/incorrect-variable-debugloc.ll +++ b/test/DebugInfo/Generic/incorrect-variable-debugloc.ll @@ -38,11 +38,11 @@ ; CHECK: DW_TAG_structure_type ; CHECK-NEXT: DW_AT_name {{.*}} "C" -; CHECK: DW_TAG_subprogram -; CHECK-NOT: DW_TAG +; CHECK: [[M_FN3_DECL:.*]]: DW_TAG_subprogram +; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: DW_AT_name {{.*}} "m_fn3" -; CHECK: DW_AT_specification {{.*}} "_ZN1C5m_fn3Ev" +; CHECK: DW_AT_specification {{.*}} {[[M_FN3_DECL]]} ; CHECK-NOT: DW_TAG ; CHECK: DW_TAG_formal_parameter ; CHECK-NOT: DW_TAG @@ -58,7 +58,7 @@ @__asan_gen_1 = private unnamed_addr constant [13 x i8] c"1 32 1 3 tmp\00", align 1 ; Function Attrs: noreturn sanitize_address -define i32 @_Z3fn1v() #0 { +define i32 @_Z3fn1v() #0 !dbg !22 { entry: %MyAlloca = alloca [64 x i8], align 32, !dbg !39 %0 = ptrtoint [64 x i8]* %MyAlloca to i64, !dbg !39 @@ -116,7 +116,7 @@ entry: } ; Function Attrs: sanitize_address -define void @_ZN1C5m_fn3Ev(%struct.C* nocapture %this) #1 align 2 { +define void @_ZN1C5m_fn3Ev(%struct.C* nocapture %this) #1 align 2 !dbg !28 { entry: %MyAlloca = alloca [64 x i8], align 32, !dbg !48 %0 = ptrtoint [64 x i8]* %MyAlloca to i64, !dbg !48 @@ -336,7 +336,7 @@ attributes #3 = { nounwind readnone } !llvm.module.flags = !{!36, !37} !llvm.ident = !{!38} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !21, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !21, globals: !2, imports: !2) !1 = !DIFile(filename: "<stdin>", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4, !14} @@ -358,19 +358,19 @@ attributes #3 = { nounwind readnone } !19 = !{null, !20} !20 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1B") !21 = !{!22, !28, !32} -!22 = !DISubprogram(name: "fn1", linkageName: "_Z3fn1v", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 16, file: !5, scope: !23, type: !24, function: i32 ()* @_Z3fn1v, variables: !26) +!22 = distinct !DISubprogram(name: "fn1", linkageName: "_Z3fn1v", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 16, file: !5, scope: !23, type: !24, variables: !26) !23 = !DIFile(filename: "incorrect-variable-debug-loc.cpp", directory: "/tmp/dbginfo") !24 = !DISubroutineType(types: !25) !25 = !{!8} !26 = !{!27} -!27 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "A", line: 17, scope: !22, file: !23, type: !"_ZTS1C") -!28 = !DISubprogram(name: "m_fn3", linkageName: "_ZN1C5m_fn3Ev", line: 21, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 21, file: !5, scope: !"_ZTS1C", type: !11, function: void (%struct.C*)* @_ZN1C5m_fn3Ev, declaration: !10, variables: !29) +!27 = !DILocalVariable(name: "A", line: 17, scope: !22, file: !23, type: !"_ZTS1C") +!28 = distinct !DISubprogram(name: "m_fn3", linkageName: "_ZN1C5m_fn3Ev", line: 21, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 21, file: !5, scope: !"_ZTS1C", type: !11, declaration: !10, variables: !29) !29 = !{!30} -!30 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !31) +!30 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !31) !31 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1C") -!32 = !DISubprogram(name: "m_fn2", linkageName: "_ZN1B5m_fn2Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 6, file: !5, scope: !"_ZTS1B", type: !18, declaration: !17, variables: !33) +!32 = distinct !DISubprogram(name: "m_fn2", linkageName: "_ZN1B5m_fn2Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 6, file: !5, scope: !"_ZTS1B", type: !18, declaration: !17, variables: !33) !33 = !{!34} -!34 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !32, type: !35) +!34 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !32, type: !35) !35 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1B") !36 = !{i32 2, !"Dwarf Version", i32 4} !37 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/incorrect-variable-debugloc1.ll b/test/DebugInfo/Generic/incorrect-variable-debugloc1.ll index 3ece94ac8884..33af0baeb658 100644 --- a/test/DebugInfo/incorrect-variable-debugloc1.ll +++ b/test/DebugInfo/Generic/incorrect-variable-debugloc1.ll @@ -27,7 +27,7 @@ ; DWARF4: Location description: 10 0d 9f ; Function Attrs: uwtable -define i32 @main() #0 { +define i32 @main() #0 !dbg !4 { entry: %c = alloca i32, align 4 tail call void @llvm.dbg.value(metadata i32 13, i64 0, metadata !10, metadata !16), !dbg !17 @@ -53,17 +53,17 @@ attributes #2 = { nounwind readnone } !llvm.module.flags = !{!12, !13} !llvm.ident = !{!14} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 223522)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 223522)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "test.cpp", directory: "/home/kromanova/ngh/ToT_latest/llvm/test/DebugInfo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !9) +!4 = distinct !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !1, scope: !5, type: !6, variables: !9) !5 = !DIFile(filename: "test.cpp", directory: "/home/kromanova/ngh/ToT_latest/llvm/test/DebugInfo") !6 = !DISubroutineType(types: !7) !7 = !{!8} !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !9 = !{!10} -!10 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "c", line: 5, scope: !4, file: !5, type: !11) +!10 = !DILocalVariable(name: "c", line: 5, scope: !4, file: !5, type: !11) !11 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !8) !12 = !{i32 2, !"Dwarf Version", i32 2} !13 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/inheritance.ll b/test/DebugInfo/Generic/inheritance.ll index 8a29d2e576a0..802c4f195d47 100644 --- a/test/DebugInfo/inheritance.ll +++ b/test/DebugInfo/Generic/inheritance.ll @@ -105,11 +105,11 @@ return: ; preds = %bb2 declare void @_ZdlPv(i8*) nounwind -!0 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "tst", line: 13, scope: !1, file: !4, type: !8) +!0 = !DILocalVariable(name: "tst", line: 13, scope: !1, file: !4, type: !8) !1 = distinct !DILexicalBlock(line: 0, column: 0, file: !44, scope: !2) !2 = distinct !DILexicalBlock(line: 0, column: 0, file: !44, scope: !3) -!3 = !DISubprogram(name: "main", linkageName: "main", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !4, type: !5) -!4 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !44, enums: !45, retainedTypes: !45) +!3 = distinct !DISubprogram(name: "main", linkageName: "main", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !4, type: !5) +!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !44, enums: !45, retainedTypes: !45) !5 = !DISubroutineType(types: !6) !6 = !{!7} !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) @@ -118,7 +118,7 @@ declare void @_ZdlPv(i8*) nounwind !10 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$test1", line: 1, size: 64, align: 64, file: !44, scope: !8, baseType: !11) !11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !4, baseType: !12) !12 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", scope: !4, baseType: !5) -!13 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !46, enums: !45, retainedTypes: !45) +!13 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !46, enums: !45, retainedTypes: !45) !14 = !DISubprogram(name: "test1", line: 1, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrivate, isOptimized: false, scope: !8, type: !15) !15 = !DISubroutineType(types: !16) !16 = !{null, !17} @@ -129,22 +129,22 @@ declare void @_ZdlPv(i8*) nounwind !21 = !DILocation(line: 11, scope: !1) !22 = !DILocation(line: 13, scope: !1) !23 = !DILocation(line: 14, scope: !1) -!24 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 13, arg: 0, scope: !25, file: !4, type: !26) -!25 = !DISubprogram(name: "test1", linkageName: "_ZN5test1C1Ev", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !4, type: !15) +!24 = !DILocalVariable(name: "this", line: 13, arg: 1, scope: !25, file: !4, type: !26) +!25 = distinct !DISubprogram(name: "test1", linkageName: "_ZN5test1C1Ev", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scope: !4, type: !15) !26 = !DIDerivedType(tag: DW_TAG_const_type, size: 64, align: 64, flags: DIFlagArtificial, file: !4, baseType: !27) !27 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !4, baseType: !8) !28 = !DILocation(line: 1, scope: !25) !29 = !DILocation(line: 1, scope: !30) !30 = distinct !DILexicalBlock(line: 0, column: 0, file: !44, scope: !31) !31 = distinct !DILexicalBlock(line: 0, column: 0, file: !44, scope: !25) -!32 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 4, arg: 0, scope: !33, file: !4, type: !26) -!33 = !DISubprogram(name: "~test1", linkageName: "_ZN5test1D1Ev", line: 4, isLocal: false, isDefinition: true, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, isOptimized: false, scope: !8, type: !15, containingType: !8) +!32 = !DILocalVariable(name: "this", line: 4, arg: 1, scope: !33, file: !4, type: !26) +!33 = distinct !DISubprogram(name: "~test1", linkageName: "_ZN5test1D1Ev", line: 4, isLocal: false, isDefinition: true, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, isOptimized: false, scope: !8, type: !15, containingType: !8) !34 = !DILocation(line: 4, scope: !33) !35 = !DILocation(line: 5, scope: !36) !36 = distinct !DILexicalBlock(line: 0, column: 0, file: !44, scope: !33) !37 = !DILocation(line: 6, scope: !36) -!38 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 4, arg: 0, scope: !39, file: !4, type: !26) -!39 = !DISubprogram(name: "~test1", linkageName: "_ZN5test1D0Ev", line: 4, isLocal: false, isDefinition: true, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, isOptimized: false, scope: !8, type: !15, containingType: !8) +!38 = !DILocalVariable(name: "this", line: 4, arg: 1, scope: !39, file: !4, type: !26) +!39 = distinct !DISubprogram(name: "~test1", linkageName: "_ZN5test1D0Ev", line: 4, isLocal: false, isDefinition: true, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, isOptimized: false, scope: !8, type: !15, containingType: !8) !40 = !DILocation(line: 4, scope: !39) !41 = !DILocation(line: 5, scope: !42) !42 = distinct !DILexicalBlock(line: 0, column: 0, file: !44, scope: !39) diff --git a/test/DebugInfo/inline-debug-info-multiret.ll b/test/DebugInfo/Generic/inline-debug-info-multiret.ll index d86e6abbd80b..5be261ac3741 100644 --- a/test/DebugInfo/inline-debug-info-multiret.ll +++ b/test/DebugInfo/Generic/inline-debug-info-multiret.ll @@ -21,7 +21,7 @@ target triple = "x86_64-apple-darwin12.0.0" @global_var = external global i32 ; copy of above function with multiple returns -define i32 @_Z4testi(i32 %k) { +define i32 @_Z4testi(i32 %k) !dbg !4 { entry: %retval = alloca i32, align 4 %k.addr = alloca i32, align 4 @@ -57,7 +57,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 declare i32 @_Z8test_exti(i32) -define i32 @_Z5test2v() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define i32 @_Z5test2v() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !10 { entry: %exn.slot = alloca i8* %ehselector.slot = alloca i32 @@ -122,22 +122,22 @@ attributes #2 = { nounwind } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!31} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "<unknown>", directory: "") !2 = !{} !3 = !{!4, !10} -!4 = !DISubprogram(name: "test", linkageName: "_Z4testi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !5, scope: !6, type: !7, function: i32 (i32)* @_Z4testi, variables: !2) +!4 = distinct !DISubprogram(name: "test", linkageName: "_Z4testi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !5, scope: !6, type: !7, variables: !2) !5 = !DIFile(filename: "test.cpp", directory: "") !6 = !DIFile(filename: "test.cpp", directory: "") !7 = !DISubroutineType(types: !8) !8 = !{!9, !9} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = !DISubprogram(name: "test2", linkageName: "_Z5test2v", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 11, file: !5, scope: !6, type: !11, function: i32 ()* @_Z5test2v, variables: !2) +!10 = distinct !DISubprogram(name: "test2", linkageName: "_Z5test2v", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 11, file: !5, scope: !6, type: !11, variables: !2) !11 = !DISubroutineType(types: !12) !12 = !{!9} -!13 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "k", line: 4, arg: 1, scope: !4, file: !6, type: !9) +!13 = !DILocalVariable(name: "k", line: 4, arg: 1, scope: !4, file: !6, type: !9) !14 = !DILocation(line: 4, scope: !4) -!15 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "k2", line: 5, scope: !4, file: !6, type: !9) +!15 = !DILocalVariable(name: "k2", line: 5, scope: !4, file: !6, type: !9) !16 = !DILocation(line: 5, scope: !4) !17 = !DILocation(line: 6, scope: !4) !18 = !DILocation(line: 7, scope: !4) @@ -146,7 +146,7 @@ attributes #2 = { nounwind } !21 = !DILocation(line: 14, scope: !22) !22 = distinct !DILexicalBlock(line: 13, column: 0, file: !5, scope: !10) !23 = !DILocation(line: 15, scope: !22) -!24 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "e", line: 16, scope: !10, file: !6, type: !9) +!24 = !DILocalVariable(name: "e", line: 16, scope: !10, file: !6, type: !9) !25 = !DILocation(line: 16, scope: !10) !26 = !DILocation(line: 17, scope: !27) !27 = distinct !DILexicalBlock(line: 16, column: 0, file: !5, scope: !10) diff --git a/test/DebugInfo/inline-debug-info.ll b/test/DebugInfo/Generic/inline-debug-info.ll index 908093ca2552..a5d55a4f98a1 100644 --- a/test/DebugInfo/inline-debug-info.ll +++ b/test/DebugInfo/Generic/inline-debug-info.ll @@ -41,7 +41,7 @@ target triple = "x86_64-apple-darwin12.0.0" @_ZTIi = external constant i8* @global_var = external global i32 -define i32 @_Z4testi(i32 %k) { +define i32 @_Z4testi(i32 %k) !dbg !4 { entry: %retval = alloca i32, align 4 %k.addr = alloca i32, align 4 @@ -75,7 +75,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 declare i32 @_Z8test_exti(i32) -define i32 @_Z5test2v() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define i32 @_Z5test2v() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !10 { entry: %exn.slot = alloca i8* %ehselector.slot = alloca i32 @@ -140,22 +140,22 @@ attributes #2 = { nounwind } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!31} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "<unknown>", directory: "") !2 = !{} !3 = !{!4, !10} -!4 = !DISubprogram(name: "test", linkageName: "_Z4testi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !5, scope: !6, type: !7, function: i32 (i32)* @_Z4testi, variables: !2) +!4 = distinct !DISubprogram(name: "test", linkageName: "_Z4testi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !5, scope: !6, type: !7, variables: !2) !5 = !DIFile(filename: "test.cpp", directory: "") !6 = !DIFile(filename: "test.cpp", directory: "") !7 = !DISubroutineType(types: !8) !8 = !{!9, !9} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = !DISubprogram(name: "test2", linkageName: "_Z5test2v", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 11, file: !5, scope: !6, type: !11, function: i32 ()* @_Z5test2v, variables: !2) +!10 = distinct !DISubprogram(name: "test2", linkageName: "_Z5test2v", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 11, file: !5, scope: !6, type: !11, variables: !2) !11 = !DISubroutineType(types: !12) !12 = !{!9} -!13 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "k", line: 4, arg: 1, scope: !4, file: !6, type: !9) +!13 = !DILocalVariable(name: "k", line: 4, arg: 1, scope: !4, file: !6, type: !9) !14 = !DILocation(line: 4, scope: !4) -!15 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "k2", line: 5, scope: !4, file: !6, type: !9) +!15 = !DILocalVariable(name: "k2", line: 5, scope: !4, file: !6, type: !9) !16 = !DILocation(line: 5, scope: !4) !17 = !DILocation(line: 6, scope: !4) !18 = !DILocation(line: 7, scope: !4) @@ -164,7 +164,7 @@ attributes #2 = { nounwind } !21 = !DILocation(line: 14, scope: !22) !22 = distinct !DILexicalBlock(line: 13, column: 0, file: !5, scope: !10) !23 = !DILocation(line: 15, scope: !22) -!24 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "e", line: 16, scope: !10, file: !6, type: !9) +!24 = !DILocalVariable(name: "e", line: 16, scope: !10, file: !6, type: !9) !25 = !DILocation(line: 16, scope: !10) !26 = !DILocation(line: 17, scope: !27) !27 = distinct !DILexicalBlock(line: 16, column: 0, file: !5, scope: !10) diff --git a/test/DebugInfo/inline-no-debug-info.ll b/test/DebugInfo/Generic/inline-no-debug-info.ll index 9ecd58031eb1..443ba9da6b59 100644 --- a/test/DebugInfo/inline-no-debug-info.ll +++ b/test/DebugInfo/Generic/inline-no-debug-info.ll @@ -43,7 +43,7 @@ entry: } ; Function Attrs: nounwind uwtable -define void @caller() #0 { +define void @caller() #0 !dbg !4 { entry: tail call void @callee(), !dbg !12 ret void, !dbg !12 @@ -55,14 +55,14 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (210174)", isOptimized: true, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (210174)", isOptimized: true, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "test.c", directory: "/code/llvm/build0") !2 = !{} !3 = !{!4, !7} -!4 = !DISubprogram(name: "caller", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 4, file: !1, scope: !5, type: !6, function: void ()* @caller, variables: !2) +!4 = distinct !DISubprogram(name: "caller", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 4, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "test.c", directory: "/code/llvm/build0") !6 = !DISubroutineType(types: !2) -!7 = !DISubprogram(name: "callee2", line: 2, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) +!7 = distinct !DISubprogram(name: "callee2", line: 2, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) !8 = !{i32 2, !"Dwarf Version", i32 4} !9 = !{i32 2, !"Debug Info Version", i32 3} !10 = !{!"clang version 3.5.0 (210174)"} diff --git a/test/DebugInfo/inline-scopes.ll b/test/DebugInfo/Generic/inline-scopes.ll index 45324f6a4b96..432c58b79e14 100644 --- a/test/DebugInfo/inline-scopes.ll +++ b/test/DebugInfo/Generic/inline-scopes.ll @@ -37,7 +37,7 @@ ; CHECK: DW_AT_abstract_origin ; Function Attrs: uwtable -define i32 @main() #0 { +define i32 @main() #0 !dbg !4 { entry: %retval.i2 = alloca i32, align 4 %b.i3 = alloca i8, align 1 @@ -95,23 +95,23 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.module.flags = !{!13, !14} !llvm.ident = !{!15} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "inline-scopes.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4, !10, !12} -!4 = !DISubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !5, scope: !6, type: !7, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !5, scope: !6, type: !7, variables: !2) !5 = !DIFile(filename: "y.cc", directory: "/tmp/dbginfo") !6 = !DIFile(filename: "y.cc", directory: "/tmp/dbginfo") !7 = !DISubroutineType(types: !8) !8 = !{!9} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = !DISubprogram(name: "f2", linkageName: "_Z2f2v", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !11, type: !7, variables: !2) +!10 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !11, type: !7, variables: !2) !11 = !DIFile(filename: "inline-scopes.cpp", directory: "/tmp/dbginfo") -!12 = !DISubprogram(name: "f1", linkageName: "_Z2f1v", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !11, type: !7, variables: !2) +!12 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !11, type: !7, variables: !2) !13 = !{i32 2, !"Dwarf Version", i32 4} !14 = !{i32 1, !"Debug Info Version", i32 3} !15 = !{!"clang version 3.5.0 "} -!16 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "b", line: 3, scope: !17, file: !11, type: !18) +!16 = !DILocalVariable(name: "b", line: 3, scope: !17, file: !11, type: !18) !17 = distinct !DILexicalBlock(line: 3, column: 0, file: !1, scope: !12) !18 = !DIBasicType(tag: DW_TAG_base_type, name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean) !19 = !DILocation(line: 3, scope: !17, inlinedAt: !20) @@ -119,7 +119,7 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !21 = !DILocation(line: 4, scope: !17, inlinedAt: !20) !22 = !DILocation(line: 5, scope: !12, inlinedAt: !20) !23 = !DILocation(line: 6, scope: !12, inlinedAt: !20) -!24 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "b", line: 2, scope: !25, file: !6, type: !18) +!24 = !DILocalVariable(name: "b", line: 2, scope: !25, file: !6, type: !18) !25 = distinct !DILexicalBlock(line: 2, column: 0, file: !5, scope: !26) !26 = !DILexicalBlockFile(discriminator: 0, file: !5, scope: !10) !27 = !DILocation(line: 2, scope: !25, inlinedAt: !28) diff --git a/test/DebugInfo/inlined-arguments.ll b/test/DebugInfo/Generic/inlined-arguments.ll index 912ebb1321ee..af4820845a03 100644 --- a/test/DebugInfo/inlined-arguments.ll +++ b/test/DebugInfo/Generic/inlined-arguments.ll @@ -23,7 +23,7 @@ ; CHECK: DW_AT_name{{.*}}"y" ; Function Attrs: uwtable -define void @_Z2f2v() #0 { +define void @_Z2f2v() #0 !dbg !4 { tail call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !16, metadata !DIExpression()), !dbg !18 tail call void @llvm.dbg.value(metadata i32 2, i64 0, metadata !20, metadata !DIExpression()), !dbg !18 tail call void @_Z2f3i(i32 2), !dbg !21 @@ -31,7 +31,7 @@ define void @_Z2f2v() #0 { } ; Function Attrs: uwtable -define void @_Z2f1ii(i32 %x, i32 %y) #0 { +define void @_Z2f1ii(i32 %x, i32 %y) #0 !dbg !8 { tail call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !13, metadata !DIExpression()), !dbg !23 tail call void @llvm.dbg.value(metadata i32 %y, i64 0, metadata !14, metadata !DIExpression()), !dbg !23 tail call void @_Z2f3i(i32 %y), !dbg !24 @@ -50,27 +50,27 @@ attributes #2 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!26} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "exp.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch") !2 = !{} !3 = !{!4, !8} -!4 = !DISubprogram(name: "f2", linkageName: "_Z2f2v", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, function: void ()* @_Z2f2v, variables: !2) +!4 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "exp.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch") !6 = !DISubroutineType(types: !7) !7 = !{null} -!8 = !DISubprogram(name: "f1", linkageName: "_Z2f1ii", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 6, file: !1, scope: !5, type: !9, function: void (i32, i32)* @_Z2f1ii, variables: !12) +!8 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1ii", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 6, file: !1, scope: !5, type: !9, variables: !12) !9 = !DISubroutineType(types: !10) !10 = !{null, !11, !11} !11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !12 = !{!13, !14} -!13 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11) -!14 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11) +!13 = !DILocalVariable(name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11) +!14 = !DILocalVariable(name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11) !15 = !{i32 undef} -!16 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11) +!16 = !DILocalVariable(name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11) !17 = !DILocation(line: 4, scope: !4) !18 = !DILocation(line: 6, scope: !8, inlinedAt: !17) !19 = !{i32 2} -!20 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11) +!20 = !DILocalVariable(name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11) !21 = !DILocation(line: 7, scope: !8, inlinedAt: !17) !22 = !DILocation(line: 5, scope: !4) !23 = !DILocation(line: 6, scope: !8) diff --git a/test/DebugInfo/inlined-vars.ll b/test/DebugInfo/Generic/inlined-vars.ll index 8c7823748864..a294380bb5c8 100644 --- a/test/DebugInfo/inlined-vars.ll +++ b/test/DebugInfo/Generic/inlined-vars.ll @@ -2,7 +2,7 @@ ; RUN: %llc_dwarf -O0 < %s | FileCheck %s -check-prefix VARIABLE ; PR 13202 -define i32 @main() uwtable { +define i32 @main() uwtable !dbg !5 { entry: tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !18, metadata !DIExpression()), !dbg !21 tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !22, metadata !DIExpression()), !dbg !23 @@ -18,37 +18,37 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!27} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 159419)", isOptimized: true, emissionKind: 0, file: !26, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 159419)", isOptimized: true, emissionKind: 0, file: !26, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !{i32 0} !2 = !{} !3 = !{!5, !10} -!5 = !DISubprogram(name: "main", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 10, file: !26, scope: !6, type: !7, function: i32 ()* @main, variables: !2) +!5 = distinct !DISubprogram(name: "main", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 10, file: !26, scope: !6, type: !7, variables: !2) !6 = !DIFile(filename: "inline-bug.cc", directory: "/tmp/dbginfo/pr13202") !7 = !DISubroutineType(types: !8) !8 = !{!9} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = !DISubprogram(name: "f", linkageName: "_ZL1fi", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !26, scope: !6, type: !11, variables: !13) +!10 = distinct !DISubprogram(name: "f", linkageName: "_ZL1fi", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !26, scope: !6, type: !11, variables: !13) !11 = !DISubroutineType(types: !12) !12 = !{!9, !9} !13 = !{!15, !16} -!15 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argument", line: 3, arg: 1, scope: !10, file: !6, type: !9) +!15 = !DILocalVariable(name: "argument", line: 3, arg: 1, scope: !10, file: !6, type: !9) ; Two DW_TAG_formal_parameter: one abstract and one inlined. ; ARGUMENT: {{.*Abbrev.*DW_TAG_formal_parameter}} ; ARGUMENT: {{.*Abbrev.*DW_TAG_formal_parameter}} ; ARGUMENT-NOT: {{.*Abbrev.*DW_TAG_formal_parameter}} -!16 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "local", line: 4, scope: !10, file: !6, type: !9) +!16 = !DILocalVariable(name: "local", line: 4, scope: !10, file: !6, type: !9) ; Two DW_TAG_variable: one abstract and one inlined. ; VARIABLE: {{.*Abbrev.*DW_TAG_variable}} ; VARIABLE: {{.*Abbrev.*DW_TAG_variable}} ; VARIABLE-NOT: {{.*Abbrev.*DW_TAG_variable}} -!18 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argument", line: 3, arg: 1, scope: !10, file: !6, type: !9) +!18 = !DILocalVariable(name: "argument", line: 3, arg: 1, scope: !10, file: !6, type: !9) !19 = !DILocation(line: 11, column: 10, scope: !5) !21 = !DILocation(line: 3, column: 25, scope: !10, inlinedAt: !19) -!22 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "local", line: 4, scope: !10, file: !6, type: !9) +!22 = !DILocalVariable(name: "local", line: 4, scope: !10, file: !6, type: !9) !23 = !DILocation(line: 4, column: 16, scope: !10, inlinedAt: !19) !24 = !DILocation(line: 5, column: 3, scope: !10, inlinedAt: !19) !25 = !DILocation(line: 6, column: 3, scope: !10, inlinedAt: !19) diff --git a/test/DebugInfo/Generic/lit.local.cfg b/test/DebugInfo/Generic/lit.local.cfg new file mode 100644 index 000000000000..f22d4aabd730 --- /dev/null +++ b/test/DebugInfo/Generic/lit.local.cfg @@ -0,0 +1,3 @@ +if not config.target_triple: + config.unsupported = True + diff --git a/test/DebugInfo/location-verifier.ll b/test/DebugInfo/Generic/location-verifier.ll index f44a37d7fca5..aa725a2369a4 100644 --- a/test/DebugInfo/location-verifier.ll +++ b/test/DebugInfo/Generic/location-verifier.ll @@ -4,7 +4,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.10.0" ; Function Attrs: nounwind ssp uwtable -define i32 @foo() #0 { +define i32 @foo() #0 !dbg !4 { entry: ret i32 42, !dbg !13 } @@ -15,11 +15,11 @@ attributes #0 = { nounwind ssp uwtable } !llvm.module.flags = !{!9, !10, !11} !llvm.ident = !{!12} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "test.c", directory: "") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 ()* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "test.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{!8} diff --git a/test/DebugInfo/lto-comp-dir.ll b/test/DebugInfo/Generic/lto-comp-dir.ll index 4bafb7bdd2e7..8d5da504a82e 100644 --- a/test/DebugInfo/lto-comp-dir.ll +++ b/test/DebugInfo/Generic/lto-comp-dir.ll @@ -40,13 +40,13 @@ ; } ; Function Attrs: nounwind uwtable -define void @_Z4funcv() #0 { +define void @_Z4funcv() #0 !dbg !4 { entry: ret void, !dbg !19 } ; Function Attrs: uwtable -define i32 @main() #1 { +define i32 @main() #1 !dbg !11 { entry: call void @_Z4funcv(), !dbg !20 ret i32 0, !dbg !21 @@ -59,18 +59,18 @@ attributes #1 = { uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"=" !llvm.module.flags = !{!16, !17} !llvm.ident = !{!18, !18} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo/a") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "func", linkageName: "_Z4funcv", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void ()* @_Z4funcv, variables: !2) +!4 = distinct !DISubprogram(name: "func", linkageName: "_Z4funcv", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "a.cpp", directory: "/tmp/dbginfo/a") !6 = !DISubroutineType(types: !7) !7 = !{null} -!8 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !9, enums: !2, retainedTypes: !2, subprograms: !10, globals: !2, imports: !2) +!8 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !9, enums: !2, retainedTypes: !2, subprograms: !10, globals: !2, imports: !2) !9 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo/b") !10 = !{!11} -!11 = !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !9, scope: !12, type: !13, function: i32 ()* @main, variables: !2) +!11 = distinct !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !9, scope: !12, type: !13, variables: !2) !12 = !DIFile(filename: "b.cpp", directory: "/tmp/dbginfo/b") !13 = !DISubroutineType(types: !14) !14 = !{!15} diff --git a/test/DebugInfo/member-order.ll b/test/DebugInfo/Generic/member-order.ll index f07e4f85cded..55ada4f829b7 100644 --- a/test/DebugInfo/member-order.ll +++ b/test/DebugInfo/Generic/member-order.ll @@ -25,7 +25,7 @@ %struct.foo = type { i8 } ; Function Attrs: nounwind uwtable -define void @_ZN3foo2f1Ev(%struct.foo* %this) #0 align 2 { +define void @_ZN3foo2f1Ev(%struct.foo* %this) #0 align 2 !dbg !14 { entry: %this.addr = alloca %struct.foo*, align 8 store %struct.foo* %this, %struct.foo** %this.addr, align 8 @@ -43,7 +43,7 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!15, !20} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !13, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !13, globals: !2, imports: !2) !1 = !DIFile(filename: "member-order.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} @@ -57,9 +57,9 @@ attributes #1 = { nounwind readnone } !11 = !DISubprogram(name: "f2", linkageName: "_ZN3foo2f2Ev", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !4, type: !7) !12 = !{i32 786468} !13 = !{!14} -!14 = !DISubprogram(name: "f1", linkageName: "_ZN3foo2f1Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: null, type: !7, function: void (%struct.foo*)* @_ZN3foo2f1Ev, declaration: !6, variables: !2) +!14 = distinct !DISubprogram(name: "f1", linkageName: "_ZN3foo2f1Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: null, type: !7, declaration: !6, variables: !2) !15 = !{i32 2, !"Dwarf Version", i32 4} -!16 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !14, type: !17) +!16 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !14, type: !17) !17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS3foo") !18 = !DILocation(line: 0, scope: !14) !19 = !DILocation(line: 7, scope: !14) diff --git a/test/DebugInfo/member-pointers.ll b/test/DebugInfo/Generic/member-pointers.ll index 0cf9ead84218..1570c07ddb22 100644 --- a/test/DebugInfo/member-pointers.ll +++ b/test/DebugInfo/Generic/member-pointers.ll @@ -23,7 +23,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!16} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 0, file: !15, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 0, file: !15, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) !1 = !{} !3 = !{!5, !10} !5 = !DIGlobalVariable(name: "x", line: 4, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i64* @x) diff --git a/test/DebugInfo/missing-abstract-variable.ll b/test/DebugInfo/Generic/missing-abstract-variable.ll index 8a576c2bfd34..ee4f1666d2b7 100644 --- a/test/DebugInfo/missing-abstract-variable.ll +++ b/test/DebugInfo/Generic/missing-abstract-variable.ll @@ -5,7 +5,7 @@ ; The formal parameter 'b' for Function 'x' when inlined within 'a' is lost on ; mips and powerpc64 (and on x86_64 at at least -O2). Presumably this is a ; SelectionDAG issue (do mips/powerpc64 use FastISel?). -; XFAIL: mips, powerpc64, s390x +; XFAIL: mips, powerpc64, s390x, sparc ; Build from the following source with clang -O2. @@ -37,7 +37,7 @@ ; x(u); ; } -; CHECK: DW_TAG_subprogram +; CHECK: [[X_DECL:.*]]: DW_TAG_subprogram ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "x" ; CHECK-NOT: {{DW_TAG|NULL}} @@ -57,7 +57,7 @@ ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: DW_TAG_inlined_subroutine ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_abstract_origin {{.*}} "_Z1xb" +; CHECK: DW_AT_abstract_origin {{.*}} {[[X_DECL]]} ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: DW_TAG_formal_parameter ; CHECK-NOT: DW_TAG @@ -78,7 +78,7 @@ ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: DW_TAG_inlined_subroutine ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_abstract_origin {{.*}} "_Z1xb" +; CHECK: DW_AT_abstract_origin {{.*}} {[[X_DECL]]} ; CHECK-NOT: {{DW_TAG|NULL}} ; FIXME: This formal parameter goes missing at least at -O2 (& on ; mips/powerpc), maybe before that. Perhaps SelectionDAG is to blame (and @@ -97,7 +97,7 @@ @t = external global i32 ; Function Attrs: uwtable -define void @_Z1bv() #0 { +define void @_Z1bv() #0 !dbg !4 { entry: tail call void @llvm.dbg.value(metadata i1 false, i64 0, metadata !25, metadata !DIExpression()), !dbg !27 tail call void @_Z1fi(i32 0), !dbg !28 @@ -105,7 +105,7 @@ entry: } ; Function Attrs: uwtable -define void @_Z1ab(i1 zeroext %u) #0 { +define void @_Z1ab(i1 zeroext %u) #0 !dbg !8 { entry: tail call void @llvm.dbg.value(metadata i1 %u, i64 0, metadata !13, metadata !DIExpression()), !dbg !30 tail call void @llvm.dbg.value(metadata i1 %u, i64 0, metadata !31, metadata !DIExpression()), !dbg !33 @@ -135,24 +135,24 @@ attributes #2 = { nounwind readnone } !llvm.module.flags = !{!21, !22} !llvm.ident = !{!23} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "missing-abstract-variables.cc", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4, !8, !14} -!4 = !DISubprogram(name: "b", linkageName: "_Z1bv", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !1, scope: !5, type: !6, function: void ()* @_Z1bv, variables: !2) +!4 = distinct !DISubprogram(name: "b", linkageName: "_Z1bv", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "missing-abstract-variables.cc", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !7) !7 = !{null} -!8 = !DISubprogram(name: "a", linkageName: "_Z1ab", line: 17, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 17, file: !1, scope: !5, type: !9, function: void (i1)* @_Z1ab, variables: !12) +!8 = distinct !DISubprogram(name: "a", linkageName: "_Z1ab", line: 17, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 17, file: !1, scope: !5, type: !9, variables: !12) !9 = !DISubroutineType(types: !10) !10 = !{null, !11} !11 = !DIBasicType(tag: DW_TAG_base_type, name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean) !12 = !{!13} -!13 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "u", line: 17, arg: 1, scope: !8, file: !5, type: !11) -!14 = !DISubprogram(name: "x", linkageName: "_Z1xb", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !9, variables: !15) +!13 = !DILocalVariable(name: "u", line: 17, arg: 1, scope: !8, file: !5, type: !11) +!14 = distinct !DISubprogram(name: "x", linkageName: "_Z1xb", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !9, variables: !15) !15 = !{!16, !17} -!16 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 5, arg: 1, scope: !14, file: !5, type: !11) -!17 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "s", line: 7, scope: !18, file: !5, type: !20) +!16 = !DILocalVariable(name: "b", line: 5, arg: 1, scope: !14, file: !5, type: !11) +!17 = !DILocalVariable(name: "s", line: 7, scope: !18, file: !5, type: !20) !18 = distinct !DILexicalBlock(line: 6, column: 0, file: !1, scope: !19) !19 = distinct !DILexicalBlock(line: 6, column: 0, file: !1, scope: !14) !20 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) @@ -160,13 +160,13 @@ attributes #2 = { nounwind readnone } !22 = !{i32 2, !"Debug Info Version", i32 3} !23 = !{!"clang version 3.5.0 "} !24 = !{i1 false} -!25 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 5, arg: 1, scope: !14, file: !5, type: !11) +!25 = !DILocalVariable(name: "b", line: 5, arg: 1, scope: !14, file: !5, type: !11) !26 = !DILocation(line: 14, scope: !4) !27 = !DILocation(line: 5, scope: !14, inlinedAt: !26) !28 = !DILocation(line: 10, scope: !14, inlinedAt: !26) !29 = !DILocation(line: 15, scope: !4) !30 = !DILocation(line: 17, scope: !8) -!31 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 5, arg: 1, scope: !14, file: !5, type: !11) +!31 = !DILocalVariable(name: "b", line: 5, arg: 1, scope: !14, file: !5, type: !11) !32 = !DILocation(line: 18, scope: !8) !33 = !DILocation(line: 5, scope: !14, inlinedAt: !32) !34 = !DILocation(line: 6, scope: !19, inlinedAt: !32) @@ -175,7 +175,7 @@ attributes #2 = { nounwind readnone } !37 = !{!"int", !38, i64 0} !38 = !{!"omnipotent char", !39, i64 0} !39 = !{!"Simple C/C++ TBAA"} -!40 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "s", line: 7, scope: !18, file: !5, type: !20) +!40 = !DILocalVariable(name: "s", line: 7, scope: !18, file: !5, type: !20) !41 = !DILocation(line: 8, scope: !18, inlinedAt: !32) !42 = !DILocation(line: 9, scope: !18, inlinedAt: !32) !43 = !DILocation(line: 10, scope: !14, inlinedAt: !32) diff --git a/test/DebugInfo/multiline.ll b/test/DebugInfo/Generic/multiline.ll index e6b43239fda3..7740bb6918a2 100644 --- a/test/DebugInfo/multiline.ll +++ b/test/DebugInfo/Generic/multiline.ll @@ -42,7 +42,7 @@ ; Function Attrs: nounwind uwtable -define void @f2() #0 { +define void @f2() #0 !dbg !4 { entry: call void (...) @f1(), !dbg !11 call void (...) @f1(), !dbg !12 @@ -62,11 +62,11 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 (trunk 225000) (llvm/trunk 224999)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 (trunk 225000) (llvm/trunk 224999)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "multiline.c", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "f2", line: 2, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: void ()* @f2, variables: !2) +!4 = distinct !DISubprogram(name: "f2", line: 2, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "multiline.c", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !7) !7 = !{null} diff --git a/test/DebugInfo/namespace.ll b/test/DebugInfo/Generic/namespace.ll index 85ef7356205c..e446806249f9 100644 --- a/test/DebugInfo/namespace.ll +++ b/test/DebugInfo/Generic/namespace.ll @@ -1,7 +1,6 @@ ; REQUIRES: object-emission -; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t -; RUN: llvm-dwarfdump %t | FileCheck %s +; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=Enable < %s | llvm-dwarfdump - | FileCheck %s ; CHECK: debug_info contents ; CHECK: [[NS1:0x[0-9a-f]*]]:{{ *}}DW_TAG_namespace ; CHECK-NEXT: DW_AT_name{{.*}} = "A" @@ -206,13 +205,13 @@ @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_debug_info_namespace.cpp, i8* null }] ; Function Attrs: nounwind ssp uwtable -define i32 @_ZN1A1B2f1Ev() #0 { +define i32 @_ZN1A1B2f1Ev() #0 !dbg !10 { entry: ret i32 0, !dbg !60 } ; Function Attrs: nounwind ssp uwtable -define void @_ZN1A1B2f1Ei(i32) #0 { +define void @_ZN1A1B2f1Ei(i32) #0 !dbg !14 { entry: %.addr = alloca i32, align 4 store i32 %0, i32* %.addr, align 4 @@ -223,7 +222,7 @@ entry: ; Function Attrs: nounwind readnone declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 -define internal void @__cxx_global_var_init() section "__TEXT,__StaticInit,regular,pure_instructions" { +define internal void @__cxx_global_var_init() section "__TEXT,__StaticInit,regular,pure_instructions" !dbg !17 { entry: %call = call i32 @_ZN1A1B2f1Ev(), !dbg !65 store i32 %call, i32* @_ZN1A1B1iE, align 4, !dbg !65 @@ -231,7 +230,7 @@ entry: } ; Function Attrs: nounwind ssp uwtable -define i32 @_Z4funcb(i1 zeroext %b) #0 { +define i32 @_Z4funcb(i1 zeroext %b) #0 !dbg !21 { entry: %retval = alloca i32, align 4 %b.addr = alloca i8, align 1 @@ -261,7 +260,7 @@ return: ; preds = %if.end, %if.then ret i32 %5, !dbg !71 } -define internal void @__cxx_global_var_init1() section "__TEXT,__StaticInit,regular,pure_instructions" { +define internal void @__cxx_global_var_init1() section "__TEXT,__StaticInit,regular,pure_instructions" !dbg !25 { entry: %0 = load i32, i32* @_ZN1A1B1iE, align 4, !dbg !72 store i32 %0, i32* @_ZN1A1B7var_fwdE, align 4, !dbg !72 @@ -269,7 +268,7 @@ entry: } ; Function Attrs: nounwind ssp uwtable -define void @_ZN1A1B8func_fwdEv() #0 { +define void @_ZN1A1B8func_fwdEv() #0 !dbg !26 { entry: ret void, !dbg !73 } @@ -288,7 +287,7 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!57, !58} !llvm.ident = !{!59} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !30, imports: !33) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !30, imports: !33) !1 = !DIFile(filename: "debug-info-namespace.cpp", directory: "/tmp") !2 = !{} !3 = !{!4, !8} @@ -298,24 +297,24 @@ attributes #1 = { nounwind readnone } !7 = !DINamespace(name: "A", line: 5, file: !1, scope: null) !8 = !DICompositeType(tag: DW_TAG_structure_type, name: "bar", line: 6, size: 8, align: 8, file: !5, scope: !6, elements: !2, identifier: "_ZTSN1A1B3barE") !9 = !{!10, !14, !17, !21, !25, !26, !27} -!10 = !DISubprogram(name: "f1", linkageName: "_ZN1A1B2f1Ev", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !11, function: i32 ()* @_ZN1A1B2f1Ev, variables: !2) +!10 = distinct !DISubprogram(name: "f1", linkageName: "_ZN1A1B2f1Ev", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !11, variables: !2) !11 = !DISubroutineType(types: !12) !12 = !{!13} !13 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!14 = !DISubprogram(name: "f1", linkageName: "_ZN1A1B2f1Ei", line: 4, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !5, scope: !6, type: !15, function: void (i32)* @_ZN1A1B2f1Ei, variables: !2) +!14 = distinct !DISubprogram(name: "f1", linkageName: "_ZN1A1B2f1Ei", line: 4, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !5, scope: !6, type: !15, variables: !2) !15 = !DISubroutineType(types: !16) !16 = !{null, !13} -!17 = !DISubprogram(name: "__cxx_global_var_init", line: 20, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 20, file: !5, scope: !18, type: !19, function: void ()* @__cxx_global_var_init, variables: !2) +!17 = distinct !DISubprogram(name: "__cxx_global_var_init", line: 20, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 20, file: !5, scope: !18, type: !19, variables: !2) !18 = !DIFile(filename: "foo.cpp", directory: "/tmp") !19 = !DISubroutineType(types: !20) !20 = !{null} -!21 = !DISubprogram(name: "func", linkageName: "_Z4funcb", line: 21, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 21, file: !5, scope: !18, type: !22, function: i32 (i1)* @_Z4funcb, variables: !2) +!21 = distinct !DISubprogram(name: "func", linkageName: "_Z4funcb", line: 21, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 21, file: !5, scope: !18, type: !22, variables: !2) !22 = !DISubroutineType(types: !23) !23 = !{!13, !24} !24 = !DIBasicType(tag: DW_TAG_base_type, name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean) -!25 = !DISubprogram(name: "__cxx_global_var_init1", line: 44, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 44, file: !5, scope: !18, type: !19, function: void ()* @__cxx_global_var_init1, variables: !2) -!26 = !DISubprogram(name: "func_fwd", linkageName: "_ZN1A1B8func_fwdEv", line: 47, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 47, file: !5, scope: !6, type: !19, function: void ()* @_ZN1A1B8func_fwdEv, variables: !2) -!27 = !DISubprogram(name: "", linkageName: "_GLOBAL__sub_I_debug_info_namespace.cpp", isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, file: !1, scope: !28, type: !29, function: void ()* @_GLOBAL__sub_I_debug_info_namespace.cpp, variables: !2) +!25 = distinct !DISubprogram(name: "__cxx_global_var_init1", line: 44, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 44, file: !5, scope: !18, type: !19, variables: !2) +!26 = distinct !DISubprogram(name: "func_fwd", linkageName: "_ZN1A1B8func_fwdEv", line: 47, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 47, file: !5, scope: !6, type: !19, variables: !2) +!27 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__sub_I_debug_info_namespace.cpp", isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, file: !1, scope: !28, type: !29, variables: !2) !28 = !DIFile(filename: "debug-info-namespace.cpp", directory: "/tmp") !29 = !DISubroutineType(types: !2) !30 = !{!31, !32} @@ -349,12 +348,12 @@ attributes #1 = { nounwind readnone } !58 = !{i32 2, !"Debug Info Version", i32 3} !59 = !{!"clang version 3.6.0 "} !60 = !DILocation(line: 3, column: 12, scope: !10) -!61 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "", line: 4, arg: 1, scope: !14, file: !18, type: !13) +!61 = !DILocalVariable(name: "", line: 4, arg: 1, scope: !14, file: !18, type: !13) !62 = !DIExpression() !63 = !DILocation(line: 4, column: 12, scope: !14) !64 = !DILocation(line: 4, column: 16, scope: !14) !65 = !DILocation(line: 20, column: 12, scope: !17) -!66 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 21, arg: 1, scope: !21, file: !18, type: !24) +!66 = !DILocalVariable(name: "b", line: 21, arg: 1, scope: !21, file: !18, type: !24) !67 = !DILocation(line: 21, column: 15, scope: !21) !68 = !DILocation(line: 22, column: 7, scope: !21) !69 = !DILocation(line: 24, column: 5, scope: !38) diff --git a/test/DebugInfo/namespace_function_definition.ll b/test/DebugInfo/Generic/namespace_function_definition.ll index 44340635484a..58a144fb1189 100644 --- a/test/DebugInfo/namespace_function_definition.ll +++ b/test/DebugInfo/Generic/namespace_function_definition.ll @@ -1,6 +1,6 @@ ; REQUIRES: object-emission -; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s +; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=Enable < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s ; Generated from clang with the following source: ; namespace ns { @@ -19,7 +19,7 @@ ; CHECK: NULL ; Function Attrs: nounwind uwtable -define void @_ZN2ns4funcEv() #0 { +define void @_ZN2ns4funcEv() #0 !dbg !4 { entry: ret void, !dbg !11 } @@ -30,11 +30,11 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "namespace_function_definition.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "func", linkageName: "_ZN2ns4funcEv", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: void ()* @_ZN2ns4funcEv, variables: !2) +!4 = distinct !DISubprogram(name: "func", linkageName: "_ZN2ns4funcEv", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) !5 = !DINamespace(name: "ns", line: 1, file: !1, scope: null) !6 = !DISubroutineType(types: !7) !7 = !{null} diff --git a/test/DebugInfo/namespace_inline_function_definition.ll b/test/DebugInfo/Generic/namespace_inline_function_definition.ll index c14152065b72..cca5e19db445 100644 --- a/test/DebugInfo/namespace_inline_function_definition.ll +++ b/test/DebugInfo/Generic/namespace_inline_function_definition.ll @@ -1,6 +1,6 @@ ; REQUIRES: object-emission -; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s +; RUN: %llc_dwarf -O0 -filetype=obj -dwarf-linkage-names=Enable < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s ; Generate from clang with the following source. Note that the definition of ; the inline function follows its use to workaround another bug that should be @@ -35,7 +35,7 @@ @x = external global i32 ; Function Attrs: uwtable -define i32 @main() #0 { +define i32 @main() #0 !dbg !4 { entry: %i.addr.i = alloca i32, align 4 %retval = alloca i32, align 4 @@ -49,7 +49,7 @@ entry: } ; Function Attrs: alwaysinline nounwind uwtable -define i32 @_ZN2ns4funcEi(i32 %i) #1 { +define i32 @_ZN2ns4funcEi(i32 %i) #1 !dbg !9 { entry: %i.addr = alloca i32, align 4 store i32 %i, i32* %i.addr, align 4 @@ -70,16 +70,16 @@ attributes #2 = { nounwind readnone } !llvm.module.flags = !{!13, !14} !llvm.ident = !{!15} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "namespace_inline_function_definition.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4, !9} -!4 = !DISubprogram(name: "main", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "namespace_inline_function_definition.cpp", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !7) !7 = !{!8} !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = !DISubprogram(name: "func", linkageName: "_ZN2ns4funcEi", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !10, type: !11, function: i32 (i32)* @_ZN2ns4funcEi, variables: !2) +!9 = distinct !DISubprogram(name: "func", linkageName: "_ZN2ns4funcEi", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !10, type: !11, variables: !2) !10 = !DINamespace(name: "ns", line: 1, file: !1, scope: null) !11 = !DISubroutineType(types: !12) !12 = !{!8, !8} @@ -87,9 +87,9 @@ attributes #2 = { nounwind readnone } !14 = !{i32 2, !"Debug Info Version", i32 3} !15 = !{!"clang version 3.5.0 "} !16 = !DILocation(line: 5, scope: !4) -!17 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 6, arg: 1, scope: !9, file: !5, type: !8) +!17 = !DILocalVariable(name: "i", line: 6, arg: 1, scope: !9, file: !5, type: !8) -!117 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 6, arg: 1, scope: !9, file: !5, type: !8) +!117 = !DILocalVariable(name: "i", line: 6, arg: 1, scope: !9, file: !5, type: !8) !18 = !DILocation(line: 6, scope: !9, inlinedAt: !16) !19 = !DILocation(line: 6, scope: !9) diff --git a/test/DebugInfo/nodebug.ll b/test/DebugInfo/Generic/nodebug.ll index 3ef3119a0c77..6f20aecaaf5e 100644 --- a/test/DebugInfo/nodebug.ll +++ b/test/DebugInfo/Generic/nodebug.ll @@ -37,11 +37,11 @@ attributes #0 = { uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"=" !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "nodebug.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "f1", linkageName: "_Z2f1v", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "nodebug.cpp", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !7) !7 = !{null} diff --git a/test/DebugInfo/piece-verifier.ll b/test/DebugInfo/Generic/piece-verifier.ll index 9d7efd6a396f..e1f5c24a21dc 100644 --- a/test/DebugInfo/piece-verifier.ll +++ b/test/DebugInfo/Generic/piece-verifier.ll @@ -3,7 +3,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.9.0" ; Function Attrs: nounwind ssp uwtable -define i32 @foo(i64 %s.coerce0, i32 %s.coerce1) #0 { +define i32 @foo(i64 %s.coerce0, i32 %s.coerce1) #0 !dbg !4 { entry: call void @llvm.dbg.value(metadata i64 %s.coerce0, i64 0, metadata !20, metadata !24), !dbg !21 call void @llvm.dbg.value(metadata i32 %s.coerce1, i64 0, metadata !22, metadata !27), !dbg !21 @@ -23,11 +23,11 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!17, !18} !llvm.ident = !{!19} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "pieces.c", directory: "") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, function: i32 (i64, i32)* @foo, variables: !15) +!4 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !15) !5 = !DIFile(filename: "pieces.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{!8, !9} @@ -39,13 +39,13 @@ attributes #1 = { nounwind readnone } !13 = !DIBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed) !14 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 1, size: 32, align: 32, offset: 64, file: !1, scope: !10, baseType: !8) !15 = !{!16} -!16 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9) +!16 = !DILocalVariable(name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9) !17 = !{i32 2, !"Dwarf Version", i32 4} !18 = !{i32 1, !"Debug Info Version", i32 3} !19 = !{!"clang version 3.5 "} -!20 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9) +!20 = !DILocalVariable(name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9) !21 = !DILocation(line: 3, scope: !4) -!22 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9) +!22 = !DILocalVariable(name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9) !23 = !DILocation(line: 4, scope: !4) !24 = !DIExpression(DW_OP_deref, DW_OP_bit_piece, 0, 64) !25 = !{} diff --git a/test/DebugInfo/Generic/ptrsize.ll b/test/DebugInfo/Generic/ptrsize.ll new file mode 100755 index 000000000000..dfdcb5c0e79f --- /dev/null +++ b/test/DebugInfo/Generic/ptrsize.ll @@ -0,0 +1,47 @@ +; REQUIRES: object-emission + +; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t +; RUN: llvm-dwarfdump %t | FileCheck %s + +; Check that pointers and references get emitted without size information in +; DWARF, even if they are so specified in the IR + +; CHECK: 0x[[O1:[0-9a-f]+]]: DW_TAG_pointer_type +; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] +; CHECK-NOT: DW_AT_byte_size +; CHECK: 0x[[O2:[0-9a-f]+]]: DW_TAG_ + +; CHECK: 0x[[O3:[0-9a-f]+]]: DW_TAG_reference_type +; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] +; CHECK-NOT: DW_AT_byte_size + +define i32 @foo() !dbg !4 { +entry: + ret i32 0, !dbg !13 +} + +define i32 @bar() !dbg !5 { +entry: + ret i32 0, !dbg !16 +} + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!11, !12} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 0, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !DIFile(filename: "dwarf-test.c", directory: "test") +!2 = !{} +!3 = !{!4, !5} +!4 = distinct !DISubprogram(name: "foo", scope: !0, file: !1, line: 6, type: !6, isLocal: false, isDefinition: true, scopeLine: 6, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, variables: !2) +!5 = distinct !DISubprogram(name: "bar", scope: !0, file: !1, line: 6, type: !15, isLocal: false, isDefinition: true, scopeLine: 6, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, variables: !2) +!6 = !DISubroutineType(types: !7) +!7 = !{!9} +!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !DIDerivedType(tag: DW_TAG_pointer_type, scope: !0, baseType: !8, size: 64, align: 64) +!10 = !DIDerivedType(tag: DW_TAG_reference_type, scope: !0, baseType: !8, size: 64, align: 64) +!11 = !{i32 2, !"Dwarf Version", i32 3} +!12 = !{i32 1, !"Debug Info Version", i32 3} +!13 = !DILocation(line: 7, scope: !4) +!14 = !{!10} +!15 = !DISubroutineType(types: !14) +!16 = !DILocation(line: 7, scope: !5) diff --git a/test/DebugInfo/X86/recursive_inlining.ll b/test/DebugInfo/Generic/recursive_inlining.ll index 7825646c7c8d..02c147e7aa68 100644 --- a/test/DebugInfo/X86/recursive_inlining.ll +++ b/test/DebugInfo/Generic/recursive_inlining.ll @@ -38,16 +38,16 @@ ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: DW_TAG_member ; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: DW_TAG_subprogram +; CHECK: [[M_FN2_DECL:.*]]: DW_TAG_subprogram ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "m_fn2" ; CHECK-NOT: {{DW_TAG|NULL}} -; CHECK: [[M_FN2_THIS_DECL:.*]]: DW_TAG_formal_parameter +; CHECK: DW_TAG_formal_parameter ; The abstract definition of C::m_fn2 ; CHECK: [[M_FN2_ABS_DEF:.*]]: DW_TAG_subprogram ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_specification {{.*}} "_ZN1C5m_fn2Ev" +; CHECK: DW_AT_specification {{.*}} {[[M_FN2_DECL]]} ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_inline ; CHECK-NOT: {{DW_TAG|NULL}} @@ -63,7 +63,7 @@ ; The concrete definition of C::m_fn2 ; CHECK: DW_TAG_subprogram ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_abstract_origin {{.*}} {[[M_FN2_ABS_DEF]]} "_ZN1C5m_fn2Ev" +; CHECK: DW_AT_abstract_origin {{.*}} {[[M_FN2_ABS_DEF]]} ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: DW_TAG_formal_parameter ; CHECK-NOT: DW_TAG @@ -78,7 +78,7 @@ ; Inlined C::m_fn2: ; CHECK: DW_TAG_inlined_subroutine ; CHECK-NOT: DW_TAG -; CHECK: DW_AT_abstract_origin {{.*}} {[[M_FN2_ABS_DEF]]} "_ZN1C5m_fn2Ev" +; CHECK: DW_AT_abstract_origin {{.*}} {[[M_FN2_ABS_DEF]]} ; CHECK-NOT: {{DW_TAG|NULL}} ; CHECK: DW_TAG_formal_parameter ; CHECK-NOT: DW_TAG @@ -91,7 +91,7 @@ @x = global %struct.C* null, align 8 ; Function Attrs: nounwind -define void @_Z3fn6v() #0 { +define void @_Z3fn6v() #0 !dbg !14 { entry: tail call void @_Z3fn8v() #3, !dbg !31 %0 = load %struct.C*, %struct.C** @x, align 8, !dbg !32, !tbaa !33 @@ -114,7 +114,7 @@ _ZN1C5m_fn2Ev.exit: ; preds = %entry, %if.then.i declare void @_Z3fn8v() #1 ; Function Attrs: nounwind -define linkonce_odr void @_ZN1C5m_fn2Ev(%struct.C* nocapture readonly %this) #0 align 2 { +define linkonce_odr void @_ZN1C5m_fn2Ev(%struct.C* nocapture readonly %this) #0 align 2 !dbg !22 { entry: tail call void @llvm.dbg.value(metadata %struct.C* %this, i64 0, metadata !24, metadata !DIExpression()), !dbg !49 tail call void @_Z3fn8v() #3, !dbg !50 @@ -147,7 +147,7 @@ _Z3fn6v.exit: ; preds = %if.end, %if.then.i. } ; Function Attrs: nounwind -define void @_Z3fn3v() #0 { +define void @_Z3fn3v() #0 !dbg !18 { entry: br label %tailrecurse @@ -170,7 +170,7 @@ if.then.i.i: ; preds = %tailrecurse } ; Function Attrs: nounwind -define void @_Z3fn4v() #0 { +define void @_Z3fn4v() #0 !dbg !19 { entry: %0 = load %struct.C*, %struct.C** @x, align 8, !dbg !72, !tbaa !33 tail call void @_ZN1C5m_fn2Ev(%struct.C* %0), !dbg !72 @@ -178,7 +178,7 @@ entry: } ; Function Attrs: nounwind -define void @_Z3fn5v() #0 { +define void @_Z3fn5v() #0 !dbg !20 { entry: %0 = load %struct.C*, %struct.C** @x, align 8, !dbg !73, !tbaa !33 tail call void @_ZN1C5m_fn2Ev(%struct.C* %0), !dbg !73 @@ -199,7 +199,7 @@ attributes #3 = { nounwind } !llvm.module.flags = !{!28, !29} !llvm.ident = !{!30} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !13, globals: !26, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !13, globals: !26, imports: !2) !1 = !DIFile(filename: "<stdin>", directory: "/usr/local/google/home/blaikie/dev/scratch/missing_concrete_variable_on_darwin/reduce") !2 = !{} !3 = !{!4} @@ -213,17 +213,17 @@ attributes #3 = { nounwind } !11 = !{null, !12} !12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1C") !13 = !{!14, !18, !19, !20, !21, !22} -!14 = !DISubprogram(name: "fn6", linkageName: "_Z3fn6v", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 15, file: !5, scope: !15, type: !16, function: void ()* @_Z3fn6v, variables: !2) +!14 = distinct !DISubprogram(name: "fn6", linkageName: "_Z3fn6v", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 15, file: !5, scope: !15, type: !16, variables: !2) !15 = !DIFile(filename: "recursive_inlining.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch/missing_concrete_variable_on_darwin/reduce") !16 = !DISubroutineType(types: !17) !17 = !{null} -!18 = !DISubprogram(name: "fn3", linkageName: "_Z3fn3v", line: 20, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 20, file: !5, scope: !15, type: !16, function: void ()* @_Z3fn3v, variables: !2) -!19 = !DISubprogram(name: "fn4", linkageName: "_Z3fn4v", line: 21, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 21, file: !5, scope: !15, type: !16, function: void ()* @_Z3fn4v, variables: !2) -!20 = !DISubprogram(name: "fn5", linkageName: "_Z3fn5v", line: 22, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 22, file: !5, scope: !15, type: !16, function: void ()* @_Z3fn5v, variables: !2) -!21 = !DISubprogram(name: "fn7", linkageName: "_Z3fn7v", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 14, file: !5, scope: !15, type: !16, variables: !2) -!22 = !DISubprogram(name: "m_fn2", linkageName: "_ZN1C5m_fn2Ev", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 7, file: !5, scope: !"_ZTS1C", type: !10, function: void (%struct.C*)* @_ZN1C5m_fn2Ev, declaration: !9, variables: !23) +!18 = distinct !DISubprogram(name: "fn3", linkageName: "_Z3fn3v", line: 20, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 20, file: !5, scope: !15, type: !16, variables: !2) +!19 = distinct !DISubprogram(name: "fn4", linkageName: "_Z3fn4v", line: 21, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 21, file: !5, scope: !15, type: !16, variables: !2) +!20 = distinct !DISubprogram(name: "fn5", linkageName: "_Z3fn5v", line: 22, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 22, file: !5, scope: !15, type: !16, variables: !2) +!21 = distinct !DISubprogram(name: "fn7", linkageName: "_Z3fn7v", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 14, file: !5, scope: !15, type: !16, variables: !2) +!22 = distinct !DISubprogram(name: "m_fn2", linkageName: "_ZN1C5m_fn2Ev", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 7, file: !5, scope: !"_ZTS1C", type: !10, declaration: !9, variables: !23) !23 = !{!24} -!24 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !22, type: !25) +!24 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !22, type: !25) !25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1C") !26 = !{!27} !27 = !DIGlobalVariable(name: "x", line: 13, isLocal: false, isDefinition: true, scope: null, file: !15, type: !25, variable: %struct.C** @x) @@ -236,7 +236,7 @@ attributes #3 = { nounwind } !34 = !{!"any pointer", !35, i64 0} !35 = !{!"omnipotent char", !36, i64 0} !36 = !{!"Simple C/C++ TBAA"} -!37 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !22, type: !25) +!37 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !22, type: !25) !38 = !DILocation(line: 0, scope: !22, inlinedAt: !32) !39 = !DILocation(line: 8, scope: !22, inlinedAt: !32) !40 = !DILocation(line: 9, scope: !41, inlinedAt: !32) @@ -256,7 +256,7 @@ attributes #3 = { nounwind } !54 = !DILocation(line: 20, scope: !18, inlinedAt: !55) !55 = !DILocation(line: 10, scope: !22) !56 = !DILocation(line: 17, scope: !14, inlinedAt: !54) -!57 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !22, type: !25) +!57 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !22, type: !25) !58 = !DILocation(line: 0, scope: !22, inlinedAt: !56) !59 = !DILocation(line: 8, scope: !22, inlinedAt: !56) !60 = !DILocation(line: 9, scope: !41, inlinedAt: !56) @@ -266,7 +266,7 @@ attributes #3 = { nounwind } !64 = !DILocation(line: 16, scope: !14, inlinedAt: !65) !65 = !DILocation(line: 20, scope: !18) !66 = !DILocation(line: 17, scope: !14, inlinedAt: !65) -!67 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !22, type: !25) +!67 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !22, type: !25) !68 = !DILocation(line: 0, scope: !22, inlinedAt: !66) !69 = !DILocation(line: 8, scope: !22, inlinedAt: !66) !70 = !DILocation(line: 9, scope: !41, inlinedAt: !66) diff --git a/test/DebugInfo/restrict.ll b/test/DebugInfo/Generic/restrict.ll index 71d94f60c965..b0536acd03cc 100644 --- a/test/DebugInfo/restrict.ll +++ b/test/DebugInfo/Generic/restrict.ll @@ -17,7 +17,7 @@ ; Function Attrs: nounwind uwtable -define void @_Z3fooPv(i8* noalias %dst) #0 { +define void @_Z3fooPv(i8* noalias %dst) #0 !dbg !4 { entry: %dst.addr = alloca i8*, align 8 store i8* %dst, i8** %dst.addr, align 8 @@ -35,11 +35,11 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!10, !11} !llvm.ident = !{!12} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "restrict.c", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "foo", linkageName: "_Z3fooPv", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void (i8*)* @_Z3fooPv, variables: !2) +!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooPv", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "restrict.c", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !7) !7 = !{null, !8} @@ -48,6 +48,6 @@ attributes #1 = { nounwind readnone } !10 = !{i32 2, !"Dwarf Version", i32 4} !11 = !{i32 1, !"Debug Info Version", i32 3} !12 = !{!"clang version 3.5.0 "} -!13 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "dst", line: 1, arg: 1, scope: !4, file: !5, type: !8) +!13 = !DILocalVariable(name: "dst", line: 1, arg: 1, scope: !4, file: !5, type: !8) !14 = !DILocation(line: 1, scope: !4) !15 = !DILocation(line: 2, scope: !4) diff --git a/test/DebugInfo/Generic/skeletoncu.ll b/test/DebugInfo/Generic/skeletoncu.ll new file mode 100644 index 000000000000..ca040e302564 --- /dev/null +++ b/test/DebugInfo/Generic/skeletoncu.ll @@ -0,0 +1,16 @@ +; RUN: %llc_dwarf %s -filetype=obj -o %t +; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s +; XFAIL: hexagon +; CHECK: DW_TAG_compile_unit +; CHECK: DW_AT_GNU_dwo_id {{.*}}abcd +; CHECK: DW_AT_GNU_dwo_name {{.*}}"my.dwo" + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "LLVM", isOptimized: false, runtimeVersion: 2, splitDebugFilename: "my.dwo", emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2, dwoId: 43981) +!1 = !DIFile(filename: "<stdin>", directory: "/") +!2 = !{} +!3 = !{i32 2, !"Dwarf Version", i32 4} +!4 = !{i32 2, !"Debug Info Version", i32 3} + diff --git a/test/DebugInfo/sugared-constants.ll b/test/DebugInfo/Generic/sugared-constants.ll index 421fe1dcd85c..5e32b794afde 100644 --- a/test/DebugInfo/sugared-constants.ll +++ b/test/DebugInfo/Generic/sugared-constants.ll @@ -22,7 +22,7 @@ ; CHECK: DW_AT_const_value [DW_FORM_udata] (7) ; Function Attrs: uwtable -define i32 @main() #0 { +define i32 @main() #0 !dbg !4 { entry: tail call void @llvm.dbg.value(metadata i32 42, i64 0, metadata !10, metadata !DIExpression()), !dbg !21 tail call void @_Z4funci(i32 42), !dbg !22 @@ -50,22 +50,22 @@ attributes #2 = { nounwind readnone } !llvm.module.flags = !{!17, !18} !llvm.ident = !{!19} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "const.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "main", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !9) +!4 = distinct !DISubprogram(name: "main", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !1, scope: !5, type: !6, variables: !9) !5 = !DIFile(filename: "const.cpp", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !7) !7 = !{!8} !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !9 = !{!10, !12, !15} -!10 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 5, scope: !4, file: !5, type: !11) +!10 = !DILocalVariable(name: "i", line: 5, scope: !4, file: !5, type: !11) !11 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8) -!12 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "j", line: 7, scope: !4, file: !5, type: !13) +!12 = !DILocalVariable(name: "j", line: 7, scope: !4, file: !5, type: !13) !13 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !14) !14 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) -!15 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "c", line: 9, scope: !4, file: !5, type: !16) +!15 = !DILocalVariable(name: "c", line: 9, scope: !4, file: !5, type: !16) !16 = !DIBasicType(tag: DW_TAG_base_type, name: "char16_t", size: 16, align: 16, encoding: 16) !17 = !{i32 2, !"Dwarf Version", i32 4} !18 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/template-recursive-void.ll b/test/DebugInfo/Generic/template-recursive-void.ll index 30eaee3f75d3..645f1795c76c 100644 --- a/test/DebugInfo/template-recursive-void.ll +++ b/test/DebugInfo/Generic/template-recursive-void.ll @@ -25,7 +25,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!36, !37} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 187958) (llvm/trunk 187964)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 187958) (llvm/trunk 187964)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) !1 = !DIFile(filename: "debug-info-template-recursive.cpp", directory: "/usr/local/google/home/echristo/tmp") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/tu-composite.ll b/test/DebugInfo/Generic/tu-composite.ll index 47fb8bc31482..77f99d2f8976 100644 --- a/test/DebugInfo/tu-composite.ll +++ b/test/DebugInfo/Generic/tu-composite.ll @@ -87,7 +87,7 @@ @_ZTI1C = unnamed_addr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1C, i32 0, i32 0) } ; Function Attrs: nounwind ssp uwtable -define void @_ZN1C3fooEv(%struct.C* %this) unnamed_addr #0 align 2 { +define void @_ZN1C3fooEv(%struct.C* %this) unnamed_addr #0 align 2 !dbg !31 { entry: %this.addr = alloca %struct.C*, align 8 store %struct.C* %this, %struct.C** %this.addr, align 8 @@ -100,7 +100,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 ; Function Attrs: nounwind ssp uwtable -define void @_Z4testv() #0 { +define void @_Z4testv() #0 !dbg !32 { entry: %B = alloca %struct.bar, align 1 %A = alloca [3 x %struct.bar], align 1 @@ -123,7 +123,7 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!35, !59} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !30, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !30, globals: !2, imports: !2) !1 = !DIFile(filename: "tmp.cpp", directory: ".") !2 = !{} !3 = !{!4, !18, !19, !22, !23, !24} @@ -153,32 +153,32 @@ attributes #1 = { nounwind readnone } !28 = !{!29} !29 = !DITemplateTypeParameter(name: "T", type: !"_ZTS3bar") !30 = !{!31, !32} -!31 = !DISubprogram(name: "foo", linkageName: "_ZN1C3fooEv", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: null, type: !14, function: void (%struct.C*)* @_ZN1C3fooEv, declaration: !13, variables: !2) -!32 = !DISubprogram(name: "test", linkageName: "_Z4testv", line: 20, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 20, file: !1, scope: !7, type: !33, function: void ()* @_Z4testv, variables: !2) +!31 = distinct !DISubprogram(name: "foo", linkageName: "_ZN1C3fooEv", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: null, type: !14, declaration: !13, variables: !2) +!32 = distinct !DISubprogram(name: "test", linkageName: "_Z4testv", line: 20, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 20, file: !1, scope: !7, type: !33, variables: !2) !33 = !DISubroutineType(types: !34) !34 = !{null} !35 = !{i32 2, !"Dwarf Version", i32 2} -!36 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !31, type: !37) +!36 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !31, type: !37) !37 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1C") !38 = !DILocation(line: 0, scope: !31) !39 = !DILocation(line: 5, scope: !31) -!40 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "B", line: 21, scope: !32, file: !7, type: !41) +!40 = !DILocalVariable(name: "B", line: 21, scope: !32, file: !7, type: !41) !41 = !DIDerivedType(tag: DW_TAG_typedef, name: "baz", line: 8, file: !1, baseType: !"_ZTS3bar") !42 = !DILocation(line: 21, scope: !32) -!43 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "A", line: 22, scope: !32, file: !7, type: !44) +!43 = !DILocalVariable(name: "A", line: 22, scope: !32, file: !7, type: !44) !44 = !DICompositeType(tag: DW_TAG_array_type, size: 24, align: 8, baseType: !"_ZTS3bar", elements: !45) !45 = !{!46} !46 = !DISubrange(count: 3) !47 = !DILocation(line: 22, scope: !32) -!48 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "B2", line: 23, scope: !32, file: !7, type: !49) +!48 = !DILocalVariable(name: "B2", line: 23, scope: !32, file: !7, type: !49) !49 = !DIDerivedType(tag: DW_TAG_typedef, name: "baz2", line: 10, file: !1, scope: !"_ZTS1D", baseType: !"_ZTS3bar") !50 = !DILocation(line: 23, scope: !32) -!51 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "e", line: 24, scope: !32, file: !7, type: !22) +!51 = !DILocalVariable(name: "e", line: 24, scope: !32, file: !7, type: !22) !52 = !DILocation(line: 24, scope: !32) -!53 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "p", line: 25, scope: !32, file: !7, type: !54) +!53 = !DILocalVariable(name: "p", line: 25, scope: !32, file: !7, type: !54) !54 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTSN1D7Nested2E") !55 = !DILocation(line: 25, scope: !32) -!56 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "t", line: 26, scope: !32, file: !7, type: !24) +!56 = !DILocalVariable(name: "t", line: 26, scope: !32, file: !7, type: !24) !57 = !DILocation(line: 26, scope: !32) !58 = !DILocation(line: 27, scope: !32) !59 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/tu-member-pointer.ll b/test/DebugInfo/Generic/tu-member-pointer.ll index a46c41313cf5..8b1eb3bb6d14 100644 --- a/test/DebugInfo/tu-member-pointer.ll +++ b/test/DebugInfo/Generic/tu-member-pointer.ll @@ -16,7 +16,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!10, !11} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !5, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !5, imports: !2) !1 = !DIFile(filename: "foo.cpp", directory: ".") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/two-cus-from-same-file.ll b/test/DebugInfo/Generic/two-cus-from-same-file.ll index 9dbd64a3fb92..65d376c814d9 100644 --- a/test/DebugInfo/two-cus-from-same-file.ll +++ b/test/DebugInfo/Generic/two-cus-from-same-file.ll @@ -13,7 +13,7 @@ @str = private unnamed_addr constant [4 x i8] c"FOO\00" @str1 = private unnamed_addr constant [6 x i8] c"Main!\00" -define void @foo() nounwind { +define void @foo() nounwind !dbg !5 { entry: %puts = tail call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str, i32 0, i32 0)), !dbg !23 ret void, !dbg !25 @@ -21,7 +21,7 @@ entry: declare i32 @puts(i8* nocapture) nounwind -define i32 @main(i32 %argc, i8** nocapture %argv) nounwind { +define i32 @main(i32 %argc, i8** nocapture %argv) nounwind !dbg !12 { entry: tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !21, metadata !DIExpression()), !dbg !26 tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !22, metadata !DIExpression()), !dbg !27 @@ -35,16 +35,16 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!0, !9} !llvm.module.flags = !{!33} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 156513)", isOptimized: true, emissionKind: 1, file: !32, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 156513)", isOptimized: true, emissionKind: 1, file: !32, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "foo", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !32, scope: !6, type: !7, function: void ()* @foo, variables: !1) +!5 = distinct !DISubprogram(name: "foo", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !32, scope: !6, type: !7, variables: !1) !6 = !DIFile(filename: "foo.c", directory: "/tmp") !7 = !DISubroutineType(types: !8) !8 = !{null} -!9 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 156513)", isOptimized: true, emissionKind: 1, file: !32, enums: !1, retainedTypes: !1, subprograms: !10, globals: !1, imports: !1) +!9 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 156513)", isOptimized: true, emissionKind: 1, file: !32, enums: !1, retainedTypes: !1, subprograms: !10, globals: !1, imports: !1) !10 = !{!12} -!12 = !DISubprogram(name: "main", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !32, scope: !6, type: !13, function: i32 (i32, i8**)* @main, variables: !19) +!12 = distinct !DISubprogram(name: "main", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !32, scope: !6, type: !13, variables: !19) !13 = !DISubroutineType(types: !14) !14 = !{!15, !15, !16} !15 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) @@ -52,8 +52,8 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !18) !18 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) !19 = !{!21, !22} -!21 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argc", line: 11, arg: 1, scope: !12, file: !6, type: !15) -!22 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argv", line: 11, arg: 2, scope: !12, file: !6, type: !16) +!21 = !DILocalVariable(name: "argc", line: 11, arg: 1, scope: !12, file: !6, type: !15) +!22 = !DILocalVariable(name: "argv", line: 11, arg: 2, scope: !12, file: !6, type: !16) !23 = !DILocation(line: 6, column: 3, scope: !24) !24 = distinct !DILexicalBlock(line: 5, column: 16, file: !32, scope: !5) !25 = !DILocation(line: 7, column: 1, scope: !24) diff --git a/test/DebugInfo/typedef.ll b/test/DebugInfo/Generic/typedef.ll index 591995e9b256..3cf4dffe9372 100644 --- a/test/DebugInfo/typedef.ll +++ b/test/DebugInfo/Generic/typedef.ll @@ -18,7 +18,7 @@ !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) !1 = !DIFile(filename: "typedef.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/unconditional-branch.ll b/test/DebugInfo/Generic/unconditional-branch.ll index 220a0e3dbe30..9325e1b27ada 100644 --- a/test/DebugInfo/unconditional-branch.ll +++ b/test/DebugInfo/Generic/unconditional-branch.ll @@ -18,7 +18,7 @@ ;} ; Function Attrs: nounwind -define void @foo(i32 %i) #0 { +define void @foo(i32 %i) #0 !dbg !4 { entry: %i.addr = alloca i32, align 4 store i32 %i, i32* %i.addr, align 4 @@ -45,11 +45,11 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!9, !10} !llvm.ident = !{!11} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (204712)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (204712)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "test.c", directory: "D:\5Cwork\5CEPRs\5C396363") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void (i32)* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "test.c", directory: "D:CworkCEPRsC396363") !6 = !DISubroutineType(types: !7) !7 = !{null, !8} @@ -57,7 +57,7 @@ attributes #1 = { nounwind readnone } !9 = !{i32 2, !"Dwarf Version", i32 4} !10 = !{i32 1, !"Debug Info Version", i32 3} !11 = !{!"clang version 3.5.0 (204712)"} -!12 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 1, arg: 1, scope: !4, file: !5, type: !8) +!12 = !DILocalVariable(name: "i", line: 1, arg: 1, scope: !4, file: !5, type: !8) !13 = !DILocation(line: 1, scope: !4) !14 = !DILocation(line: 2, scope: !4) !15 = !DILocation(line: 4, scope: !16) diff --git a/test/DebugInfo/varargs.ll b/test/DebugInfo/Generic/varargs.ll index 93dbfa1e0ace..8567bf715145 100644 --- a/test/DebugInfo/varargs.ll +++ b/test/DebugInfo/Generic/varargs.ll @@ -50,7 +50,7 @@ %struct.A = type { i8 } ; Function Attrs: nounwind ssp uwtable -define void @_Z1biz(i32 %c, ...) #0 { +define void @_Z1biz(i32 %c, ...) #0 !dbg !14 { %1 = alloca i32, align 4 %a = alloca %struct.A, align 1 %fptr = alloca void (i32, ...)*, align 8 @@ -72,7 +72,7 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!18, !19} !llvm.ident = !{!20} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !13, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !13, globals: !2, imports: !2) !1 = !DIFile(filename: "llvm/tools/clang/test/CodeGenCXX/debug-info-varargs.cpp", directory: "radar/13690847") !2 = !{} !3 = !{!4} @@ -84,18 +84,18 @@ attributes #1 = { nounwind readnone } !9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") !10 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !13 = !{!14} -!14 = !DISubprogram(name: "b", linkageName: "_Z1biz", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 13, file: !1, scope: !15, type: !16, function: void (i32, ...)* @_Z1biz, variables: !2) +!14 = distinct !DISubprogram(name: "b", linkageName: "_Z1biz", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 13, file: !1, scope: !15, type: !16, variables: !2) !15 = !DIFile(filename: "llvm/tools/clang/test/CodeGenCXX/debug-info-varargs.cpp", directory: "radar/13690847") !16 = !DISubroutineType(types: !17) !17 = !{null, !10, null} !18 = !{i32 2, !"Dwarf Version", i32 2} !19 = !{i32 1, !"Debug Info Version", i32 3} !20 = !{!"clang version 3.5 "} -!21 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "c", line: 13, arg: 1, scope: !14, file: !15, type: !10) +!21 = !DILocalVariable(name: "c", line: 13, arg: 1, scope: !14, file: !15, type: !10) !22 = !DILocation(line: 13, scope: !14) -!23 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 16, scope: !14, file: !15, type: !4) +!23 = !DILocalVariable(name: "a", line: 16, scope: !14, file: !15, type: !4) !24 = !DILocation(line: 16, scope: !14) -!25 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "fptr", line: 18, scope: !14, file: !15, type: !26) +!25 = !DILocalVariable(name: "fptr", line: 18, scope: !14, file: !15, type: !26) !26 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !16) !27 = !DILocation(line: 18, scope: !14) !28 = !DILocation(line: 22, scope: !14) diff --git a/test/DebugInfo/version.ll b/test/DebugInfo/Generic/version.ll index f18a3e2871e1..936e08872233 100644 --- a/test/DebugInfo/version.ll +++ b/test/DebugInfo/Generic/version.ll @@ -6,7 +6,7 @@ ; Make sure we are generating DWARF version 3 when module flag says so. ; CHECK: Compile Unit: length = {{.*}} version = 0x0003 -define i32 @main() #0 { +define i32 @main() #0 !dbg !4 { entry: %retval = alloca i32, align 4 store i32 0, i32* %retval @@ -18,11 +18,11 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!9, !11} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 185475)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 185475)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "CodeGen/dwarf-version.c", directory: "test") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "main", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "CodeGen/dwarf-version.c", directory: "test") !6 = !DISubroutineType(types: !7) !7 = !{!8} diff --git a/test/DebugInfo/Inputs/dwarfdump-dwp.x86_64.o b/test/DebugInfo/Inputs/dwarfdump-dwp.x86_64.o Binary files differnew file mode 100644 index 000000000000..da059f73b9ff --- /dev/null +++ b/test/DebugInfo/Inputs/dwarfdump-dwp.x86_64.o diff --git a/test/DebugInfo/Inputs/dwarfdump-macho-relocs.macho.x86_64.o b/test/DebugInfo/Inputs/dwarfdump-macho-relocs.macho.x86_64.o Binary files differnew file mode 100644 index 000000000000..a5f8476df5e7 --- /dev/null +++ b/test/DebugInfo/Inputs/dwarfdump-macho-relocs.macho.x86_64.o diff --git a/test/DebugInfo/Inputs/dwarfdump-macro-cmd.h b/test/DebugInfo/Inputs/dwarfdump-macro-cmd.h new file mode 100644 index 000000000000..66e6b00a2bbf --- /dev/null +++ b/test/DebugInfo/Inputs/dwarfdump-macro-cmd.h @@ -0,0 +1 @@ +#define M4 Value4 diff --git a/test/DebugInfo/Inputs/dwarfdump-macro.cc b/test/DebugInfo/Inputs/dwarfdump-macro.cc new file mode 100644 index 000000000000..5abcb255c6c7 --- /dev/null +++ b/test/DebugInfo/Inputs/dwarfdump-macro.cc @@ -0,0 +1,11 @@ +#define M1 Value1 +#include "dwarfdump-macro.h" +#define M2(x, y) ((x)+(y)* Value2) + +// Built with GCC +// $ mkdir -p /tmp/dbginfo +// $ cp dwarfdump-macro.cc /tmp/dbginfo +// $ cp dwarfdump-macro.h /tmp/dbginfo +// $ cp dwarfdump-macro-cmd.h /tmp/dbginfo +// $ cd /tmp/dbginfo +// $ g++ -c -g3 -O0 -DM3=Value3 -include dwarfdump-macro-cmd.h dwarfdump-macro.cc -o <output> diff --git a/test/DebugInfo/Inputs/dwarfdump-macro.h b/test/DebugInfo/Inputs/dwarfdump-macro.h new file mode 100644 index 000000000000..98f0206cb43f --- /dev/null +++ b/test/DebugInfo/Inputs/dwarfdump-macro.h @@ -0,0 +1,5 @@ + + + +#undef M1 +#define M1 NewValue1 diff --git a/test/DebugInfo/Inputs/dwarfdump-macro.o b/test/DebugInfo/Inputs/dwarfdump-macro.o Binary files differnew file mode 100644 index 000000000000..5f1cb5e2707f --- /dev/null +++ b/test/DebugInfo/Inputs/dwarfdump-macro.o diff --git a/test/DebugInfo/Inputs/dwarfdump-test.cc b/test/DebugInfo/Inputs/dwarfdump-test.cc index 14295d3cffa0..815c33dd3ac3 100644 --- a/test/DebugInfo/Inputs/dwarfdump-test.cc +++ b/test/DebugInfo/Inputs/dwarfdump-test.cc @@ -27,3 +27,5 @@ int main() { // $ cp <output> output2.dwz // $ dwz -m output.dwz -r output1.dwz output2.dwz // $ rm output2.dwz + +// The mach-o version was generated using clang-3.6.2. diff --git a/test/DebugInfo/Inputs/dwarfdump-test.macho-i386.o b/test/DebugInfo/Inputs/dwarfdump-test.macho-i386.o Binary files differnew file mode 100644 index 000000000000..b53c8a6959e3 --- /dev/null +++ b/test/DebugInfo/Inputs/dwarfdump-test.macho-i386.o diff --git a/test/DebugInfo/Inputs/fat-test.o b/test/DebugInfo/Inputs/fat-test.o Binary files differnew file mode 100644 index 000000000000..8159cc749772 --- /dev/null +++ b/test/DebugInfo/Inputs/fat-test.o diff --git a/test/DebugInfo/Inputs/gmlt.ll b/test/DebugInfo/Inputs/gmlt.ll index 1436abedfab4..b03a80b4deae 100644 --- a/test/DebugInfo/Inputs/gmlt.ll +++ b/test/DebugInfo/Inputs/gmlt.ll @@ -98,26 +98,26 @@ ; CHECK: .apple{{.*}} contents: ; Function Attrs: nounwind uwtable -define void @_Z2f1v() #0 { +define void @_Z2f1v() #0 !dbg !4 { entry: ret void, !dbg !13 } ; Function Attrs: nounwind uwtable -define void @_Z2f2v() #0 section "__TEXT,__bar" { +define void @_Z2f2v() #0 section "__TEXT,__bar" !dbg !7 { entry: ret void, !dbg !14 } ; Function Attrs: alwaysinline nounwind uwtable -define void @_Z2f3v() #1 { +define void @_Z2f3v() #1 !dbg !8 { entry: call void @_Z2f1v(), !dbg !15 ret void, !dbg !16 } ; Function Attrs: nounwind uwtable -define void @_Z2f4v() #0 { +define void @_Z2f4v() #0 !dbg !9 { entry: call void @_Z2f1v() #2, !dbg !17 ret void, !dbg !19 @@ -131,16 +131,16 @@ attributes #2 = { nounwind } !llvm.module.flags = !{!10, !11} !llvm.ident = !{!12} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "gmlt.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4, !7, !8, !9} -!4 = !DISubprogram(name: "f1", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void ()* @_Z2f1v, variables: !2) +!4 = distinct !DISubprogram(name: "f1", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "gmlt.cpp", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !2) -!7 = !DISubprogram(name: "f2", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: void ()* @_Z2f2v, variables: !2) -!8 = !DISubprogram(name: "f3", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: void ()* @_Z2f3v, variables: !2) -!9 = !DISubprogram(name: "f4", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !5, type: !6, function: void ()* @_Z2f4v, variables: !2) +!7 = distinct !DISubprogram(name: "f2", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) +!8 = distinct !DISubprogram(name: "f3", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) +!9 = distinct !DISubprogram(name: "f4", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !5, type: !6, variables: !2) !10 = !{i32 2, !"Dwarf Version", i32 4} !11 = !{i32 2, !"Debug Info Version", i32 3} !12 = !{!"clang version 3.6.0 "} diff --git a/test/DebugInfo/Inputs/line.ll b/test/DebugInfo/Inputs/line.ll index d56c7e01a17f..5bdd3b9eb346 100644 --- a/test/DebugInfo/Inputs/line.ll +++ b/test/DebugInfo/Inputs/line.ll @@ -12,7 +12,7 @@ ; CHECK: cmp ; Function Attrs: nounwind uwtable -define i32 @_Z1fii(i32 %a, i32 %b) #0 { +define i32 @_Z1fii(i32 %a, i32 %b) #0 !dbg !4 { entry: %a.addr = alloca i32, align 4 %b.addr = alloca i32, align 4 @@ -39,11 +39,11 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 (trunk 227472) (llvm/trunk 227476)", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 (trunk 227472) (llvm/trunk 227476)", isOptimized: false, emissionKind: 2, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "line.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i32, i32)* @_Z1fii, variables: !2) +!4 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "line.cpp", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !2) !7 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/DebugInfo/MIR/X86/lit.local.cfg b/test/DebugInfo/MIR/X86/lit.local.cfg new file mode 100644 index 000000000000..c8625f4d9d24 --- /dev/null +++ b/test/DebugInfo/MIR/X86/lit.local.cfg @@ -0,0 +1,2 @@ +if not 'X86' in config.root.targets: + config.unsupported = True diff --git a/test/DebugInfo/MIR/X86/live-debug-values-3preds.mir b/test/DebugInfo/MIR/X86/live-debug-values-3preds.mir new file mode 100644 index 000000000000..84be910aaf74 --- /dev/null +++ b/test/DebugInfo/MIR/X86/live-debug-values-3preds.mir @@ -0,0 +1,299 @@ +# RUN: llc -run-pass=livedebugvalues -march=x86-64 -o /dev/null %s | FileCheck %s + +# Test the extension of debug ranges from 3 predecessors. +# Generated from the source file LiveDebugValues-3preds.c: +# #include <stdio.h> +# int add(int x, int y, int z, int a) { +# int i; +# for (i = 0; i < x * y; i++) { +# if (i < x) { +# a = a * x; +# break; +# } +# if (i < y) { +# a = a * y; +# break; +# } +# if (i < z) { +# a = a * z; +# break; +# } +# } +# return a; +# } +# with clang -g -O1 -c -emit-llvm LiveDebugValues-3preds.c -S -o live-debug-values-3preds.ll +# then llc -stop-after stackmap-liveness live-debug-values-3preds.ll -o /dev/null > live-debug-values-3preds.mir + +# DBG_VALUE for variables "x", "y" and "z" are extended into BB#9 from its +# predecessors BB#0, BB#2 and BB#8. +# CHECK: bb.9.for.end: +# CHECK: DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21 +# CHECK-NEXT: DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19 +# CHECK-NEXT: DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18 + + +--- | + ; ModuleID = 'live-debug-values-3preds.ll' + target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + target triple = "x86_64-unknown-linux-gnu" + + ; Function Attrs: norecurse nounwind readnone uwtable + define i32 @add(i32 %x, i32 %y, i32 %z, i32 %a) #0 !dbg !4 { + entry: + tail call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !9, metadata !17), !dbg !18 + tail call void @llvm.dbg.value(metadata i32 %y, i64 0, metadata !10, metadata !17), !dbg !19 + tail call void @llvm.dbg.value(metadata i32 %z, i64 0, metadata !11, metadata !17), !dbg !21 + tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !12, metadata !17), !dbg !23 + tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !13, metadata !17), !dbg !25 + %mul = mul nsw i32 %y, %x, !dbg !26 + %cmp.24 = icmp sgt i32 %mul, 0, !dbg !30 + br i1 %cmp.24, label %for.body.preheader, label %for.end, !dbg !31 + + for.body.preheader: ; preds = %entry + br label %for.body, !dbg !32 + + for.cond: ; preds = %if.end.6 + %cmp = icmp slt i32 %inc, %mul, !dbg !30 + br i1 %cmp, label %for.body, label %for.end, !dbg !31 + + for.body: ; preds = %for.cond, %for.body.preheader + %i.025 = phi i32 [ %inc, %for.cond ], [ 0, %for.body.preheader ] + %0 = icmp sgt i32 %x, 0 + br i1 %0, label %if.then, label %if.end, !dbg !35 + + if.then: ; preds = %for.body + %mul2 = mul nsw i32 %a, %x, !dbg !36 + tail call void @llvm.dbg.value(metadata i32 %mul2, i64 0, metadata !12, metadata !17), !dbg !23 + br label %for.end, !dbg !38 + + if.end: ; preds = %for.body + %1 = icmp sgt i32 %y, 0 + br i1 %1, label %if.then.4, label %if.end.6, !dbg !39 + + if.then.4: ; preds = %if.end + %mul5 = mul nsw i32 %a, %y, !dbg !40 + tail call void @llvm.dbg.value(metadata i32 %mul5, i64 0, metadata !12, metadata !17), !dbg !23 + br label %for.end, !dbg !43 + + if.end.6: ; preds = %if.end + %2 = icmp sgt i32 %z, 0 + %inc = add nuw nsw i32 %i.025, 1, !dbg !44 + tail call void @llvm.dbg.value(metadata i32 %inc, i64 0, metadata !13, metadata !17), !dbg !25 + br i1 %2, label %if.then.8, label %for.cond, !dbg !45 + + if.then.8: ; preds = %if.end.6 + %mul9 = mul nsw i32 %a, %z, !dbg !46 + tail call void @llvm.dbg.value(metadata i32 %mul9, i64 0, metadata !12, metadata !17), !dbg !23 + br label %for.end, !dbg !49 + + for.end: ; preds = %for.cond, %if.then.8, %if.then.4, %if.then, %entry + %a.addr.0 = phi i32 [ %mul2, %if.then ], [ %mul5, %if.then.4 ], [ %mul9, %if.then.8 ], [ %a, %entry ], [ %a, %for.cond ] + ret i32 %a.addr.0, !dbg !50 + } + + ; Function Attrs: nounwind readnone + declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1 + + attributes #0 = { norecurse nounwind readnone uwtable } + attributes #1 = { nounwind readnone } + + !llvm.dbg.cu = !{!0} + !llvm.module.flags = !{!14, !15} + !llvm.ident = !{!16} + + !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 253049) ", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) + !1 = !DIFile(filename: "LiveDebugValues-3preds.c", directory: "/home/vt/julia/test/tvvikram") + !2 = !{} + !3 = !{!4} + !4 = distinct !DISubprogram(name: "add", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, variables: !8) + !5 = !DISubroutineType(types: !6) + !6 = !{!7, !7, !7, !7, !7} + !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) + !8 = !{!9, !10, !11, !12, !13} + !9 = !DILocalVariable(name: "x", arg: 1, scope: !4, file: !1, line: 1, type: !7) + !10 = !DILocalVariable(name: "y", arg: 2, scope: !4, file: !1, line: 1, type: !7) + !11 = !DILocalVariable(name: "z", arg: 3, scope: !4, file: !1, line: 1, type: !7) + !12 = !DILocalVariable(name: "a", arg: 4, scope: !4, file: !1, line: 1, type: !7) + !13 = !DILocalVariable(name: "i", scope: !4, file: !1, line: 2, type: !7) + !14 = !{i32 2, !"Dwarf Version", i32 4} + !15 = !{i32 2, !"Debug Info Version", i32 3} + !16 = !{!"clang version 3.8.0 (trunk 253049) "} + !17 = !DIExpression() + !18 = !DILocation(line: 1, column: 13, scope: !4) + !19 = !DILocation(line: 1, column: 20, scope: !20) + !20 = !DILexicalBlockFile(scope: !4, file: !1, discriminator: 1) + !21 = !DILocation(line: 1, column: 27, scope: !22) + !22 = !DILexicalBlockFile(scope: !4, file: !1, discriminator: 2) + !23 = !DILocation(line: 1, column: 34, scope: !24) + !24 = !DILexicalBlockFile(scope: !4, file: !1, discriminator: 3) + !25 = !DILocation(line: 2, column: 7, scope: !20) + !26 = !DILocation(line: 3, column: 21, scope: !27) + !27 = !DILexicalBlockFile(scope: !28, file: !1, discriminator: 1) + !28 = distinct !DILexicalBlock(scope: !29, file: !1, line: 3, column: 3) + !29 = distinct !DILexicalBlock(scope: !4, file: !1, line: 3, column: 3) + !30 = !DILocation(line: 3, column: 17, scope: !27) + !31 = !DILocation(line: 3, column: 3, scope: !27) + !32 = !DILocation(line: 4, column: 11, scope: !33) + !33 = distinct !DILexicalBlock(scope: !34, file: !1, line: 4, column: 9) + !34 = distinct !DILexicalBlock(scope: !28, file: !1, line: 3, column: 31) + !35 = !DILocation(line: 4, column: 9, scope: !34) + !36 = !DILocation(line: 5, column: 13, scope: !37) + !37 = distinct !DILexicalBlock(scope: !33, file: !1, line: 4, column: 16) + !38 = !DILocation(line: 6, column: 7, scope: !37) + !39 = !DILocation(line: 8, column: 9, scope: !34) + !40 = !DILocation(line: 9, column: 13, scope: !41) + !41 = distinct !DILexicalBlock(scope: !42, file: !1, line: 8, column: 16) + !42 = distinct !DILexicalBlock(scope: !34, file: !1, line: 8, column: 9) + !43 = !DILocation(line: 10, column: 7, scope: !41) + !44 = !DILocation(line: 3, column: 27, scope: !28) + !45 = !DILocation(line: 12, column: 9, scope: !34) + !46 = !DILocation(line: 13, column: 13, scope: !47) + !47 = distinct !DILexicalBlock(scope: !48, file: !1, line: 12, column: 16) + !48 = distinct !DILexicalBlock(scope: !34, file: !1, line: 12, column: 9) + !49 = !DILocation(line: 14, column: 7, scope: !47) + !50 = !DILocation(line: 17, column: 3, scope: !4) + +... +--- +name: add +alignment: 4 +exposesReturnsTwice: false +hasInlineAsm: false +isSSA: false +tracksRegLiveness: true +tracksSubRegLiveness: false +liveins: + - { reg: '%edi' } + - { reg: '%esi' } + - { reg: '%edx' } + - { reg: '%ecx' } +frameInfo: + isFrameAddressTaken: false + isReturnAddressTaken: false + hasStackMap: false + hasPatchPoint: false + stackSize: 0 + offsetAdjustment: 0 + maxAlignment: 0 + adjustsStack: false + hasCalls: false + maxCallFrameSize: 0 + hasOpaqueSPAdjustment: false + hasVAStart: false + hasMustTailInVarArgFunc: false +body: | + bb.0.entry: + successors: %bb.1.for.body.preheader(20), %bb.9.for.end(12) + liveins: %ecx, %edi, %edx, %esi + + DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18 + DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19 + DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21 + DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23 + DBG_VALUE 0, 0, !13, !17, debug-location !25 + %r8d = MOV32rr %esi, debug-location !26 + %r8d = IMUL32rr killed %r8d, %edi, implicit-def dead %eflags, debug-location !26 + TEST32rr %r8d, %r8d, implicit-def %eflags, debug-location !31 + JLE_1 %bb.9.for.end, implicit %eflags + + bb.1.for.body.preheader: + successors: %bb.3.for.body(0) + liveins: %ecx, %edi, %edx, %esi, %r8d + + DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18 + DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19 + DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21 + DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23 + DBG_VALUE 0, 0, !13, !17, debug-location !25 + %eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags + + bb.3.for.body (align 4): + successors: %bb.4.if.then(4), %bb.5.if.end(124) + liveins: %eax, %ecx, %edi, %edx, %esi, %r8d + + DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18 + DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19 + DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21 + DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23 + DBG_VALUE 0, 0, !13, !17, debug-location !25 + TEST32rr %edi, %edi, implicit-def %eflags, debug-location !35 + JG_1 %bb.4.if.then, implicit %eflags + + bb.5.if.end: + successors: %bb.6.if.then.4(4), %bb.7.if.end.6(124) + liveins: %eax, %ecx, %edi, %edx, %esi, %r8d + + DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18 + DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19 + DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21 + DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23 + DBG_VALUE 0, 0, !13, !17, debug-location !25 + TEST32rr %esi, %esi, implicit-def %eflags, debug-location !39 + JG_1 %bb.6.if.then.4, implicit %eflags + + bb.7.if.end.6: + successors: %bb.8.if.then.8(4), %bb.2.for.cond(124) + liveins: %eax, %ecx, %edi, %edx, %esi, %r8d + + DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18 + DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19 + DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21 + DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23 + DBG_VALUE 0, 0, !13, !17, debug-location !25 + TEST32rr %edx, %edx, implicit-def %eflags, debug-location !45 + JG_1 %bb.8.if.then.8, implicit %eflags + + bb.2.for.cond: + successors: %bb.3.for.body(124), %bb.9.for.end(4) + liveins: %eax, %ecx, %edi, %edx, %esi, %r8d + + DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18 + DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19 + DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21 + DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23 + DBG_VALUE 0, 0, !13, !17, debug-location !25 + %eax = INC32r killed %eax, implicit-def dead %eflags, debug-location !44 + DBG_VALUE debug-use %eax, debug-use _, !13, !17, debug-location !25 + CMP32rr %eax, %r8d, implicit-def %eflags, debug-location !31 + JL_1 %bb.3.for.body, implicit %eflags + JMP_1 %bb.9.for.end + + bb.4.if.then: + liveins: %ecx, %edi + + DBG_VALUE debug-use %edi, debug-use _, !9, !17, debug-location !18 + DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23 + DBG_VALUE 0, 0, !13, !17, debug-location !25 + %ecx = IMUL32rr killed %ecx, killed %edi, implicit-def dead %eflags, debug-location !36 + DBG_VALUE 0, 0, !13, !17, debug-location !25 + %eax = MOV32rr killed %ecx, debug-location !50 + RETQ %eax, debug-location !50 + + bb.6.if.then.4: + liveins: %ecx, %esi + + DBG_VALUE debug-use %esi, debug-use _, !10, !17, debug-location !19 + DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23 + DBG_VALUE 0, 0, !13, !17, debug-location !25 + %ecx = IMUL32rr killed %ecx, killed %esi, implicit-def dead %eflags, debug-location !40 + DBG_VALUE 0, 0, !13, !17, debug-location !25 + %eax = MOV32rr killed %ecx, debug-location !50 + RETQ %eax, debug-location !50 + + bb.8.if.then.8: + successors: %bb.9.for.end(0) + liveins: %ecx, %edx + + DBG_VALUE debug-use %edx, debug-use _, !11, !17, debug-location !21 + DBG_VALUE debug-use %ecx, debug-use _, !12, !17, debug-location !23 + DBG_VALUE 0, 0, !13, !17, debug-location !25 + %ecx = IMUL32rr killed %ecx, killed %edx, implicit-def dead %eflags, debug-location !46 + + bb.9.for.end: + liveins: %ecx + + DBG_VALUE 0, 0, !13, !17, debug-location !25 + %eax = MOV32rr killed %ecx, debug-location !50 + RETQ %eax, debug-location !50 + +... diff --git a/test/DebugInfo/MIR/X86/live-debug-values.mir b/test/DebugInfo/MIR/X86/live-debug-values.mir new file mode 100644 index 000000000000..0af408a635f6 --- /dev/null +++ b/test/DebugInfo/MIR/X86/live-debug-values.mir @@ -0,0 +1,260 @@ +# RUN: llc -run-pass=livedebugvalues -march=x86-64 -o /dev/null %s | FileCheck %s + +# Test the extension of debug ranges from predecessors. +# Generated from the source file LiveDebugValues.c: +# #include <stdio.h> +# int m; +# extern int inc(int n); +# extern int change(int n); +# extern int modify(int n); +# int main(int argc, char **argv) { +# int n; +# if (argc != 2) +# n = 2; +# else +# n = atoi(argv[1]); +# n = change(n); +# if (n > 10) { +# m = modify(n); +# m = m + n; // var `m' doesn't has a dbg.value +# } +# else +# m = inc(n); // var `m' doesn't has a dbg.value +# printf("m(main): %d\n", m); +# return 0; +# } +# with clang -g -O3 -c -emit-llvm LiveDebugValues.c -S -o live-debug-values.ll +# then llc -stop-after stackmap-liveness live-debug-values.ll -o /dev/null > live-debug-values.mir +# This case will also produce multiple locations but only the debug range +# extension is tested here. This test case is tested with DWARF information under +# llvm/test/DebugInfo/live-debug-values.ll and present here for testing under +# MIR->MIR serialization. + +# DBG_VALUE for variable "n" is extended into BB#5 from its predecessors BB#3 +# and BB#4. +# CHECK: bb.5.if.end.7: +# CHECK: DBG_VALUE debug-use %rsi, debug-use _, !13, !20, debug-location !22 +# CHECK-NEXT: DBG_VALUE debug-use %ebx, debug-use _, !14, !20, debug-location !33 + + +--- | + ; ModuleID = 'live-debug-values.ll' + target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + target triple = "x86_64-unknown-linux-gnu" + + @m = common global i32 0, align 4 + @.str = private unnamed_addr constant [13 x i8] c"m(main): %d\0A\00", align 1 + + ; Function Attrs: nounwind uwtable + define i32 @main(i32 %argc, i8** nocapture readonly %argv) #0 !dbg !4 { + entry: + tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !12, metadata !20), !dbg !21 + tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !13, metadata !20), !dbg !22 + %cmp = icmp eq i32 %argc, 2, !dbg !24 + br i1 %cmp, label %if.else, label %if.end, !dbg !26 + + if.else: ; preds = %entry + %arrayidx = getelementptr inbounds i8*, i8** %argv, i64 1, !dbg !27 + %0 = load i8*, i8** %arrayidx, align 8, !dbg !27, !tbaa !28 + %call = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %0) #4, !dbg !32 + tail call void @llvm.dbg.value(metadata i32 %call, i64 0, metadata !14, metadata !20), !dbg !33 + br label %if.end + + if.end: ; preds = %if.else, %entry + %n.0 = phi i32 [ %call, %if.else ], [ 2, %entry ] + %call1 = tail call i32 @change(i32 %n.0) #4, !dbg !34 + tail call void @llvm.dbg.value(metadata i32 %call1, i64 0, metadata !14, metadata !20), !dbg !33 + %cmp2 = icmp sgt i32 %call1, 10, !dbg !35 + br i1 %cmp2, label %if.then.3, label %if.else.5, !dbg !37 + + if.then.3: ; preds = %if.end + %call4 = tail call i32 @modify(i32 %call1) #4, !dbg !38 + %add = add nsw i32 %call4, %call1, !dbg !40 + br label %if.end.7, !dbg !41 + + if.else.5: ; preds = %if.end + %call6 = tail call i32 @inc(i32 %call1) #4, !dbg !42 + br label %if.end.7 + + if.end.7: ; preds = %if.else.5, %if.then.3 + %storemerge = phi i32 [ %call6, %if.else.5 ], [ %add, %if.then.3 ] + store i32 %storemerge, i32* @m, align 4, !dbg !43, !tbaa !44 + %call8 = tail call i32 (i8*, ...) @printf(i8* nonnull getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %storemerge) #4, !dbg !46 + ret i32 0, !dbg !47 + } + + declare i32 @atoi(...) #1 + + declare i32 @change(i32) #1 + + declare i32 @modify(i32) #1 + + declare i32 @inc(i32) #1 + + ; Function Attrs: nounwind + declare i32 @printf(i8* nocapture readonly, ...) #2 + + ; Function Attrs: nounwind readnone + declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #3 + + attributes #0 = { nounwind uwtable } + attributes #1 = { nounwind } + attributes #2 = { nounwind } + attributes #3 = { nounwind readnone } + attributes #4 = { nounwind } + + !llvm.dbg.cu = !{!0} + !llvm.module.flags = !{!17, !18} + !llvm.ident = !{!19} + + !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 253049) ", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3, globals: !15) + !1 = !DIFile(filename: "LiveDebugValues.c", directory: "/home/vt/julia/test/tvvikram") + !2 = !{} + !3 = !{!4} + !4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, variables: !11) + !5 = !DISubroutineType(types: !6) + !6 = !{!7, !7, !8} + !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) + !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64) + !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64) + !10 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) + !11 = !{!12, !13, !14} + !12 = !DILocalVariable(name: "argc", arg: 1, scope: !4, file: !1, line: 6, type: !7) + !13 = !DILocalVariable(name: "argv", arg: 2, scope: !4, file: !1, line: 6, type: !8) + !14 = !DILocalVariable(name: "n", scope: !4, file: !1, line: 7, type: !7) + !15 = !{!16} + !16 = !DIGlobalVariable(name: "m", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, variable: i32* @m) + !17 = !{i32 2, !"Dwarf Version", i32 4} + !18 = !{i32 2, !"Debug Info Version", i32 3} + !19 = !{!"clang version 3.8.0 (trunk 253049)"} + !20 = !DIExpression() + !21 = !DILocation(line: 6, column: 14, scope: !4) + !22 = !DILocation(line: 6, column: 27, scope: !23) + !23 = !DILexicalBlockFile(scope: !4, file: !1, discriminator: 1) + !24 = !DILocation(line: 8, column: 12, scope: !25) + !25 = distinct !DILexicalBlock(scope: !4, file: !1, line: 8, column: 7) + !26 = !DILocation(line: 8, column: 7, scope: !4) + !27 = !DILocation(line: 11, column: 14, scope: !25) + !28 = !{!29, !29, i64 0} + !29 = !{!"any pointer", !30, i64 0} + !30 = !{!"omnipotent char", !31, i64 0} + !31 = !{!"Simple C/C++ TBAA"} + !32 = !DILocation(line: 11, column: 9, scope: !25) + !33 = !DILocation(line: 7, column: 7, scope: !23) + !34 = !DILocation(line: 12, column: 7, scope: !4) + !35 = !DILocation(line: 13, column: 9, scope: !36) + !36 = distinct !DILexicalBlock(scope: !4, file: !1, line: 13, column: 7) + !37 = !DILocation(line: 13, column: 7, scope: !4) + !38 = !DILocation(line: 14, column: 9, scope: !39) + !39 = distinct !DILexicalBlock(scope: !36, file: !1, line: 13, column: 15) + !40 = !DILocation(line: 15, column: 11, scope: !39) + !41 = !DILocation(line: 16, column: 3, scope: !39) + !42 = !DILocation(line: 18, column: 9, scope: !36) + !43 = !DILocation(line: 15, column: 7, scope: !39) + !44 = !{!45, !45, i64 0} + !45 = !{!"int", !30, i64 0} + !46 = !DILocation(line: 19, column: 3, scope: !4) + !47 = !DILocation(line: 20, column: 3, scope: !4) + +... +--- +name: main +alignment: 4 +exposesReturnsTwice: false +hasInlineAsm: false +isSSA: false +tracksRegLiveness: true +tracksSubRegLiveness: false +liveins: + - { reg: '%edi' } + - { reg: '%rsi' } +calleeSavedRegisters: [ '%bh', '%bl', '%bp', '%bpl', '%bx', '%ebp', '%ebx', + '%rbp', '%rbx', '%r12', '%r13', '%r14', '%r15', + '%r12b', '%r13b', '%r14b', '%r15b', '%r12d', '%r13d', + '%r14d', '%r15d', '%r12w', '%r13w', '%r14w', '%r15w' ] +frameInfo: + isFrameAddressTaken: false + isReturnAddressTaken: false + hasStackMap: false + hasPatchPoint: false + stackSize: 8 + offsetAdjustment: 0 + maxAlignment: 0 + adjustsStack: true + hasCalls: true + maxCallFrameSize: 0 + hasOpaqueSPAdjustment: false + hasVAStart: false + hasMustTailInVarArgFunc: false +fixedStack: + - { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16, callee-saved-register: '%rbx' } +body: | + bb.0.entry: + successors: %bb.1.if.else(16), %bb.2.if.end(16) + liveins: %edi, %rsi, %rbx + + frame-setup PUSH64r killed %rbx, implicit-def %rsp, implicit %rsp + CFI_INSTRUCTION .cfi_def_cfa_offset 16 + CFI_INSTRUCTION .cfi_offset %rbx, -16 + DBG_VALUE debug-use %edi, debug-use _, !12, !20, debug-location !21 + DBG_VALUE debug-use %rsi, debug-use _, !13, !20, debug-location !22 + %eax = MOV32rr %edi + DBG_VALUE debug-use %eax, debug-use _, !12, !20, debug-location !21 + %edi = MOV32ri 2 + CMP32ri8 killed %eax, 2, implicit-def %eflags, debug-location !26 + JNE_1 %bb.2.if.end, implicit %eflags + + bb.1.if.else: + successors: %bb.2.if.end(0) + liveins: %rsi + + DBG_VALUE debug-use %rsi, debug-use _, !13, !20, debug-location !22 + %rdi = MOV64rm killed %rsi, 1, _, 8, _, debug-location !27 :: (load 8 from %ir.arrayidx, !tbaa !28) + dead %eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags, implicit-def %al, debug-location !32 + CALL64pcrel32 @atoi, csr_64, implicit %rsp, implicit %rdi, implicit %al, implicit-def %rsp, implicit-def %eax, debug-location !32 + %edi = MOV32rr %eax, debug-location !32 + DBG_VALUE debug-use %edi, debug-use _, !14, !20, debug-location !33 + + bb.2.if.end: + successors: %bb.3.if.then.3(16), %bb.4.if.else.5(16) + liveins: %edi + + CALL64pcrel32 @change, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax, debug-location !34 + %ebx = MOV32rr %eax, debug-location !34 + DBG_VALUE debug-use %ebx, debug-use _, !14, !20, debug-location !33 + CMP32ri8 %ebx, 11, implicit-def %eflags, debug-location !37 + JL_1 %bb.4.if.else.5, implicit killed %eflags, debug-location !37 + + bb.3.if.then.3: + successors: %bb.5.if.end.7(0) + liveins: %ebx + + DBG_VALUE debug-use %ebx, debug-use _, !14, !20, debug-location !33 + %edi = MOV32rr %ebx, debug-location !38 + CALL64pcrel32 @modify, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax, debug-location !38 + %ecx = MOV32rr %eax, debug-location !38 + %ecx = ADD32rr killed %ecx, killed %ebx, implicit-def dead %eflags, debug-location !40 + JMP_1 %bb.5.if.end.7 + + bb.4.if.else.5: + successors: %bb.5.if.end.7(0) + liveins: %ebx + + DBG_VALUE debug-use %ebx, debug-use _, !14, !20, debug-location !33 + %edi = MOV32rr killed %ebx, debug-location !42 + CALL64pcrel32 @inc, csr_64, implicit %rsp, implicit %edi, implicit-def %rsp, implicit-def %eax, debug-location !42 + %ecx = MOV32rr %eax, debug-location !42 + + bb.5.if.end.7: + liveins: %ecx + + MOV32mr %rip, 1, _, @m, _, %ecx, debug-location !43 :: (store 4 into @m, !tbaa !44) + dead undef %edi = MOV32ri64 @.str, implicit-def %rdi, debug-location !46 + dead %eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags, implicit-def %al, debug-location !47 + %esi = MOV32rr killed %ecx, debug-location !46 + CALL64pcrel32 @printf, csr_64, implicit %rsp, implicit %rdi, implicit %esi, implicit %al, implicit-def %rsp, implicit-def dead %eax, debug-location !46 + %eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags, debug-location !47 + %rbx = POP64r implicit-def %rsp, implicit %rsp, debug-location !47 + RETQ %eax, debug-location !47 + +... diff --git a/test/DebugInfo/MIR/lit.local.cfg b/test/DebugInfo/MIR/lit.local.cfg new file mode 100644 index 000000000000..e69aa5765356 --- /dev/null +++ b/test/DebugInfo/MIR/lit.local.cfg @@ -0,0 +1,2 @@ +config.suffixes = ['.mir'] + diff --git a/test/DebugInfo/Mips/InlinedFnLocalVar.ll b/test/DebugInfo/Mips/InlinedFnLocalVar.ll index 2badeba2f579..fe661522da7c 100644 --- a/test/DebugInfo/Mips/InlinedFnLocalVar.ll +++ b/test/DebugInfo/Mips/InlinedFnLocalVar.ll @@ -12,7 +12,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone -define i32 @bar() nounwind ssp { +define i32 @bar() nounwind ssp !dbg !6 { entry: %0 = load i32, i32* @i, align 4, !dbg !17 ; <i32> [#uses=2] tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !59, metadata !DIExpression()), !dbg !19 @@ -25,20 +25,20 @@ entry: !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!28} -!0 = !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24) +!0 = distinct !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24) !1 = !DIFile(filename: "bar.c", directory: "/tmp/") -!2 = !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports: !20) +!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports: !20) !3 = !DISubroutineType(types: !4) !4 = !{!5, !5} !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = !DISubprogram(name: "bar", linkageName: "bar", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !27, scope: !1, type: !7, function: i32 ()* @bar) +!6 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !27, scope: !1, type: !7) !7 = !DISubroutineType(types: !8) !8 = !{!5} -!9 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "j", line: 9, arg: 0, scope: !0, file: !1, type: !5) -!10 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "xyz", line: 10, scope: !11, file: !1, type: !12) +!9 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5) +!10 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12) -!59 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "j", line: 9, arg: 0, scope: !0, file: !1, type: !5) -!60 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "xyz", line: 10, scope: !11, file: !1, type: !12) +!59 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5) +!60 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12) !11 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !0) !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13) diff --git a/test/DebugInfo/Mips/delay-slot.ll b/test/DebugInfo/Mips/delay-slot.ll index df01775a12e6..e4cb9eac7cef 100644 --- a/test/DebugInfo/Mips/delay-slot.ll +++ b/test/DebugInfo/Mips/delay-slot.ll @@ -16,8 +16,8 @@ ; FIXME: The next address probably ought to be 0x0000000000000004 but there's ; a constant initialization before the prologue's end. ; CHECK: 0x0000000000000008 2 0 1 0 0 is_stmt prologue_end -; CHECK: 0x0000000000000028 3 0 1 0 0 is_stmt -; CHECK: 0x0000000000000038 4 0 1 0 0 is_stmt +; CHECK: 0x000000000000002c 3 0 1 0 0 is_stmt +; CHECK: 0x000000000000003c 4 0 1 0 0 is_stmt ; CHECK: 0x0000000000000048 5 0 1 0 0 is_stmt ; CHECK: 0x0000000000000058 5 0 1 0 0 is_stmt end_sequence @@ -26,7 +26,7 @@ target datalayout = "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64" target triple = "mips--linux-gnu" ; Function Attrs: nounwind -define i32 @foo(i32 %x) #0 { +define i32 @foo(i32 %x) #0 !dbg !4 { entry: call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !12, metadata !DIExpression()), !dbg !13 %tobool = icmp ne i32 %x, 0, !dbg !14 @@ -56,11 +56,11 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!9, !10} !llvm.ident = !{!11} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "test.c", directory: "/tmp") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i32)* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "test.c", directory: "/tmp") !6 = !DISubroutineType(types: !7) !7 = !{!8, !8} @@ -68,7 +68,7 @@ attributes #1 = { nounwind readnone } !9 = !{i32 2, !"Dwarf Version", i32 4} !10 = !{i32 2, !"Debug Info Version", i32 3} !11 = !{!"clang version 3.5.0"} -!12 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 1, arg: 1, scope: !4, file: !5, type: !8) +!12 = !DILocalVariable(name: "x", line: 1, arg: 1, scope: !4, file: !5, type: !8) !13 = !DILocation(line: 1, scope: !4) !14 = !DILocation(line: 2, scope: !15) !15 = distinct !DILexicalBlock(line: 2, column: 0, file: !1, scope: !4) diff --git a/test/DebugInfo/Mips/dsr-fixed-objects.ll b/test/DebugInfo/Mips/dsr-fixed-objects.ll new file mode 100644 index 000000000000..ee98272859a7 --- /dev/null +++ b/test/DebugInfo/Mips/dsr-fixed-objects.ll @@ -0,0 +1,156 @@ +; RUN: llc -march=mips -mcpu=mips32r2 -O1 -filetype=obj <%s | \ +; RUN: llvm-dwarfdump -debug-dump=all - | FileCheck %s -check-prefix=F0 +; RUN: llc -march=mips -mcpu=mips32r2 -O1 -filetype=obj <%s | \ +; RUN: llvm-dwarfdump -debug-dump=all - | FileCheck %s -check-prefix=F1 + +; void foo(int *); +; +; int f0(int a, int b, int c, int d, int e) { +; int x = a + b + c + d + e; +; foo(&x); +; return x; +; } +; +; int f1(int a, int b, int c, int d, int e) { +; int x __attribute__((aligned(16))) = a + b + c + d + e; +; foo(&x); +; return x; +; } + +declare void @llvm.lifetime.start(i64, i8* nocapture) +declare void @llvm.lifetime.end(i64, i8* nocapture) + +declare void @foo(i32*) + +; F0: DW_AT_location [DW_FORM_sec_offset] (0x00000014) +; F0: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000006b] = "x") +; +; x -> DW_OP_reg1(51) +; F0: 0x00000014: Beginning address offset: 0x0000000000000028 +; F0: Ending address offset: 0x0000000000000030 +; F0: Location description: 51 + +define i32 @f0(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d, i32 signext %e) !dbg !4 { +entry: + %x = alloca i32, align 4 + tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !9, metadata !DIExpression()), !dbg !27 + tail call void @llvm.dbg.value(metadata i32 %b, i64 0, metadata !10, metadata !DIExpression()), !dbg !28 + tail call void @llvm.dbg.value(metadata i32 %c, i64 0, metadata !11, metadata !DIExpression()), !dbg !29 + tail call void @llvm.dbg.value(metadata i32 %d, i64 0, metadata !12, metadata !DIExpression()), !dbg !30 + tail call void @llvm.dbg.value(metadata i32 %e, i64 0, metadata !13, metadata !DIExpression()), !dbg !31 + %0 = bitcast i32* %x to i8*, !dbg !32 + call void @llvm.lifetime.start(i64 4, i8* %0) #4, !dbg !32 + %add = add nsw i32 %b, %a, !dbg !33 + %add1 = add nsw i32 %add, %c, !dbg !34 + %add2 = add nsw i32 %add1, %d, !dbg !35 + %add3 = add nsw i32 %add2, %e, !dbg !36 + tail call void @llvm.dbg.value(metadata i32 %add3, i64 0, metadata !14, metadata !DIExpression()), !dbg !37 + store i32 %add3, i32* %x, align 4, !dbg !37, !tbaa !38 + tail call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !14, metadata !26), !dbg !37 + call void @foo(i32* nonnull %x) #4, !dbg !42 + call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !14, metadata !26), !dbg !37 + %1 = load i32, i32* %x, align 4, !dbg !43, !tbaa !38 + call void @llvm.lifetime.end(i64 4, i8* %0) #4, !dbg !44 + ret i32 %1, !dbg !45 +} + + +; F1: DW_AT_location [DW_FORM_sec_offset] (0x00000033) +; F1: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000006b] = "x") + +; x -> DW_OP_reg1(51) +; F1: 0x00000033: Beginning address offset: 0x0000000000000080 +; F1: Ending address offset: 0x0000000000000088 +; F1: Location description: 51 + +define i32 @f1(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d, i32 signext %e) !dbg !15 { +entry: + %x = alloca i32, align 16 + tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !17, metadata !DIExpression()), !dbg !46 + tail call void @llvm.dbg.value(metadata i32 %b, i64 0, metadata !18, metadata !DIExpression()), !dbg !47 + tail call void @llvm.dbg.value(metadata i32 %c, i64 0, metadata !19, metadata !DIExpression()), !dbg !48 + tail call void @llvm.dbg.value(metadata i32 %d, i64 0, metadata !20, metadata !DIExpression()), !dbg !49 + tail call void @llvm.dbg.value(metadata i32 %e, i64 0, metadata !21, metadata !DIExpression()), !dbg !50 + %0 = bitcast i32* %x to i8*, !dbg !51 + call void @llvm.lifetime.start(i64 4, i8* %0) #4, !dbg !51 + %add = add nsw i32 %b, %a, !dbg !52 + %add1 = add nsw i32 %add, %c, !dbg !53 + %add2 = add nsw i32 %add1, %d, !dbg !54 + %add3 = add nsw i32 %add2, %e, !dbg !55 + tail call void @llvm.dbg.value(metadata i32 %add3, i64 0, metadata !22, metadata !DIExpression()), !dbg !56 + store i32 %add3, i32* %x, align 16, !dbg !56, !tbaa !38 + tail call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !22, metadata !26), !dbg !56 + call void @foo(i32* nonnull %x) #4, !dbg !57 + call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !22, metadata !26), !dbg !56 + %1 = load i32, i32* %x, align 16, !dbg !58, !tbaa !38 + call void @llvm.lifetime.end(i64 4, i8* %0) #4, !dbg !59 + ret i32 %1, !dbg !60 +} + +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!23, !24} +!llvm.ident = !{!25} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 251783) (llvm/trunk 251781)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!1 = !DIFile(filename: "test.c", directory: "/home/vk/repos/tmp/dwarf") +!2 = !{} +!3 = !{!4, !15} +!4 = distinct !DISubprogram(name: "f0", scope: !1, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, variables: !8) +!5 = !DISubroutineType(types: !6) +!6 = !{!7, !7, !7, !7, !7, !7} +!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!8 = !{!9, !10, !11, !12, !13, !14} +!9 = !DILocalVariable(name: "a", arg: 1, scope: !4, file: !1, line: 4, type: !7) +!10 = !DILocalVariable(name: "b", arg: 2, scope: !4, file: !1, line: 4, type: !7) +!11 = !DILocalVariable(name: "c", arg: 3, scope: !4, file: !1, line: 4, type: !7) +!12 = !DILocalVariable(name: "d", arg: 4, scope: !4, file: !1, line: 4, type: !7) +!13 = !DILocalVariable(name: "e", arg: 5, scope: !4, file: !1, line: 4, type: !7) +!14 = !DILocalVariable(name: "x", scope: !4, file: !1, line: 5, type: !7) +!15 = distinct !DISubprogram(name: "f1", scope: !1, file: !1, line: 11, type: !5, isLocal: false, isDefinition: true, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: true, variables: !16) +!16 = !{!17, !18, !19, !20, !21, !22} +!17 = !DILocalVariable(name: "a", arg: 1, scope: !15, file: !1, line: 11, type: !7) +!18 = !DILocalVariable(name: "b", arg: 2, scope: !15, file: !1, line: 11, type: !7) +!19 = !DILocalVariable(name: "c", arg: 3, scope: !15, file: !1, line: 11, type: !7) +!20 = !DILocalVariable(name: "d", arg: 4, scope: !15, file: !1, line: 11, type: !7) +!21 = !DILocalVariable(name: "e", arg: 5, scope: !15, file: !1, line: 11, type: !7) +!22 = !DILocalVariable(name: "x", scope: !15, file: !1, line: 12, type: !7) +!23 = !{i32 2, !"Dwarf Version", i32 4} +!24 = !{i32 2, !"Debug Info Version", i32 3} +!25 = !{!"clang version 3.8.0 (trunk 251783) (llvm/trunk 251781)"} +!26 = !DIExpression(DW_OP_deref) +!27 = !DILocation(line: 4, column: 12, scope: !4) +!28 = !DILocation(line: 4, column: 19, scope: !4) +!29 = !DILocation(line: 4, column: 26, scope: !4) +!30 = !DILocation(line: 4, column: 33, scope: !4) +!31 = !DILocation(line: 4, column: 40, scope: !4) +!32 = !DILocation(line: 5, column: 3, scope: !4) +!33 = !DILocation(line: 5, column: 13, scope: !4) +!34 = !DILocation(line: 5, column: 17, scope: !4) +!35 = !DILocation(line: 5, column: 21, scope: !4) +!36 = !DILocation(line: 5, column: 25, scope: !4) +!37 = !DILocation(line: 5, column: 7, scope: !4) +!38 = !{!39, !39, i64 0} +!39 = !{!"int", !40, i64 0} +!40 = !{!"omnipotent char", !41, i64 0} +!41 = !{!"Simple C/C++ TBAA"} +!42 = !DILocation(line: 6, column: 3, scope: !4) +!43 = !DILocation(line: 7, column: 10, scope: !4) +!44 = !DILocation(line: 8, column: 1, scope: !4) +!45 = !DILocation(line: 7, column: 3, scope: !4) +!46 = !DILocation(line: 11, column: 12, scope: !15) +!47 = !DILocation(line: 11, column: 19, scope: !15) +!48 = !DILocation(line: 11, column: 26, scope: !15) +!49 = !DILocation(line: 11, column: 33, scope: !15) +!50 = !DILocation(line: 11, column: 40, scope: !15) +!51 = !DILocation(line: 12, column: 3, scope: !15) +!52 = !DILocation(line: 12, column: 42, scope: !15) +!53 = !DILocation(line: 12, column: 46, scope: !15) +!54 = !DILocation(line: 12, column: 50, scope: !15) +!55 = !DILocation(line: 12, column: 54, scope: !15) +!56 = !DILocation(line: 12, column: 7, scope: !15) +!57 = !DILocation(line: 13, column: 3, scope: !15) +!58 = !DILocation(line: 14, column: 10, scope: !15) +!59 = !DILocation(line: 15, column: 1, scope: !15) +!60 = !DILocation(line: 14, column: 3, scope: !15) diff --git a/test/DebugInfo/Mips/dsr-non-fixed-objects.ll b/test/DebugInfo/Mips/dsr-non-fixed-objects.ll new file mode 100644 index 000000000000..7bd68318ca51 --- /dev/null +++ b/test/DebugInfo/Mips/dsr-non-fixed-objects.ll @@ -0,0 +1,125 @@ +; RUN: llc -march=mips -mcpu=mips32r2 -O0 -filetype=obj <%s | \ +; RUN: llvm-dwarfdump -debug-dump=all - | FileCheck %s -check-prefix=F2 +; RUN: llc -march=mips -mcpu=mips32r2 -O0 -filetype=obj <%s | \ +; RUN: llvm-dwarfdump -debug-dump=all - | FileCheck %s -check-prefix=F3 + +declare void @llvm.dbg.declare(metadata, metadata, metadata) + +declare void @foo(i32*) + +; void foo(int *); +; +; int f2(int a, int b) { +; int c __attribute__((aligned(16))) = a + b; +; foo(&c); +; return c; +; } +; +; int *f3(int a, int b) { +; int c __attribute__((aligned(16))) = a + b; +; int *w = alloca(c); +; foo(&c); +; return w; +; } + +; c -> DW_OP_breg29(r29): 16 +; F2: DW_AT_location [DW_FORM_exprloc] (<0x2> 8d 10 ) +; F2: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000065] = "c") + +; Function Attrs: nounwind +define i32 @f2(i32 signext %a, i32 signext %b) !dbg !4 { +entry: + %a.addr = alloca i32, align 4 + %b.addr = alloca i32, align 4 + %c = alloca i32, align 16 + store i32 %a, i32* %a.addr, align 4 + call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !15, metadata !16), !dbg !17 + store i32 %b, i32* %b.addr, align 4 + call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !18, metadata !16), !dbg !19 + call void @llvm.dbg.declare(metadata i32* %c, metadata !20, metadata !16), !dbg !21 + %0 = load i32, i32* %a.addr, align 4, !dbg !22 + %1 = load i32, i32* %b.addr, align 4, !dbg !23 + %add = add nsw i32 %0, %1, !dbg !24 + store i32 %add, i32* %c, align 16, !dbg !21 + call void @foo(i32* %c), !dbg !25 + %2 = load i32, i32* %c, align 16, !dbg !26 + ret i32 %2, !dbg !27 +} + +; c -> DW_OP_breg23(r23): 16 +; F3: DW_AT_location [DW_FORM_exprloc] (<0x2> 87 10 ) +; F3: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000065] = "c") + +define i32* @f3(i32 signext %a, i32 signext %b) !dbg !8 { +entry: + %a.addr = alloca i32, align 4 + %b.addr = alloca i32, align 4 + %c = alloca i32, align 16 + %w = alloca i32*, align 4 + store i32 %a, i32* %a.addr, align 4 + call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !28, metadata !16), !dbg !29 + store i32 %b, i32* %b.addr, align 4 + call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !30, metadata !16), !dbg !31 + call void @llvm.dbg.declare(metadata i32* %c, metadata !32, metadata !16), !dbg !33 + %0 = load i32, i32* %a.addr, align 4, !dbg !34 + %1 = load i32, i32* %b.addr, align 4, !dbg !35 + %add = add nsw i32 %0, %1, !dbg !36 + store i32 %add, i32* %c, align 16, !dbg !33 + call void @llvm.dbg.declare(metadata i32** %w, metadata !37, metadata !16), !dbg !38 + %2 = load i32, i32* %c, align 16, !dbg !39 + %3 = alloca i8, i32 %2, !dbg !40 + %4 = bitcast i8* %3 to i32*, !dbg !40 + store i32* %4, i32** %w, align 4, !dbg !38 + call void @foo(i32* %c), !dbg !41 + %5 = load i32*, i32** %w, align 4, !dbg !42 + ret i32* %5, !dbg !43 +} + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!12, !13} +!llvm.ident = !{!14} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 251783) (llvm/trunk 251781)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!1 = !DIFile(filename: "test.c", directory: "/home/vk/repos/tmp/dwarf") +!2 = !{} +!3 = !{!4, !8} +!4 = distinct !DISubprogram(name: "f2", scope: !1, file: !1, line: 20, type: !5, isLocal: false, isDefinition: true, scopeLine: 20, flags: DIFlagPrototyped, isOptimized: false, variables: !2) +!5 = !DISubroutineType(types: !6) +!6 = !{!7, !7, !7} +!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!8 = distinct !DISubprogram(name: "f3", scope: !1, file: !1, line: 27, type: !9, isLocal: false, isDefinition: true, scopeLine: 27, flags: DIFlagPrototyped, isOptimized: false, variables: !2) +!9 = !DISubroutineType(types: !10) +!10 = !{!11, !7, !7} +!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 32, align: 32) +!12 = !{i32 2, !"Dwarf Version", i32 4} +!13 = !{i32 2, !"Debug Info Version", i32 3} +!14 = !{!"clang version 3.8.0 (trunk 251783) (llvm/trunk 251781)"} +!15 = !DILocalVariable(name: "a", arg: 1, scope: !4, file: !1, line: 20, type: !7) +!16 = !DIExpression() +!17 = !DILocation(line: 20, column: 12, scope: !4) +!18 = !DILocalVariable(name: "b", arg: 2, scope: !4, file: !1, line: 20, type: !7) +!19 = !DILocation(line: 20, column: 19, scope: !4) +!20 = !DILocalVariable(name: "c", scope: !4, file: !1, line: 21, type: !7) +!21 = !DILocation(line: 21, column: 7, scope: !4) +!22 = !DILocation(line: 21, column: 40, scope: !4) +!23 = !DILocation(line: 21, column: 44, scope: !4) +!24 = !DILocation(line: 21, column: 42, scope: !4) +!25 = !DILocation(line: 22, column: 3, scope: !4) +!26 = !DILocation(line: 23, column: 10, scope: !4) +!27 = !DILocation(line: 23, column: 3, scope: !4) +!28 = !DILocalVariable(name: "a", arg: 1, scope: !8, file: !1, line: 27, type: !7) +!29 = !DILocation(line: 27, column: 13, scope: !8) +!30 = !DILocalVariable(name: "b", arg: 2, scope: !8, file: !1, line: 27, type: !7) +!31 = !DILocation(line: 27, column: 20, scope: !8) +!32 = !DILocalVariable(name: "c", scope: !8, file: !1, line: 28, type: !7) +!33 = !DILocation(line: 28, column: 7, scope: !8) +!34 = !DILocation(line: 28, column: 40, scope: !8) +!35 = !DILocation(line: 28, column: 44, scope: !8) +!36 = !DILocation(line: 28, column: 42, scope: !8) +!37 = !DILocalVariable(name: "w", scope: !8, file: !1, line: 29, type: !11) +!38 = !DILocation(line: 29, column: 8, scope: !8) +!39 = !DILocation(line: 29, column: 19, scope: !8) +!40 = !DILocation(line: 29, column: 12, scope: !8) +!41 = !DILocation(line: 30, column: 3, scope: !8) +!42 = !DILocation(line: 31, column: 10, scope: !8) +!43 = !DILocation(line: 31, column: 3, scope: !8) diff --git a/test/DebugInfo/Mips/fn-call-line.ll b/test/DebugInfo/Mips/fn-call-line.ll index 18ed3dfa43ad..a3130ce8c6eb 100644 --- a/test/DebugInfo/Mips/fn-call-line.ll +++ b/test/DebugInfo/Mips/fn-call-line.ll @@ -52,7 +52,7 @@ ; Function Attrs: nounwind uwtable -define void @f2() #0 { +define void @f2() #0 !dbg !4 { entry: call void (...) @f1(), !dbg !11 call void (...) @f1(), !dbg !12 @@ -68,11 +68,11 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 (trunk 226641)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 (trunk 226641)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "fn-call-line.c", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "f2", line: 2, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: void ()* @f2, variables: !2) +!4 = distinct !DISubprogram(name: "f2", line: 2, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "fn-call-line.c", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !7) !7 = !{null} diff --git a/test/DebugInfo/Mips/prologue_end.ll b/test/DebugInfo/Mips/prologue_end.ll new file mode 100644 index 000000000000..d93836d84983 --- /dev/null +++ b/test/DebugInfo/Mips/prologue_end.ll @@ -0,0 +1,70 @@ +; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=static < %s | FileCheck %s -check-prefix=STATIC +; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=static -disable-fp-elim < %s | FileCheck %s -check-prefix=STATIC-FP +; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=pic < %s | FileCheck %s -check-prefix=PIC +; RUN: llc -O0 -mtriple mips-unknown-linux-gnu -relocation-model=pic -disable-fp-elim < %s | FileCheck %s -check-prefix=PIC-FP + +; Generated using clang -O0 -emit-llvm -S -target mipsel-unknown-linux -g test.c -o test.ll +; test.c: +; +; void hello_world(void) { +; printf("Hello, World!\n"); +; } + +@.str = private unnamed_addr constant [15 x i8] c"Hello, World!\0A\00", align 1 + +define void @hello_world() #0 !dbg !4 { +entry: +; STATIC: addiu $sp, $sp, -{{[0-9]+}} +; STATIC: sw $ra, {{[0-9]+}}($sp) +; STATIC: .loc 1 2 3 prologue_end +; STATIC: lui $[[R0:[0-9]+]], %hi($.str) + +; STATIC-FP: addiu $sp, $sp, -{{[0-9]+}} +; STATIC-FP: sw $ra, {{[0-9]+}}($sp) +; STATIC-FP: sw $fp, {{[0-9]+}}($sp) +; STATIC-FP: move $fp, $sp +; STATIC-FP: .loc 1 2 3 prologue_end +; STATIC-FP: lui $[[R0:[0-9]+]], %hi($.str) + +; PIC: lui $[[R0:[0-9]+]], %hi(_gp_disp) +; PIC: addiu $[[R0]], $[[R0]], %lo(_gp_disp) +; PIC: addiu $sp, $sp, -{{[0-9]+}} +; PIC: sw $ra, {{[0-9]+}}($sp) +; PIC: addu $[[R1:[0-9]+]], $[[R0]], $25 +; PIC: .loc 1 2 3 prologue_end +; PIC: lw $[[R2:[0-9]+]], %got($.str)($[[R1]]) + +; PIC-FP: lui $[[R0:[0-9]+]], %hi(_gp_disp) +; PIC-FP: addiu $[[R0]], $[[R0]], %lo(_gp_disp) +; PIC-FP: addiu $sp, $sp, -{{[0-9]+}} +; PIC-FP: sw $ra, {{[0-9]+}}($sp) +; PIC-FP: sw $fp, {{[0-9]+}}($sp) +; PIC-FP: move $fp, $sp +; PIC-FP: addu $[[R1:[0-9]+]], $[[R0]], $25 +; PIC-FP: .loc 1 2 3 prologue_end +; PIC-FP: lw $[[R2:[0-9]+]], %got($.str)($[[R1]]) + + %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0)), !dbg !10 + ret void, !dbg !11 +} + +declare i32 @printf(i8*, ...) + +attributes #0 = { nounwind } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!7, !8} +!llvm.ident = !{!9} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!1 = !DIFile(filename: "test.c", directory: "/tmp") +!2 = !{} +!3 = !{!4} +!4 = distinct !DISubprogram(name: "hello_world", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, variables: !2) +!5 = !DISubroutineType(types: !6) +!6 = !{null} +!7 = !{i32 2, !"Dwarf Version", i32 4} +!8 = !{i32 2, !"Debug Info Version", i32 3} +!9 = !{!"clang version 3.8.0"} +!10 = !DILocation(line: 2, column: 3, scope: !4) +!11 = !DILocation(line: 3, column: 1, scope: !4) diff --git a/test/DebugInfo/PDB/lit.local.cfg b/test/DebugInfo/PDB/DIA/lit.local.cfg index 28a895f51148..28a895f51148 100644 --- a/test/DebugInfo/PDB/lit.local.cfg +++ b/test/DebugInfo/PDB/DIA/lit.local.cfg diff --git a/test/DebugInfo/PDB/pdbdump-flags.test b/test/DebugInfo/PDB/DIA/pdbdump-flags.test index badbf0784b5e..c2fffcb50620 100644 --- a/test/DebugInfo/PDB/pdbdump-flags.test +++ b/test/DebugInfo/PDB/DIA/pdbdump-flags.test @@ -1,7 +1,7 @@ -; RUN: llvm-pdbdump %p/Inputs/empty.pdb | FileCheck %s -check-prefix=NO_ARGS -; RUN: llvm-pdbdump -types %p/Inputs/empty.pdb | FileCheck %s -check-prefix=TYPES -; RUN: llvm-pdbdump -compilands %p/Inputs/empty.pdb | FileCheck %s -check-prefix=COMPILANDS -; RUN: llvm-pdbdump -types -compilands %p/Inputs/empty.pdb | FileCheck %s -check-prefix=MULTIPLE +; RUN: llvm-pdbdump %p/../Inputs/empty.pdb | FileCheck %s -check-prefix=NO_ARGS +; RUN: llvm-pdbdump -types %p/../Inputs/empty.pdb | FileCheck %s -check-prefix=TYPES +; RUN: llvm-pdbdump -compilands %p/../Inputs/empty.pdb | FileCheck %s -check-prefix=COMPILANDS +; RUN: llvm-pdbdump -types -compilands %p/../Inputs/empty.pdb | FileCheck %s -check-prefix=MULTIPLE ; Check that neither symbols nor compilands are dumped when neither argument specified. ; NO_ARGS: empty.pdb diff --git a/test/DebugInfo/PDB/pdbdump-symbol-format.test b/test/DebugInfo/PDB/DIA/pdbdump-symbol-format.test index 6dd15fee4c59..ea5bb13d2ff6 100644 --- a/test/DebugInfo/PDB/pdbdump-symbol-format.test +++ b/test/DebugInfo/PDB/DIA/pdbdump-symbol-format.test @@ -1,6 +1,6 @@ -; RUN: llvm-pdbdump -symbols %p/Inputs/symbolformat.pdb | FileCheck --check-prefix=SYM_FORMAT %s -; RUN: llvm-pdbdump -types %p/Inputs/symbolformat.pdb | FileCheck --check-prefix=TYPES_FORMAT %s -; RUN: llvm-pdbdump -globals %p/Inputs/symbolformat.pdb | FileCheck --check-prefix=GLOBALS %s +; RUN: llvm-pdbdump -symbols %p/../Inputs/symbolformat.pdb | FileCheck --check-prefix=SYM_FORMAT %s +; RUN: llvm-pdbdump -types %p/../Inputs/symbolformat.pdb | FileCheck --check-prefix=TYPES_FORMAT %s +; RUN: llvm-pdbdump -globals %p/../Inputs/symbolformat.pdb | FileCheck --check-prefix=GLOBALS %s ; The format is func [0x<rva_start>+<prologue_length> - 0x<rva_end>-<epilogue_length>] ; SYM_FORMAT: ---SYMBOLS--- diff --git a/test/DebugInfo/PDB/pdbdump-headers.test b/test/DebugInfo/PDB/pdbdump-headers.test new file mode 100644 index 000000000000..5c68cf40e3ef --- /dev/null +++ b/test/DebugInfo/PDB/pdbdump-headers.test @@ -0,0 +1,12 @@ +; RUN: llvm-pdbdump --dump-headers %p/Inputs/empty.pdb | FileCheck %s + +; CHECK: BlockSize: 4096 +; CHECK-NEXT: Unknown0: 2 +; CHECK-NEXT: NumBlocks: 25 +; CHECK-NEXT: NumDirectoryBytes: 136 +; CHECK-NEXT: Unknown1: 0 +; CHECK-NEXT: BlockMapAddr: 24 +; CHECK-NEXT: NumDirectoryBlocks: 1 +; CHECK-NEXT: BlockMapOffset: 98304 +; CHECK-NEXT: DirectoryBlocks: [23] +; CHECK-NEXT: NumStreams: 17 diff --git a/test/DebugInfo/PowerPC/tls-fission.ll b/test/DebugInfo/PowerPC/tls-fission.ll index 25bc9959e4d1..e8c6a13f754e 100644 --- a/test/DebugInfo/PowerPC/tls-fission.ll +++ b/test/DebugInfo/PowerPC/tls-fission.ll @@ -22,7 +22,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!7, !8} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, splitDebugFilename: "tls.dwo", emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, splitDebugFilename: "tls.dwo", emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) !1 = !DIFile(filename: "tls.cpp", directory: "/tmp") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/PowerPC/tls.ll b/test/DebugInfo/PowerPC/tls.ll index 8ba350ac60d3..7e6597c743b9 100644 --- a/test/DebugInfo/PowerPC/tls.ll +++ b/test/DebugInfo/PowerPC/tls.ll @@ -17,7 +17,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!7, !8} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) !1 = !DIFile(filename: "tls.cpp", directory: "/tmp") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/Sparc/gnu-window-save.ll b/test/DebugInfo/Sparc/gnu-window-save.ll index c2e0364307fa..d94cc7505f3a 100644 --- a/test/DebugInfo/Sparc/gnu-window-save.ll +++ b/test/DebugInfo/Sparc/gnu-window-save.ll @@ -38,7 +38,7 @@ @.str = private unnamed_addr constant [14 x i8] c"hello, world\0A\00", align 1 ; Function Attrs: nounwind -define signext i32 @main() #0 { +define signext i32 @main() #0 !dbg !4 { entry: %retval = alloca i32, align 4 store i32 0, i32* %retval @@ -55,11 +55,11 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.module.flags = !{!9, !10} !llvm.ident = !{!11} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 (http://llvm.org/git/clang.git 6a0714fee07fb7c4e32d3972b4fe2ce2f5678cf4) (llvm/ 672e88e934757f76d5c5e5258be41e7615094844)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 (http://llvm.org/git/clang.git 6a0714fee07fb7c4e32d3972b4fe2ce2f5678cf4) (llvm/ 672e88e934757f76d5c5e5258be41e7615094844)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "hello.c", directory: "/home/venkatra/work/benchmarks/test/hello") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "hello.c", directory: "/home/venkatra/work/benchmarks/test/hello") !6 = !DISubroutineType(types: !7) !7 = !{!8} diff --git a/test/DebugInfo/Sparc/prologue_end.ll b/test/DebugInfo/Sparc/prologue_end.ll new file mode 100644 index 000000000000..43b1140620e7 --- /dev/null +++ b/test/DebugInfo/Sparc/prologue_end.ll @@ -0,0 +1,41 @@ +; RUN: llc -disable-fp-elim -O0 %s -mtriple sparc -o - | FileCheck %s + +; int func(void); +; void prologue_end_test() { +; func(); +; func(); +; } + +define void @prologue_end_test() nounwind uwtable !dbg !4 { + ; CHECK: prologue_end_test: + ; CHECK: .cfi_startproc + ; CHECK: save %sp + ; CHECK: .loc 1 3 3 prologue_end + ; CHECK: call func + ; CHECK: call func +entry: + %call = call i32 @func(), !dbg !11 + %call1 = call i32 @func(), !dbg !12 + ret void, !dbg !13 +} + +declare i32 @func() + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!7, !8, !9} +!llvm.ident = !{!10} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 242129)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!1 = !DIFile(filename: "foo.c", directory: "/tmp") +!2 = !{} +!3 = !{!4} +!4 = distinct !DISubprogram(name: "prologue_end_test", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, variables: !2) +!5 = !DISubroutineType(types: !6) +!6 = !{null} +!7 = !{i32 2, !"Dwarf Version", i32 2} +!8 = !{i32 2, !"Debug Info Version", i32 3} +!9 = !{i32 1, !"PIC Level", i32 2} +!10 = !{!"clang version 3.7.0 (trunk 242129)"} +!11 = !DILocation(line: 3, column: 3, scope: !4) +!12 = !DILocation(line: 4, column: 3, scope: !4) +!13 = !DILocation(line: 5, column: 1, scope: !4) diff --git a/test/DebugInfo/SystemZ/prologue_end.ll b/test/DebugInfo/SystemZ/prologue_end.ll new file mode 100644 index 000000000000..a62a8a75521e --- /dev/null +++ b/test/DebugInfo/SystemZ/prologue_end.ll @@ -0,0 +1,42 @@ +; RUN: llc -disable-fp-elim -O0 %s -mtriple s390x-linux-gnu -o - | FileCheck %s + +; int func(void); +; void prologue_end_test() { +; func(); +; func(); +; } + +define void @prologue_end_test() nounwind uwtable !dbg !4 { + ; CHECK: prologue_end_test: + ; CHECK: .cfi_startproc + ; CHECK: aghi + ; CHECK: lgr + ; CHECK: .loc 1 3 3 prologue_end + ; CHECK: brasl {{.*}}, func + ; CHECK: brasl {{.*}}, func +entry: + %call = call i32 @func(), !dbg !11 + %call1 = call i32 @func(), !dbg !12 + ret void, !dbg !13 +} + +declare i32 @func() + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!7, !8, !9} +!llvm.ident = !{!10} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 242129)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!1 = !DIFile(filename: "foo.c", directory: "/tmp") +!2 = !{} +!3 = !{!4} +!4 = distinct !DISubprogram(name: "prologue_end_test", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, variables: !2) +!5 = !DISubroutineType(types: !6) +!6 = !{null} +!7 = !{i32 2, !"Dwarf Version", i32 2} +!8 = !{i32 2, !"Debug Info Version", i32 3} +!9 = !{i32 1, !"PIC Level", i32 2} +!10 = !{!"clang version 3.7.0 (trunk 242129)"} +!11 = !DILocation(line: 3, column: 3, scope: !4) +!12 = !DILocation(line: 4, column: 3, scope: !4) +!13 = !DILocation(line: 5, column: 1, scope: !4) diff --git a/test/DebugInfo/SystemZ/variable-loc.ll b/test/DebugInfo/SystemZ/variable-loc.ll index 5f4fe258b976..6ace1b614248 100644 --- a/test/DebugInfo/SystemZ/variable-loc.ll +++ b/test/DebugInfo/SystemZ/variable-loc.ll @@ -29,7 +29,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone declare i32 @sum_array(i32*, i32) nounwind -define i32 @main() nounwind { +define i32 @main() nounwind !dbg !14 { entry: %retval = alloca i32, align 4 %main_arr = alloca [100 x i32], align 4 @@ -52,27 +52,27 @@ declare i32 @printf(i8*, ...) !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!30} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 ", isOptimized: false, emissionKind: 0, file: !29, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 ", isOptimized: false, emissionKind: 0, file: !29, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5, !11, !14} -!5 = !DISubprogram(name: "populate_array", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !29, scope: !6, type: !7, function: void (i32*, i32)* @populate_array, variables: !1) +!5 = distinct !DISubprogram(name: "populate_array", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !29, scope: !6, type: !7, variables: !1) !6 = !DIFile(filename: "simple.c", directory: "/home/timnor01/a64-trunk/build") !7 = !DISubroutineType(types: !8) !8 = !{null, !9, !10} !9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !10) !10 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!11 = !DISubprogram(name: "sum_array", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 9, file: !29, scope: !6, type: !12, function: i32 (i32*, i32)* @sum_array, variables: !1) +!11 = distinct !DISubprogram(name: "sum_array", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 9, file: !29, scope: !6, type: !12, variables: !1) !12 = !DISubroutineType(types: !13) !13 = !{!10, !9, !10} -!14 = !DISubprogram(name: "main", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 18, file: !29, scope: !6, type: !15, function: i32 ()* @main, variables: !1) +!14 = distinct !DISubprogram(name: "main", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 18, file: !29, scope: !6, type: !15, variables: !1) !15 = !DISubroutineType(types: !16) !16 = !{!10} -!17 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "main_arr", line: 19, scope: !18, file: !6, type: !19) +!17 = !DILocalVariable(name: "main_arr", line: 19, scope: !18, file: !6, type: !19) !18 = distinct !DILexicalBlock(line: 18, column: 16, file: !29, scope: !14) !19 = !DICompositeType(tag: DW_TAG_array_type, size: 3200, align: 32, baseType: !10, elements: !{!20}) !20 = !DISubrange(count: 99) !22 = !DILocation(line: 19, column: 7, scope: !18) -!23 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "val", line: 20, scope: !18, file: !6, type: !10) +!23 = !DILocalVariable(name: "val", line: 20, scope: !18, file: !6, type: !10) !24 = !DILocation(line: 20, column: 7, scope: !18) !25 = !DILocation(line: 22, column: 3, scope: !18) !26 = !DILocation(line: 23, column: 9, scope: !18) diff --git a/test/DebugInfo/X86/2010-04-13-PubType.ll b/test/DebugInfo/X86/2010-04-13-PubType.ll index 85c499d59630..4688f959fbdb 100644 --- a/test/DebugInfo/X86/2010-04-13-PubType.ll +++ b/test/DebugInfo/X86/2010-04-13-PubType.ll @@ -5,7 +5,7 @@ %struct.X = type opaque %struct.Y = type { i32 } -define i32 @foo(%struct.X* %x, %struct.Y* %y) nounwind ssp { +define i32 @foo(%struct.X* %x, %struct.Y* %y) nounwind ssp !dbg !1 { entry: %x_addr = alloca %struct.X* ; <%struct.X**> [#uses=1] %y_addr = alloca %struct.Y* ; <%struct.Y**> [#uses=1] @@ -31,10 +31,10 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!3} !llvm.module.flags = !{!20} -!0 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 7, arg: 0, scope: !1, file: !2, type: !7) -!1 = !DISubprogram(name: "foo", linkageName: "foo", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !18, scope: !2, type: !4, function: i32 (%struct.X*, %struct.Y*)* @foo) +!0 = !DILocalVariable(name: "x", line: 7, arg: 1, scope: !1, file: !2, type: !7) +!1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !18, scope: !2, type: !4) !2 = !DIFile(filename: "a.c", directory: "/tmp/") -!3 = !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !18, enums: !19, retainedTypes: !19, subprograms: !17, imports: null) +!3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !18, enums: !19, retainedTypes: !19, subprograms: !17, imports: null) !4 = !DISubroutineType(types: !5) !5 = !{!6, !7, !9} !6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) @@ -45,7 +45,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !11 = !{!12} !12 = !DIDerivedType(tag: DW_TAG_member, name: "x", line: 5, size: 32, align: 32, file: !18, scope: !10, baseType: !6) !13 = !DILocation(line: 7, scope: !1) -!14 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "y", line: 7, arg: 0, scope: !1, file: !2, type: !9) +!14 = !DILocalVariable(name: "y", line: 7, arg: 2, scope: !1, file: !2, type: !9) !15 = !DILocation(line: 7, scope: !16) !16 = distinct !DILexicalBlock(line: 7, column: 0, file: !18, scope: !1) !17 = !{!1} diff --git a/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll b/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll index 1252f2cb32e3..aaf72311cb46 100644 --- a/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll +++ b/test/DebugInfo/X86/2011-09-26-GlobalVarContext.ll @@ -5,7 +5,7 @@ @GLB = common global i32 0, align 4 -define i32 @f() nounwind { +define i32 @f() nounwind !dbg !5 { %LOC = alloca i32, align 4 call void @llvm.dbg.declare(metadata i32* %LOC, metadata !15, metadata !DIExpression()), !dbg !17 %1 = load i32, i32* @GLB, align 4, !dbg !18 @@ -19,17 +19,17 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!21} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk)", isOptimized: false, emissionKind: 0, file: !20, enums: !1, retainedTypes: !1, subprograms: !3, globals: !12, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk)", isOptimized: false, emissionKind: 0, file: !20, enums: !1, retainedTypes: !1, subprograms: !3, globals: !12, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !6, scope: !6, type: !7, function: i32 ()* @f) +!5 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !6, scope: !6, type: !7) !6 = !DIFile(filename: "test.c", directory: "/work/llvm/vanilla/test/DebugInfo") !7 = !DISubroutineType(types: !8) !8 = !{!9} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !12 = !{!14} !14 = !DIGlobalVariable(name: "GLB", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, variable: i32* @GLB) -!15 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "LOC", line: 4, scope: !16, file: !6, type: !9) +!15 = !DILocalVariable(name: "LOC", line: 4, scope: !16, file: !6, type: !9) !16 = distinct !DILexicalBlock(line: 3, column: 9, file: !20, scope: !5) !17 = !DILocation(line: 4, column: 9, scope: !16) !18 = !DILocation(line: 4, column: 23, scope: !16) diff --git a/test/DebugInfo/X86/2011-12-16-BadStructRef.ll b/test/DebugInfo/X86/2011-12-16-BadStructRef.ll index fc3f69b3584c..2319c0b70881 100644 --- a/test/DebugInfo/X86/2011-12-16-BadStructRef.ll +++ b/test/DebugInfo/X86/2011-12-16-BadStructRef.ll @@ -7,7 +7,7 @@ %struct.bar = type { %struct.baz, %struct.baz* } %struct.baz = type { i32 } -define i32 @main(i32 %argc, i8** %argv) uwtable ssp { +define i32 @main(i32 %argc, i8** %argv) uwtable ssp !dbg !29 { entry: %retval = alloca i32, align 4 %argc.addr = alloca i32, align 4 @@ -25,7 +25,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone -define linkonce_odr void @_ZN3barC1Ei(%struct.bar* %this, i32 %x) unnamed_addr uwtable ssp align 2 { +define linkonce_odr void @_ZN3barC1Ei(%struct.bar* %this, i32 %x) unnamed_addr uwtable ssp align 2 !dbg !37 { entry: %this.addr = alloca %struct.bar*, align 8 %x.addr = alloca i32, align 4 @@ -39,7 +39,7 @@ entry: ret void, !dbg !62 } -define linkonce_odr void @_ZN3barC2Ei(%struct.bar* %this, i32 %x) unnamed_addr uwtable ssp align 2 { +define linkonce_odr void @_ZN3barC2Ei(%struct.bar* %this, i32 %x) unnamed_addr uwtable ssp align 2 !dbg !40 { entry: %this.addr = alloca %struct.bar*, align 8 %x.addr = alloca i32, align 4 @@ -57,7 +57,7 @@ entry: ret void, !dbg !68 } -define linkonce_odr void @_ZN3bazC1Ei(%struct.baz* %this, i32 %a) unnamed_addr uwtable ssp align 2 { +define linkonce_odr void @_ZN3bazC1Ei(%struct.baz* %this, i32 %a) unnamed_addr uwtable ssp align 2 !dbg !43 { entry: %this.addr = alloca %struct.baz*, align 8 %a.addr = alloca i32, align 4 @@ -71,7 +71,7 @@ entry: ret void, !dbg !74 } -define linkonce_odr void @_ZN3bazC2Ei(%struct.baz* %this, i32 %a) unnamed_addr nounwind uwtable ssp align 2 { +define linkonce_odr void @_ZN3bazC2Ei(%struct.baz* %this, i32 %a) unnamed_addr nounwind uwtable ssp align 2 !dbg !46 { entry: %this.addr = alloca %struct.baz*, align 8 %a.addr = alloca i32, align 4 @@ -89,7 +89,7 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!83} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 146596)", isOptimized: false, emissionKind: 0, file: !82, enums: !1, retainedTypes: !3, subprograms: !27, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 146596)", isOptimized: false, emissionKind: 0, file: !82, enums: !1, retainedTypes: !3, subprograms: !27, globals: !1, imports: !1) !1 = !{} !3 = !{!5, !9} !5 = !DICompositeType(tag: DW_TAG_class_type, name: "bar", line: 9, size: 128, align: 64, file: !82, elements: !7) @@ -111,7 +111,7 @@ entry: !23 = !{null, !24, !12} !24 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !5) !27 = !{!29, !37, !40, !43, !46} -!29 = !DISubprogram(name: "main", line: 17, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: !6, type: !30, function: i32 (i32, i8**)* @main) +!29 = distinct !DISubprogram(name: "main", line: 17, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: !6, type: !30) !30 = !DISubroutineType(types: !31) !31 = !{!12, !12, !32} !32 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !33) @@ -119,45 +119,45 @@ entry: !34 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) !35 = !{!36} !36 = !{} ; previously: invalid DW_TAG_base_type -!37 = !DISubprogram(name: "bar", linkageName: "_ZN3barC1Ei", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: null, type: !22, function: void (%struct.bar*, i32)* @_ZN3barC1Ei, declaration: !21) +!37 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3barC1Ei", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: null, type: !22, declaration: !21) !38 = !{!39} !39 = !{} ; previously: invalid DW_TAG_base_type -!40 = !DISubprogram(name: "bar", linkageName: "_ZN3barC2Ei", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: null, type: !22, function: void (%struct.bar*, i32)* @_ZN3barC2Ei, declaration: !21) +!40 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3barC2Ei", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: null, type: !22, declaration: !21) !41 = !{!42} !42 = !{} ; previously: invalid DW_TAG_base_type -!43 = !DISubprogram(name: "baz", linkageName: "_ZN3bazC1Ei", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: null, type: !14, function: void (%struct.baz*, i32)* @_ZN3bazC1Ei, declaration: !13) +!43 = distinct !DISubprogram(name: "baz", linkageName: "_ZN3bazC1Ei", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: null, type: !14, declaration: !13) !44 = !{!45} !45 = !{} ; previously: invalid DW_TAG_base_type -!46 = !DISubprogram(name: "baz", linkageName: "_ZN3bazC2Ei", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: null, type: !14, function: void (%struct.baz*, i32)* @_ZN3bazC2Ei, declaration: !13) -!49 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argc", line: 16, arg: 1, scope: !29, file: !6, type: !12) +!46 = distinct !DISubprogram(name: "baz", linkageName: "_ZN3bazC2Ei", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !82, scope: null, type: !14, declaration: !13) +!49 = !DILocalVariable(name: "argc", line: 16, arg: 1, scope: !29, file: !6, type: !12) !50 = !DILocation(line: 16, column: 14, scope: !29) -!51 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argv", line: 16, arg: 2, scope: !29, file: !6, type: !32) +!51 = !DILocalVariable(name: "argv", line: 16, arg: 2, scope: !29, file: !6, type: !32) !52 = !DILocation(line: 16, column: 27, scope: !29) -!53 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "myBar", line: 18, scope: !54, file: !6, type: !5) +!53 = !DILocalVariable(name: "myBar", line: 18, scope: !54, file: !6, type: !5) !54 = distinct !DILexicalBlock(line: 17, column: 1, file: !82, scope: !29) !55 = !DILocation(line: 18, column: 9, scope: !54) !56 = !DILocation(line: 18, column: 17, scope: !54) !57 = !DILocation(line: 19, column: 5, scope: !54) -!58 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 13, arg: 1, flags: DIFlagArtificial, scope: !37, file: !6, type: !24) +!58 = !DILocalVariable(name: "this", line: 13, arg: 1, flags: DIFlagArtificial, scope: !37, file: !6, type: !24) !59 = !DILocation(line: 13, column: 5, scope: !37) -!60 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 13, arg: 2, scope: !37, file: !6, type: !12) +!60 = !DILocalVariable(name: "x", line: 13, arg: 2, scope: !37, file: !6, type: !12) !61 = !DILocation(line: 13, column: 13, scope: !37) !62 = !DILocation(line: 13, column: 34, scope: !37) -!63 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 13, arg: 1, flags: DIFlagArtificial, scope: !40, file: !6, type: !24) +!63 = !DILocalVariable(name: "this", line: 13, arg: 1, flags: DIFlagArtificial, scope: !40, file: !6, type: !24) !64 = !DILocation(line: 13, column: 5, scope: !40) -!65 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 13, arg: 2, scope: !40, file: !6, type: !12) +!65 = !DILocalVariable(name: "x", line: 13, arg: 2, scope: !40, file: !6, type: !12) !66 = !DILocation(line: 13, column: 13, scope: !40) !67 = !DILocation(line: 13, column: 33, scope: !40) !68 = !DILocation(line: 13, column: 34, scope: !69) !69 = distinct !DILexicalBlock(line: 13, column: 33, file: !82, scope: !40) -!70 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 6, arg: 1, flags: DIFlagArtificial, scope: !43, file: !6, type: !16) +!70 = !DILocalVariable(name: "this", line: 6, arg: 1, flags: DIFlagArtificial, scope: !43, file: !6, type: !16) !71 = !DILocation(line: 6, column: 5, scope: !43) -!72 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 6, arg: 2, scope: !43, file: !6, type: !12) +!72 = !DILocalVariable(name: "a", line: 6, arg: 2, scope: !43, file: !6, type: !12) !73 = !DILocation(line: 6, column: 13, scope: !43) !74 = !DILocation(line: 6, column: 24, scope: !43) -!75 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 6, arg: 1, flags: DIFlagArtificial, scope: !46, file: !6, type: !16) +!75 = !DILocalVariable(name: "this", line: 6, arg: 1, flags: DIFlagArtificial, scope: !46, file: !6, type: !16) !76 = !DILocation(line: 6, column: 5, scope: !46) -!77 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 6, arg: 2, scope: !46, file: !6, type: !12) +!77 = !DILocalVariable(name: "a", line: 6, arg: 2, scope: !46, file: !6, type: !12) !78 = !DILocation(line: 6, column: 13, scope: !46) !79 = !DILocation(line: 6, column: 23, scope: !46) !80 = !DILocation(line: 6, column: 24, scope: !81) diff --git a/test/DebugInfo/X86/DIModuleContext.ll b/test/DebugInfo/X86/DIModuleContext.ll new file mode 100644 index 000000000000..413b45c4ab48 --- /dev/null +++ b/test/DebugInfo/X86/DIModuleContext.ll @@ -0,0 +1,30 @@ +target triple = "x86_64-apple-macosx" +; RUN: %llc_dwarf %s -o - -filetype=obj \ +; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s +; CHECK: DW_TAG_module +; CHECK-NOT: NULL +; CHECK: DW_TAG_structure_type + +; Hand-crafted based on +; struct s; +; struct s *s; + +%struct.s = type opaque + +@i = common global %struct.s* null, align 8 + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!7, !8} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, globals: !3, imports: !11) +!1 = !DIFile(filename: "test.c", directory: "/") +!2 = !{} +!3 = !{!4} +!4 = !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, variable: %struct.s** @i) +!5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64) +!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "s", scope: !9, file: !1, line: 1, flags: DIFlagFwdDecl) +!7 = !{i32 2, !"Dwarf Version", i32 2} +!8 = !{i32 2, !"Debug Info Version", i32 3} +!9 = !DIModule(scope: null, name: "Module", configMacros: "", includePath: ".", isysroot: "/") +!10 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !0, entity: !9, line: 11) +!11 = !{!10} diff --git a/test/DebugInfo/X86/DW_AT_byte_size.ll b/test/DebugInfo/X86/DW_AT_byte_size.ll index bfad4fe261db..d879f6732e76 100644 --- a/test/DebugInfo/X86/DW_AT_byte_size.ll +++ b/test/DebugInfo/X86/DW_AT_byte_size.ll @@ -10,7 +10,7 @@ %struct.A = type { i32 } -define i32 @_Z3fooP1A(%struct.A* %a) nounwind uwtable ssp { +define i32 @_Z3fooP1A(%struct.A* %a) nounwind uwtable ssp !dbg !5 { entry: %a.addr = alloca %struct.A*, align 8 store %struct.A* %a, %struct.A** %a.addr, align 8 @@ -26,10 +26,10 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!21} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 150996)", isOptimized: false, emissionKind: 0, file: !20, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 150996)", isOptimized: false, emissionKind: 0, file: !20, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "foo", linkageName: "_Z3fooP1A", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !20, scope: !6, type: !7, function: i32 (%struct.A*)* @_Z3fooP1A) +!5 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooP1A", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !20, scope: !6, type: !7) !6 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo") !7 = !DISubroutineType(types: !8) !8 = !{!9, !10} @@ -38,7 +38,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !11 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 1, size: 32, align: 32, file: !20, elements: !12) !12 = !{!13} !13 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 1, size: 32, align: 32, file: !20, scope: !11, baseType: !9) -!16 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 3, arg: 1, scope: !5, file: !6, type: !10) +!16 = !DILocalVariable(name: "a", line: 3, arg: 1, scope: !5, file: !6, type: !10) !17 = !DILocation(line: 3, column: 13, scope: !5) !18 = !DILocation(line: 4, column: 3, scope: !19) !19 = distinct !DILexicalBlock(line: 3, column: 16, file: !20, scope: !5) diff --git a/test/DebugInfo/X86/DW_AT_linkage_name.ll b/test/DebugInfo/X86/DW_AT_linkage_name.ll index 7f18b5037d5a..a3f3da2298e3 100644 --- a/test/DebugInfo/X86/DW_AT_linkage_name.ll +++ b/test/DebugInfo/X86/DW_AT_linkage_name.ll @@ -34,7 +34,7 @@ target triple = "x86_64-apple-macosx10.9.0" %struct.A = type { i8 } ; Function Attrs: nounwind ssp uwtable -define void @_ZN1AD2Ev(%struct.A* %this) unnamed_addr #0 align 2 { +define void @_ZN1AD2Ev(%struct.A* %this) unnamed_addr #0 align 2 !dbg !17 { entry: %this.addr = alloca %struct.A*, align 8 store %struct.A* %this, %struct.A** %this.addr, align 8 @@ -47,7 +47,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 ; Function Attrs: nounwind ssp uwtable -define void @_ZN1AD1Ev(%struct.A* %this) unnamed_addr #0 align 2 { +define void @_ZN1AD1Ev(%struct.A* %this) unnamed_addr #0 align 2 !dbg !18 { entry: %this.addr = alloca %struct.A*, align 8 store %struct.A* %this, %struct.A** %this.addr, align 8 @@ -58,7 +58,7 @@ entry: } ; Function Attrs: ssp uwtable -define void @_Z3foov() #2 { +define void @_Z3foov() #2 !dbg !19 { entry: %a = alloca %struct.A, align 1 call void @llvm.dbg.declare(metadata %struct.A* %a, metadata !34, metadata !DIExpression()), !dbg !35 @@ -77,7 +77,7 @@ attributes #2 = { ssp uwtable } !llvm.module.flags = !{!23, !24} !llvm.ident = !{!25} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !16, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !16, globals: !2, imports: !2) !1 = !DIFile(filename: "linkage-name.cpp", directory: "") !2 = !{} !3 = !{!4} @@ -92,23 +92,23 @@ attributes #2 = { ssp uwtable } !13 = !DISubroutineType(types: !14) !14 = !{null, !9} !16 = !{!17, !18, !19} -!17 = !DISubprogram(name: "~A", linkageName: "_ZN1AD2Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !"_ZTS1A", type: !13, function: void (%struct.A*)* @_ZN1AD2Ev, declaration: !12, variables: !2) -!18 = !DISubprogram(name: "~A", linkageName: "_ZN1AD1Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !"_ZTS1A", type: !13, function: void (%struct.A*)* @_ZN1AD1Ev, declaration: !12, variables: !2) -!19 = !DISubprogram(name: "foo", linkageName: "_Z3foov", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !20, type: !21, function: void ()* @_Z3foov, variables: !2) +!17 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD2Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !"_ZTS1A", type: !13, declaration: !12, variables: !2) +!18 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD1Ev", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !"_ZTS1A", type: !13, declaration: !12, variables: !2) +!19 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !20, type: !21, variables: !2) !20 = !DIFile(filename: "linkage-name.cpp", directory: "") !21 = !DISubroutineType(types: !22) !22 = !{null} !23 = !{i32 2, !"Dwarf Version", i32 2} !24 = !{i32 1, !"Debug Info Version", i32 3} !25 = !{!"clang version 3.5.0 "} -!26 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !27) +!26 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !27) !27 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A") !28 = !DILocation(line: 0, scope: !17) !29 = !DILocation(line: 8, scope: !17) -!30 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !18, type: !27) +!30 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !18, type: !27) !31 = !DILocation(line: 0, scope: !18) !32 = !DILocation(line: 6, scope: !18) !33 = !DILocation(line: 8, scope: !18) -!34 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 11, scope: !19, file: !20, type: !"_ZTS1A") +!34 = !DILocalVariable(name: "a", line: 11, scope: !19, file: !20, type: !"_ZTS1A") !35 = !DILocation(line: 11, scope: !19) !36 = !DILocation(line: 12, scope: !19) diff --git a/test/DebugInfo/X86/DW_AT_location-reference.ll b/test/DebugInfo/X86/DW_AT_location-reference.ll index 96d1e5099574..593611d76bc4 100644 --- a/test/DebugInfo/X86/DW_AT_location-reference.ll +++ b/test/DebugInfo/X86/DW_AT_location-reference.ll @@ -60,7 +60,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 @a = external global i32 -define void @f() nounwind { +define void @f() nounwind !dbg !0 { entry: %call = tail call i32 @g(i32 0, i32 0) nounwind, !dbg !8 store i32 %call, i32* @a, align 4, !dbg !8 @@ -102,12 +102,12 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!24} -!0 = !DISubprogram(name: "f", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !23, scope: !1, type: !3, function: void ()* @f, variables: !22) +!0 = distinct !DISubprogram(name: "f", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !23, scope: !1, type: !3, variables: !22) !1 = !DIFile(filename: "simple.c", directory: "/home/rengol01/temp/tests/dwarf/relocation") -!2 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk)", isOptimized: true, emissionKind: 1, file: !23, enums: !{}, retainedTypes: !{}, subprograms: !21, imports: null) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk)", isOptimized: true, emissionKind: 1, file: !23, enums: !{}, retainedTypes: !{}, subprograms: !21, imports: null) !3 = !DISubroutineType(types: !4) !4 = !{null} -!5 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "x", line: 5, scope: !6, file: !1, type: !7) +!5 = !DILocalVariable(name: "x", line: 5, scope: !6, file: !1, type: !7) !6 = distinct !DILexicalBlock(line: 4, column: 14, file: !23, scope: !0) !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !8 = !DILocation(line: 6, column: 3, scope: !6) diff --git a/test/DebugInfo/X86/DW_AT_object_pointer.ll b/test/DebugInfo/X86/DW_AT_object_pointer.ll index 86d67cae6b0d..4e6c7c83d1f4 100644 --- a/test/DebugInfo/X86/DW_AT_object_pointer.ll +++ b/test/DebugInfo/X86/DW_AT_object_pointer.ll @@ -12,7 +12,7 @@ %class.A = type { i32 } -define i32 @_Z3fooi(i32) nounwind uwtable ssp { +define i32 @_Z3fooi(i32) nounwind uwtable ssp !dbg !5 { entry: %.addr = alloca i32, align 4 %a = alloca %class.A, align 4 @@ -27,7 +27,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone -define linkonce_odr void @_ZN1AC1Ev(%class.A* %this) unnamed_addr nounwind uwtable ssp align 2 { +define linkonce_odr void @_ZN1AC1Ev(%class.A* %this) unnamed_addr nounwind uwtable ssp align 2 !dbg !10 { entry: %this.addr = alloca %class.A*, align 8 store %class.A* %this, %class.A** %this.addr, align 8 @@ -37,7 +37,7 @@ entry: ret void, !dbg !29 } -define linkonce_odr void @_ZN1AC2Ev(%class.A* %this) unnamed_addr nounwind uwtable ssp align 2 { +define linkonce_odr void @_ZN1AC2Ev(%class.A* %this) unnamed_addr nounwind uwtable ssp align 2 !dbg !20 { entry: %this.addr = alloca %class.A*, align 8 store %class.A* %this, %class.A** %this.addr, align 8 @@ -51,15 +51,15 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!38} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 163586) (llvm/trunk 163570)", isOptimized: false, emissionKind: 0, file: !37, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 163586) (llvm/trunk 163570)", isOptimized: false, emissionKind: 0, file: !37, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5, !10, !20} -!5 = !DISubprogram(name: "foo", linkageName: "_Z3fooi", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !6, scope: !6, type: !7, function: i32 (i32)* @_Z3fooi, variables: !1) +!5 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !6, scope: !6, type: !7, variables: !1) !6 = !DIFile(filename: "bar.cpp", directory: "/Users/echristo/debug-tests") !7 = !DISubroutineType(types: !8) !8 = !{!9} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = !DISubprogram(name: "A", linkageName: "_ZN1AC1Ev", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: null, type: !11, function: void (%class.A*)* @_ZN1AC1Ev, declaration: !17, variables: !1) +!10 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC1Ev", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: null, type: !11, declaration: !17, variables: !1) !11 = !DISubroutineType(types: !12) !12 = !{null, !13} !13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !14) @@ -67,22 +67,22 @@ entry: !15 = !{!16, !17} !16 = !DIDerivedType(tag: DW_TAG_member, name: "m_a", line: 4, size: 32, align: 32, file: !37, scope: !14, baseType: !9) !17 = !DISubprogram(name: "A", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: !14, type: !11) -!20 = !DISubprogram(name: "A", linkageName: "_ZN1AC2Ev", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: null, type: !11, function: void (%class.A*)* @_ZN1AC2Ev, declaration: !17, variables: !1) -!21 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 8, scope: !22, file: !6, type: !14) +!20 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2Ev", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: null, type: !11, declaration: !17, variables: !1) +!21 = !DILocalVariable(name: "a", line: 8, scope: !22, file: !6, type: !14) !22 = distinct !DILexicalBlock(line: 7, column: 11, file: !6, scope: !5) !23 = !DILocation(line: 8, column: 5, scope: !22) !24 = !DILocation(line: 8, column: 6, scope: !22) !25 = !DILocation(line: 9, column: 3, scope: !22) -!26 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 3, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !10, file: !6, type: !27) +!26 = !DILocalVariable(name: "this", line: 3, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !10, file: !6, type: !27) !27 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !14) !28 = !DILocation(line: 3, column: 3, scope: !10) !29 = !DILocation(line: 3, column: 18, scope: !10) -!30 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 3, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !20, file: !6, type: !27) +!30 = !DILocalVariable(name: "this", line: 3, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !20, file: !6, type: !27) !31 = !DILocation(line: 3, column: 3, scope: !20) !32 = !DILocation(line: 3, column: 9, scope: !33) !33 = distinct !DILexicalBlock(line: 3, column: 7, file: !6, scope: !20) !34 = !DILocation(line: 3, column: 18, scope: !33) !35 = !DILocation(line: 7, scope: !5) -!36 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "", line: 7, arg: 1, scope: !5, file: !6, type: !9) +!36 = !DILocalVariable(name: "", line: 7, arg: 1, scope: !5, file: !6, type: !9) !37 = !DIFile(filename: "bar.cpp", directory: "/Users/echristo/debug-tests") !38 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/DW_AT_specification.ll b/test/DebugInfo/X86/DW_AT_specification.ll index 993e623c7511..2b8345b66b71 100644 --- a/test/DebugInfo/X86/DW_AT_specification.ll +++ b/test/DebugInfo/X86/DW_AT_specification.ll @@ -12,7 +12,7 @@ @_ZZN3foo3barEvE1x = constant i32 0, align 4 -define void @_ZN3foo3barEv() { +define void @_ZN3foo3barEv() !dbg !5 { entry: ret void, !dbg !25 } @@ -20,10 +20,10 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!28} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 ()", isOptimized: false, emissionKind: 0, file: !27, enums: !1, retainedTypes: !1, subprograms: !3, globals: !18, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 ()", isOptimized: false, emissionKind: 0, file: !27, enums: !1, retainedTypes: !1, subprograms: !3, globals: !18, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !6, scope: null, type: !7, function: void ()* @_ZN3foo3barEv, declaration: !11) +!5 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !6, scope: null, type: !7, declaration: !11) !6 = !DIFile(filename: "nsNativeAppSupportBase.ii", directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/toolkit/library") !7 = !DISubroutineType(types: !8) !8 = !{null, !9} diff --git a/test/DebugInfo/X86/DW_AT_stmt_list_sec_offset.ll b/test/DebugInfo/X86/DW_AT_stmt_list_sec_offset.ll index c8e71a26b8fe..988a2b7daf4f 100644 --- a/test/DebugInfo/X86/DW_AT_stmt_list_sec_offset.ll +++ b/test/DebugInfo/X86/DW_AT_stmt_list_sec_offset.ll @@ -18,7 +18,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 target triple = "i686-pc-win32" ; Function Attrs: nounwind -define i32 @main() #0 { +define i32 @main() #0 !dbg !4 { entry: %retval = alloca i32, align 4 store i32 0, i32* %retval @@ -30,11 +30,11 @@ attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"= !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!9, !11} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "test.c", directory: "C:\5CProjects") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "test.c", directory: "C:CProjects") !6 = !DISubroutineType(types: !7) !7 = !{!8} diff --git a/test/DebugInfo/X86/DW_TAG_friend.ll b/test/DebugInfo/X86/DW_TAG_friend.ll index 8237c4086d31..8681f33e7e28 100644 --- a/test/DebugInfo/X86/DW_TAG_friend.ll +++ b/test/DebugInfo/X86/DW_TAG_friend.ll @@ -18,7 +18,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!29} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 153413) (llvm/trunk 153428)", isOptimized: false, emissionKind: 0, file: !28, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 153413) (llvm/trunk 153428)", isOptimized: false, emissionKind: 0, file: !28, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) !1 = !{} !3 = !{!5, !17} !5 = !DIGlobalVariable(name: "a", line: 10, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %class.A* @a) diff --git a/test/DebugInfo/X86/InlinedFnLocalVar.ll b/test/DebugInfo/X86/InlinedFnLocalVar.ll index 74de8b6e6a92..a262fc8e88ca 100644 --- a/test/DebugInfo/X86/InlinedFnLocalVar.ll +++ b/test/DebugInfo/X86/InlinedFnLocalVar.ll @@ -12,7 +12,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone -define i32 @bar() nounwind ssp { +define i32 @bar() nounwind ssp !dbg !6 { entry: %0 = load i32, i32* @i, align 4, !dbg !17 ; <i32> [#uses=2] tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !109, metadata !DIExpression()), !dbg !19 @@ -25,20 +25,20 @@ entry: !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!28} -!0 = !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24) +!0 = distinct !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24) !1 = !DIFile(filename: "bar.c", directory: "/tmp/") -!2 = !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports: !20) +!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports: !20) !3 = !DISubroutineType(types: !4) !4 = !{!5, !5} !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = !DISubprogram(name: "bar", linkageName: "bar", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !27, scope: !1, type: !7, function: i32 ()* @bar) +!6 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !27, scope: !1, type: !7) !7 = !DISubroutineType(types: !8) !8 = !{!5} -!9 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "j", line: 9, arg: 0, scope: !0, file: !1, type: !5) -!10 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "xyz", line: 10, scope: !11, file: !1, type: !12) +!9 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5) +!10 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12) -!109 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "j", line: 9, arg: 0, scope: !0, file: !1, type: !5) -!110 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "xyz", line: 10, scope: !11, file: !1, type: !12) +!109 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5) +!110 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12) !11 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !0) !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13) diff --git a/test/DebugInfo/X86/aligned_stack_var.ll b/test/DebugInfo/X86/aligned_stack_var.ll index 560125d6f40d..02a51f346ee7 100644 --- a/test/DebugInfo/X86/aligned_stack_var.ll +++ b/test/DebugInfo/X86/aligned_stack_var.ll @@ -15,7 +15,7 @@ ; CHECK-NOT: {{DW_AT_location.*DW_FORM_block1.*0x.*91}} ; CHECK: NULL -define void @_Z3runv() nounwind uwtable { +define void @_Z3runv() nounwind uwtable !dbg !5 { entry: %x = alloca i32, align 32 call void @llvm.dbg.declare(metadata i32* %x, metadata !9, metadata !DIExpression()), !dbg !12 @@ -27,14 +27,14 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!15} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 155696:155697) (llvm/trunk 155696)", isOptimized: false, emissionKind: 0, file: !14, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 155696:155697) (llvm/trunk 155696)", isOptimized: false, emissionKind: 0, file: !14, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "run", linkageName: "_Z3runv", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !14, scope: !6, type: !7, function: void ()* @_Z3runv, variables: !1) +!5 = distinct !DISubprogram(name: "run", linkageName: "_Z3runv", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !14, scope: !6, type: !7, variables: !1) !6 = !DIFile(filename: "test.cc", directory: "/home/samsonov/debuginfo") !7 = !DISubroutineType(types: !8) !8 = !{null} -!9 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "x", line: 2, scope: !10, file: !6, type: !11) +!9 = !DILocalVariable(name: "x", line: 2, scope: !10, file: !6, type: !11) !10 = distinct !DILexicalBlock(line: 1, column: 12, file: !14, scope: !5) !11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !12 = !DILocation(line: 2, column: 7, scope: !10) diff --git a/test/DebugInfo/X86/arange-and-stub.ll b/test/DebugInfo/X86/arange-and-stub.ll index bbc6de5e573c..39727753b8f9 100644 --- a/test/DebugInfo/X86/arange-and-stub.ll +++ b/test/DebugInfo/X86/arange-and-stub.ll @@ -1,10 +1,10 @@ ; RUN: llc -generate-arange-section -relocation-model=pic < %s | FileCheck %s -; CHECK: .section .data.rel,"aw",@progbits +; CHECK: .data ; CHECK-NOT: .section ; CHECK: .L_ZTId.DW.stub: -; CHECK: .section .data.rel,"aw",@progbits +; CHECK: .data ; CHECK-NEXT: .Lsec_end0: target triple = "x86_64-linux-gnu" @@ -12,11 +12,11 @@ target triple = "x86_64-linux-gnu" @_ZTId = external constant i8* @zed = global [1 x void ()*] [void ()* @bar] -define void @foo() { +define void @foo() !dbg !4 { ret void } -define void @bar() personality i8* bitcast (void ()* @foo to i8*) { +define void @bar() personality i8* bitcast (void ()* @foo to i8*) !dbg !9 { invoke void @foo() to label %invoke.cont unwind label %lpad @@ -32,16 +32,16 @@ lpad: ; preds = %0 !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!17, !18} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 234308) (llvm/trunk 234310)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !10, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 234308) (llvm/trunk 234310)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !10, imports: !2) !1 = !DIFile(filename: "/Users/espindola/llvm/<stdin>", directory: "/Users/espindola/llvm/build") !2 = !{} !3 = !{!4, !9} -!4 = !DISubprogram(name: "foo", linkageName: "foo", scope: !5, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !5, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, variables: !2) !5 = !DIFile(filename: "/Users/espindola/llvm/test.cpp", directory: "/Users/espindola/llvm/build") !6 = !DISubroutineType(types: !7) !7 = !{null, !8} !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = !DISubprogram(name: "bar_d", linkageName: "bar", scope: !5, file: !5, line: 3, type: !6, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @bar, variables: !2) +!9 = distinct !DISubprogram(name: "bar_d", linkageName: "bar", scope: !5, file: !5, line: 3, type: !6, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, variables: !2) !10 = !{!11} !11 = !DIGlobalVariable(name: "zed", scope: !0, file: !5, line: 6, type: !12, isLocal: false, isDefinition: true, variable: [1 x void ()*]* @zed) !12 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 64, align: 64, elements: !15) diff --git a/test/DebugInfo/X86/arange.ll b/test/DebugInfo/X86/arange.ll index 0b0c2a0b3ee7..f88cdb3a90ad 100644 --- a/test/DebugInfo/X86/arange.ll +++ b/test/DebugInfo/X86/arange.ll @@ -29,7 +29,7 @@ !llvm.module.flags = !{!12, !13} !llvm.ident = !{!14} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !9, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !9, imports: !2) !1 = !DIFile(filename: "simple.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/X86/arguments.ll b/test/DebugInfo/X86/arguments.ll index 0af119b241fc..8b3902765bbd 100644 --- a/test/DebugInfo/X86/arguments.ll +++ b/test/DebugInfo/X86/arguments.ll @@ -29,7 +29,7 @@ %struct.foo = type { i32 } ; Function Attrs: nounwind uwtable -define void @_Z4func3fooS_(%struct.foo* %f, %struct.foo* %g) #0 { +define void @_Z4func3fooS_(%struct.foo* %f, %struct.foo* %g) #0 !dbg !4 { entry: call void @llvm.dbg.declare(metadata %struct.foo* %f, metadata !19, metadata !DIExpression()), !dbg !20 call void @llvm.dbg.declare(metadata %struct.foo* %g, metadata !21, metadata !DIExpression()), !dbg !20 @@ -49,11 +49,11 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!24} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "scratch.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "func", linkageName: "_Z4func3fooS_", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, function: void (%struct.foo*, %struct.foo*)* @_Z4func3fooS_, variables: !2) +!4 = distinct !DISubprogram(name: "func", linkageName: "_Z4func3fooS_", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "scratch.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch") !6 = !DISubroutineType(types: !7) !7 = !{null, !8, !8} @@ -67,9 +67,9 @@ attributes #1 = { nounwind readnone } !15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !8) !16 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !17) !17 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8) -!19 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "f", line: 6, arg: 1, scope: !4, file: !5, type: !8) +!19 = !DILocalVariable(name: "f", line: 6, arg: 1, scope: !4, file: !5, type: !8) !20 = !DILocation(line: 6, scope: !4) -!21 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "g", line: 6, arg: 2, scope: !4, file: !5, type: !8) +!21 = !DILocalVariable(name: "g", line: 6, arg: 2, scope: !4, file: !5, type: !8) !22 = !DILocation(line: 7, scope: !4) !23 = !DILocation(line: 8, scope: !4) !24 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/array.ll b/test/DebugInfo/X86/array.ll index 8da2079a0530..4ffe0a710b85 100644 --- a/test/DebugInfo/X86/array.ll +++ b/test/DebugInfo/X86/array.ll @@ -16,32 +16,34 @@ ; Test that we only emit register-indirect locations for the array array. ; rdar://problem/14874886 ; -; CHECK: ##DEBUG_VALUE: main:array <- [R{{.*}}+0] -; CHECK-NOT: ##DEBUG_VALUE: main:array <- R{{.*}} +; CHECK: ##DEBUG_VALUE: main:array <- [%R{{.*}}+0] +; CHECK: ##DEBUG_VALUE: main:array <- [%R{{.*}}+0] +; CHECK: ##DEBUG_VALUE: main:array <- [%R{{.*}}+0] +; CHECK-NOT: ##DEBUG_VALUE: main:array <- %R{{.*}} target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.9.0" @main.array = private unnamed_addr constant [4 x i32] [i32 0, i32 1, i32 2, i32 3], align 16 ; Function Attrs: nounwind ssp uwtable -define void @f(i32* nocapture %p) #0 { +define void @f(i32* nocapture %p) #0 !dbg !4 { tail call void @llvm.dbg.value(metadata i32* %p, i64 0, metadata !11, metadata !DIExpression()), !dbg !28 store i32 42, i32* %p, align 4, !dbg !29, !tbaa !30 ret void, !dbg !34 } ; Function Attrs: nounwind ssp uwtable -define i32 @main(i32 %argc, i8** nocapture readnone %argv) #0 { +define i32 @main(i32 %argc, i8** nocapture readnone %argv) #0 !dbg !12 { %array = alloca [4 x i32], align 16 tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !19, metadata !DIExpression()), !dbg !35 tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !20, metadata !DIExpression()), !dbg !35 - tail call void @llvm.dbg.value(metadata [4 x i32]* %array, i64 0, metadata !21, metadata !DIExpression()), !dbg !36 + tail call void @llvm.dbg.value(metadata [4 x i32]* %array, i64 0, metadata !21, metadata !DIExpression(DW_OP_deref)), !dbg !36 %1 = bitcast [4 x i32]* %array to i8*, !dbg !36 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast ([4 x i32]* @main.array to i8*), i64 16, i32 16, i1 false), !dbg !36 - tail call void @llvm.dbg.value(metadata [4 x i32]* %array, i64 0, metadata !21, metadata !DIExpression()), !dbg !36 + tail call void @llvm.dbg.value(metadata [4 x i32]* %array, i64 0, metadata !21, metadata !DIExpression(DW_OP_deref)), !dbg !36 %2 = getelementptr inbounds [4 x i32], [4 x i32]* %array, i64 0, i64 0, !dbg !37 call void @f(i32* %2), !dbg !37 - tail call void @llvm.dbg.value(metadata [4 x i32]* %array, i64 0, metadata !21, metadata !DIExpression()), !dbg !36 + tail call void @llvm.dbg.value(metadata [4 x i32]* %array, i64 0, metadata !21, metadata !DIExpression(DW_OP_deref)), !dbg !36 %3 = load i32, i32* %2, align 16, !dbg !38, !tbaa !30 ret i32 %3, !dbg !38 } @@ -60,28 +62,28 @@ attributes #2 = { nounwind readnone } !llvm.module.flags = !{!25, !26} !llvm.ident = !{!27} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "array.c", directory: "") !2 = !{} !3 = !{!4, !12} -!4 = !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !1, scope: !5, type: !6, function: void (i32*)* @f, variables: !10) +!4 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !10) !5 = !DIFile(filename: "array.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{null, !8} !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9) !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !10 = !{!11} -!11 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "p", line: 1, arg: 1, scope: !4, file: !5, type: !8) -!12 = !DISubprogram(name: "main", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !13, function: i32 (i32, i8**)* @main, variables: !18) +!11 = !DILocalVariable(name: "p", line: 1, arg: 1, scope: !4, file: !5, type: !8) +!12 = distinct !DISubprogram(name: "main", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !13, variables: !18) !13 = !DISubroutineType(types: !14) !14 = !{!9, !9, !15} !15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !16) !16 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !17) !17 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) !18 = !{!19, !20, !21} -!19 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argc", line: 5, arg: 1, scope: !12, file: !5, type: !9) -!20 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argv", line: 5, arg: 2, scope: !12, file: !5, type: !15) -!21 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "array", line: 6, scope: !12, file: !5, type: !22) +!19 = !DILocalVariable(name: "argc", line: 5, arg: 1, scope: !12, file: !5, type: !9) +!20 = !DILocalVariable(name: "argv", line: 5, arg: 2, scope: !12, file: !5, type: !15) +!21 = !DILocalVariable(name: "array", line: 6, scope: !12, file: !5, type: !22) !22 = !DICompositeType(tag: DW_TAG_array_type, size: 128, align: 32, baseType: !9, elements: !23) !23 = !{!24} !24 = !DISubrange(count: 4) diff --git a/test/DebugInfo/X86/array2.ll b/test/DebugInfo/X86/array2.ll index e08c52640b3f..f456aae2e250 100644 --- a/test/DebugInfo/X86/array2.ll +++ b/test/DebugInfo/X86/array2.ll @@ -17,7 +17,7 @@ ; ; CHECK: define i32 @main ; CHECK: call void @llvm.dbg.value(metadata i32 42, i64 0, metadata ![[ARRAY:[0-9]+]], metadata ![[EXPR:[0-9]+]]) -; CHECK: ![[ARRAY]] = !DILocalVariable(tag: DW_TAG_auto_variable, name: "array",{{.*}} line: 6 +; CHECK: ![[ARRAY]] = !DILocalVariable(name: "array",{{.*}} line: 6 ; CHECK: ![[EXPR]] = !DIExpression(DW_OP_bit_piece, 0, 32) target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.9.0" @@ -25,7 +25,7 @@ target triple = "x86_64-apple-macosx10.9.0" @main.array = private unnamed_addr constant [4 x i32] [i32 0, i32 1, i32 2, i32 3], align 16 ; Function Attrs: nounwind ssp uwtable -define void @f(i32* %p) #0 { +define void @f(i32* %p) #0 !dbg !4 { entry: %p.addr = alloca i32*, align 8 store i32* %p, i32** %p.addr, align 8 @@ -40,7 +40,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 ; Function Attrs: nounwind ssp uwtable -define i32 @main(i32 %argc, i8** %argv) #0 { +define i32 @main(i32 %argc, i8** %argv) #0 !dbg !10 { entry: %retval = alloca i32, align 4 %argc.addr = alloca i32, align 4 @@ -72,17 +72,17 @@ attributes #2 = { nounwind } !llvm.module.flags = !{!16, !17} !llvm.ident = !{!18} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "array.c", directory: "") !2 = !{} !3 = !{!4, !10} -!4 = !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void (i32*)* @f, variables: !2) +!4 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "array.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{null, !8} !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9) !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = !DISubprogram(name: "main", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !11, function: i32 (i32, i8**)* @main, variables: !2) +!10 = distinct !DISubprogram(name: "main", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !11, variables: !2) !11 = !DISubroutineType(types: !12) !12 = !{!9, !9, !13} !13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !14) @@ -91,14 +91,14 @@ attributes #2 = { nounwind } !16 = !{i32 2, !"Dwarf Version", i32 2} !17 = !{i32 1, !"Debug Info Version", i32 3} !18 = !{!"clang version 3.5.0 "} -!19 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "p", line: 1, arg: 1, scope: !4, file: !5, type: !8) +!19 = !DILocalVariable(name: "p", line: 1, arg: 1, scope: !4, file: !5, type: !8) !20 = !DILocation(line: 1, scope: !4) !21 = !DILocation(line: 2, scope: !4) !22 = !DILocation(line: 3, scope: !4) -!23 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argc", line: 5, arg: 1, scope: !10, file: !5, type: !9) +!23 = !DILocalVariable(name: "argc", line: 5, arg: 1, scope: !10, file: !5, type: !9) !24 = !DILocation(line: 5, scope: !10) -!25 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argv", line: 5, arg: 2, scope: !10, file: !5, type: !13) -!26 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "array", line: 6, scope: !10, file: !5, type: !27) +!25 = !DILocalVariable(name: "argv", line: 5, arg: 2, scope: !10, file: !5, type: !13) +!26 = !DILocalVariable(name: "array", line: 6, scope: !10, file: !5, type: !27) !27 = !DICompositeType(tag: DW_TAG_array_type, size: 128, align: 32, baseType: !9, elements: !28) !28 = !{!29} !29 = !DISubrange(count: 4) diff --git a/test/DebugInfo/X86/bbjoin.ll b/test/DebugInfo/X86/bbjoin.ll new file mode 100644 index 000000000000..8061a8d2ce9a --- /dev/null +++ b/test/DebugInfo/X86/bbjoin.ll @@ -0,0 +1,101 @@ +; RUN: llc -mtriple=x86_64-apple-macosx10.9.0 %s -stop-after=livedebugvars \ +; RUN: -o %t.s | FileCheck %s +; Generated from: +; void g(int *); +; int f() { +; int x = 23; +; g(&x); +; if (x == 42) +; ++x; +; return x; // check that x is not a constant here. +; } +; CHECK: ![[X:.*]] = !DILocalVariable(name: "x", +; CHECK: bb.0.entry: +; CHECK: DBG_VALUE 23, 0, ![[X]], +; CHECK: DBG_VALUE debug-use %rdi, debug-use _, ![[X]] +; CHECK: bb.1.if.then: +; CHECK: DBG_VALUE debug-use %rdi, debug-use _, ![[X]], +; CHECK: bb.2.if.end: +; CHECK-NOT: DBG_VALUE 23, 0, ![[X]], +; CHECK: RETQ %eax + +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.11.0" + +; Function Attrs: nounwind ssp uwtable +define i32 @f() #0 !dbg !4 { +entry: + %x = alloca i32, align 4 + %0 = bitcast i32* %x to i8*, !dbg !14 + call void @llvm.lifetime.start(i64 4, i8* %0) #4, !dbg !14 + tail call void @llvm.dbg.value(metadata i32 23, i64 0, metadata !9, metadata !15), !dbg !16 + store i32 23, i32* %x, align 4, !dbg !16, !tbaa !17 + tail call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !15), !dbg !16 + call void @g(i32* nonnull %x) #4, !dbg !21 + call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !15), !dbg !16 + %1 = load i32, i32* %x, align 4, !dbg !22, !tbaa !17 + %cmp = icmp eq i32 %1, 42, !dbg !24 + br i1 %cmp, label %if.then, label %if.end, !dbg !25 + +if.then: ; preds = %entry + call void @llvm.dbg.value(metadata i32 43, i64 0, metadata !9, metadata !15), !dbg !16 + store i32 43, i32* %x, align 4, !dbg !26, !tbaa !17 + br label %if.end, !dbg !26 + +if.end: ; preds = %if.then, %entry + %2 = phi i32 [ 43, %if.then ], [ %1, %entry ], !dbg !27 + call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !15), !dbg !16 + call void @llvm.lifetime.end(i64 4, i8* %0) #4, !dbg !28 + ret i32 %2, !dbg !29 +} + +; Function Attrs: argmemonly nounwind +declare void @llvm.lifetime.start(i64, i8* nocapture) #1 + +declare void @g(i32*) #4 + +; Function Attrs: argmemonly nounwind +declare void @llvm.lifetime.end(i64, i8* nocapture) #1 + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #3 + +attributes #0 = { nounwind ssp uwtable } +attributes #1 = { argmemonly nounwind } +attributes #3 = { nounwind readnone } +attributes #4 = { nounwind } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!10, !11, !12} +!llvm.ident = !{!13} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 255890) (llvm/trunk 255919)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!1 = !DIFile(filename: "constant.c", directory: "") +!2 = !{} +!3 = !{!4} +!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: true, variables: !8) +!5 = !DISubroutineType(types: !6) +!6 = !{!7} +!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!8 = !{!9} +!9 = !DILocalVariable(name: "x", scope: !4, file: !1, line: 3, type: !7) +!10 = !{i32 2, !"Dwarf Version", i32 2} +!11 = !{i32 2, !"Debug Info Version", i32 3} +!12 = !{i32 1, !"PIC Level", i32 2} +!13 = !{!"clang version 3.8.0 (trunk 255890) (llvm/trunk 255919)"} +!14 = !DILocation(line: 3, column: 3, scope: !4) +!15 = !DIExpression() +!16 = !DILocation(line: 3, column: 7, scope: !4) +!17 = !{!18, !18, i64 0} +!18 = !{!"int", !19, i64 0} +!19 = !{!"omnipotent char", !20, i64 0} +!20 = !{!"Simple C/C++ TBAA"} +!21 = !DILocation(line: 4, column: 3, scope: !4) +!22 = !DILocation(line: 5, column: 7, scope: !23) +!23 = distinct !DILexicalBlock(scope: !4, file: !1, line: 5, column: 7) +!24 = !DILocation(line: 5, column: 9, scope: !23) +!25 = !DILocation(line: 5, column: 7, scope: !4) +!26 = !DILocation(line: 6, column: 5, scope: !23) +!27 = !DILocation(line: 7, column: 10, scope: !4) +!28 = !DILocation(line: 8, column: 1, scope: !4) +!29 = !DILocation(line: 7, column: 3, scope: !4) diff --git a/test/DebugInfo/X86/bitfields.ll b/test/DebugInfo/X86/bitfields.ll index e895fd67e03d..e0fa4f6d9980 100644 --- a/test/DebugInfo/X86/bitfields.ll +++ b/test/DebugInfo/X86/bitfields.ll @@ -54,7 +54,7 @@ target triple = "x86_64-apple-macosx" !llvm.module.flags = !{!13, !14, !15} !llvm.ident = !{!16} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) !1 = !DIFile(filename: "bitfields.c", directory: "/") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/X86/block-capture.ll b/test/DebugInfo/X86/block-capture.ll index fe026d656bb6..640973ed2a68 100644 --- a/test/DebugInfo/X86/block-capture.ll +++ b/test/DebugInfo/X86/block-capture.ll @@ -27,7 +27,7 @@ target triple = "x86_64-apple-darwin" declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 ; Function Attrs: ssp uwtable -define internal void @__foo_block_invoke(i8* %.block_descriptor) #2 { +define internal void @__foo_block_invoke(i8* %.block_descriptor) #2 !dbg !8 { entry: %.block_descriptor.addr = alloca i8*, align 8 %block.addr = alloca <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, void (...)* }>*, align 8 @@ -62,14 +62,14 @@ attributes #3 = { nounwind } !llvm.module.flags = !{!16, !17, !18, !19, !20, !21, !22} !llvm.ident = !{!23} -!0 = !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.6.0 (trunk 223471)", isOptimized: false, runtimeVersion: 2, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.6.0 (trunk 223471)", isOptimized: false, runtimeVersion: 2, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "foo.m", directory: "") !2 = !{} !3 = !{!8} !5 = !DIFile(filename: "foo.m", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{null} -!8 = !DISubprogram(name: "__foo_block_invoke", line: 2, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !9, function: void (i8*)* @__foo_block_invoke, variables: !2) +!8 = distinct !DISubprogram(name: "__foo_block_invoke", line: 2, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !9, variables: !2) !9 = !DISubroutineType(types: !10) !10 = !{null, !11} !11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null) @@ -102,7 +102,7 @@ attributes #3 = { nounwind } !41 = !DIBasicType(tag: DW_TAG_base_type, name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned) !42 = !DIDerivedType(tag: DW_TAG_member, name: "Size", size: 64, align: 64, offset: 64, file: !1, scope: !5, baseType: !41) !43 = !DIExpression() -!47 = !DILocalVariable(tag: DW_TAG_arg_variable, name: ".block_descriptor", line: 2, arg: 1, flags: DIFlagArtificial, scope: !8, file: !5, type: !48) +!47 = !DILocalVariable(name: ".block_descriptor", line: 2, arg: 1, flags: DIFlagArtificial, scope: !8, file: !5, type: !48) !48 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !49) !49 = !DICompositeType(tag: DW_TAG_structure_type, name: "__block_literal_1", line: 2, size: 320, align: 64, file: !1, scope: !5, elements: !50) !50 = !{!51, !52, !53, !54, !56, !65} @@ -123,7 +123,7 @@ attributes #3 = { nounwind } !65 = !DIDerivedType(tag: DW_TAG_member, name: "block", line: 2, size: 64, align: 64, offset: 256, flags: DIFlagPublic, file: !1, scope: !5, baseType: !25) !66 = !DILocation(line: 2, column: 20, scope: !8) !67 = !DILocation(line: 2, column: 21, scope: !8) -!68 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "block", line: 2, scope: !8, file: !5, type: !25) +!68 = !DILocalVariable(name: "block", line: 2, scope: !8, file: !5, type: !25) !69 = !DIExpression(DW_OP_deref, DW_OP_plus, 32) !70 = !DILocation(line: 2, column: 9, scope: !8) !71 = !DILocation(line: 2, column: 23, scope: !72) diff --git a/test/DebugInfo/X86/byvalstruct.ll b/test/DebugInfo/X86/byvalstruct.ll index dedbfb0200b7..422789ae77b5 100644 --- a/test/DebugInfo/X86/byvalstruct.ll +++ b/test/DebugInfo/X86/byvalstruct.ll @@ -58,7 +58,7 @@ target triple = "x86_64-apple-macosx10.8.0" @llvm.used = appending global [5 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @"\01L_OBJC_CLASS_NAME_", i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @"\01L_OBJC_METH_VAR_TYPE_", i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01l_OBJC_$_INSTANCE_METHODS_Bitmap" to i8*), i8* bitcast ([1 x i8*]* @"\01L_OBJC_LABEL_CLASS_$" to i8*)], section "llvm.metadata" ; Function Attrs: ssp uwtable -define internal i8* @"\01-[Bitmap initWithCopy:andInfo:andLength:]"(%0* %self, i8* %_cmd, %0* %otherBitmap, %struct.ImageInfo* byval align 8 %info, i64 %length) #0 { +define internal i8* @"\01-[Bitmap initWithCopy:andInfo:andLength:]"(%0* %self, i8* %_cmd, %0* %otherBitmap, %struct.ImageInfo* byval align 8 %info, i64 %length) #0 !dbg !7 { entry: %retval = alloca i8*, align 8 %self.addr = alloca %0*, align 8 @@ -87,14 +87,14 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!24, !25, !26, !27, !38} -!0 = !DICompileUnit(language: DW_LANG_ObjC_plus_plus, producer: "clang version 3.4 ", isOptimized: false, runtimeVersion: 2, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !6, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_ObjC_plus_plus, producer: "clang version 3.4 ", isOptimized: false, runtimeVersion: 2, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !6, globals: !2, imports: !2) !1 = !DIFile(filename: "t.mm", directory: "") !2 = !{} !3 = !{!4} !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Bitmap", line: 8, size: 8, align: 8, flags: DIFlagObjcClassComplete, runtimeLang: DW_LANG_ObjC_plus_plus, file: !1, scope: !5, elements: !2) !5 = !DIFile(filename: "t.mm", directory: "") !6 = !{!7} -!7 = !DISubprogram(name: "-[Bitmap initWithCopy:andInfo:andLength:]", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 9, file: !1, scope: !5, type: !8, function: i8* (%0*, i8*, %0*, %struct.ImageInfo*, i64)* @"\01-[Bitmap initWithCopy:andInfo:andLength:]", variables: !2) +!7 = distinct !DISubprogram(name: "-[Bitmap initWithCopy:andInfo:andLength:]", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 9, file: !1, scope: !5, type: !8, variables: !2) !8 = !DISubroutineType(types: !9) !9 = !{!4, !10, !11, !14, !15, !19} !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4) @@ -115,14 +115,14 @@ attributes #1 = { nounwind readnone } !25 = !{i32 1, !"Objective-C Image Info Version", i32 0} !26 = !{i32 1, !"Objective-C Image Info Section", !"__DATA, __objc_imageinfo, regular, no_dead_strip"} !27 = !{i32 4, !"Objective-C Garbage Collection", i32 0} -!28 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "self", line: 9, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !7, file: !5, type: !14) +!28 = !DILocalVariable(name: "self", line: 9, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !7, file: !5, type: !14) !29 = !DILocation(line: 9, scope: !7) -!30 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "_cmd", line: 9, arg: 2, flags: DIFlagArtificial, scope: !7, file: !5, type: !31) +!30 = !DILocalVariable(name: "_cmd", line: 9, arg: 2, flags: DIFlagArtificial, scope: !7, file: !5, type: !31) !31 = !DIDerivedType(tag: DW_TAG_typedef, name: "SEL", line: 9, file: !1, baseType: !12) -!32 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "otherBitmap", line: 9, arg: 3, scope: !7, file: !5, type: !14) -!33 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "info", line: 10, arg: 4, scope: !7, file: !5, type: !15) +!32 = !DILocalVariable(name: "otherBitmap", line: 9, arg: 3, scope: !7, file: !5, type: !14) +!33 = !DILocalVariable(name: "info", line: 10, arg: 4, scope: !7, file: !5, type: !15) !34 = !DILocation(line: 10, scope: !7) -!35 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "length", line: 11, arg: 5, scope: !7, file: !5, type: !19) +!35 = !DILocalVariable(name: "length", line: 11, arg: 5, scope: !7, file: !5, type: !19) !36 = !DILocation(line: 11, scope: !7) !37 = !DILocation(line: 13, scope: !7) !38 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/c-type-units.ll b/test/DebugInfo/X86/c-type-units.ll index 6756bd45f88c..d8321380c535 100644 --- a/test/DebugInfo/X86/c-type-units.ll +++ b/test/DebugInfo/X86/c-type-units.ll @@ -17,7 +17,7 @@ !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) !1 = !DIFile(filename: "simple.c", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/X86/coff_debug_info_type.ll b/test/DebugInfo/X86/coff_debug_info_type.ll index fd86c88baa15..cede74d5dc6a 100644 --- a/test/DebugInfo/X86/coff_debug_info_type.ll +++ b/test/DebugInfo/X86/coff_debug_info_type.ll @@ -5,7 +5,9 @@ ; CHECK: .section .apple_names ; CHECK: .section .apple_types -; RUN: llc -mtriple=i686-pc-win32 -filetype=asm -O0 < %s | FileCheck -check-prefix=WIN32 %s +; RUN: sed -e 's/"Dwarf Version"/"CodeView"/' %s \ +; RUN: | llc -mtriple=i686-pc-win32 -filetype=asm -O0 \ +; RUN: | FileCheck -check-prefix=WIN32 %s ; WIN32: .section .debug$S,"dr" ; RUN: llc -mtriple=i686-pc-win32 -filetype=null -O0 < %s @@ -17,7 +19,7 @@ ; return 0; ; } -define i32 @main() #0 { +define i32 @main() #0 !dbg !4 { entry: %retval = alloca i32, align 4 store i32 0, i32* %retval @@ -29,11 +31,11 @@ attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"= !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!9, !11} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "test.c", directory: "C:\5CProjects") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "test.c", directory: "C:CProjects") !6 = !DISubroutineType(types: !7) !7 = !{!8} diff --git a/test/DebugInfo/X86/coff_relative_names.ll b/test/DebugInfo/X86/coff_relative_names.ll index 6b7864ab3979..7ca4b04a871f 100644 --- a/test/DebugInfo/X86/coff_relative_names.ll +++ b/test/DebugInfo/X86/coff_relative_names.ll @@ -11,7 +11,7 @@ ; } ; Function Attrs: nounwind -define i32 @main() #0 { +define i32 @main() #0 !dbg !4 { entry: %retval = alloca i32, align 4 store i32 0, i32* %retval @@ -23,11 +23,11 @@ attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"= !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!9, !11} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "test.c", directory: "C:\5CProjects") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "test.c", directory: "C:CProjects") !6 = !DISubroutineType(types: !7) !7 = !{!8} diff --git a/test/DebugInfo/X86/concrete_out_of_line.ll b/test/DebugInfo/X86/concrete_out_of_line.ll index c1e1f750e2cc..d34c1ae37e3f 100644 --- a/test/DebugInfo/X86/concrete_out_of_line.ll +++ b/test/DebugInfo/X86/concrete_out_of_line.ll @@ -18,12 +18,14 @@ ; CHECK: DW_AT_name {{.*}} "~nsAutoRefCnt" ; CHECK: DW_TAG_subprogram +; CHECK-NEXT: DW_AT_decl_line {{.*}}18 ; CHECK-NEXT: DW_AT_{{.*}}linkage_name {{.*}}D2 ; CHECK-NEXT: DW_AT_specification {{.*}} "~nsAutoRefCnt" ; CHECK-NEXT: DW_AT_inline ; CHECK-NOT: DW_AT ; CHECK: DW_TAG ; CHECK: DW_TAG_subprogram +; CHECK-NEXT: DW_AT_decl_line {{.*}}18 ; CHECK-NEXT: DW_AT_{{.*}}linkage_name {{.*}}D1 ; CHECK-NEXT: DW_AT_specification {{.*}} "~nsAutoRefCnt" ; CHECK-NEXT: DW_AT_inline @@ -58,14 +60,14 @@ ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev" -define i32 @_ZN17nsAutoRefCnt7ReleaseEv() { +define i32 @_ZN17nsAutoRefCnt7ReleaseEv() !dbg !5 { entry: store i32 1, i32* null, align 4, !dbg !50 tail call void @_Z8moz_freePv(i8* null) nounwind, !dbg !54 ret i32 0 } -define void @_ZN17nsAutoRefCntD1Ev() { +define void @_ZN17nsAutoRefCntD1Ev() !dbg !23 { entry: tail call void @_Z8moz_freePv(i8* null) nounwind, !dbg !57 ret void @@ -76,10 +78,10 @@ declare void @_Z8moz_freePv(i8*) !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!60} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 ()", isOptimized: true, emissionKind: 0, file: !59, enums: !1, retainedTypes: !1, subprograms: !3, globals: !47, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 ()", isOptimized: true, emissionKind: 0, file: !59, enums: !1, retainedTypes: !1, subprograms: !3, globals: !47, imports: !1) !1 = !{} !3 = !{!5, !23, !27, !31} -!5 = !DISubprogram(name: "Release", linkageName: "_ZN17nsAutoRefCnt7ReleaseEv", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 14, file: !6, scope: null, type: !7, function: i32 ()* @_ZN17nsAutoRefCnt7ReleaseEv , declaration: !12, variables: !20) +!5 = distinct !DISubprogram(name: "Release", linkageName: "_ZN17nsAutoRefCnt7ReleaseEv", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 14, file: !6, scope: null, type: !7 , declaration: !12, variables: !20) !6 = !DIFile(filename: "nsAutoRefCnt.ii", directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/netwerk/base/src") !7 = !DISubroutineType(types: !8) !8 = !{!9, !10} @@ -94,14 +96,14 @@ declare void @_Z8moz_freePv(i8*) !17 = !{null, !10} !18 = !{} !20 = !{!22} -!22 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 14, arg: 1, flags: DIFlagArtificial, scope: !5, file: !6, type: !10) -!23 = !DISubprogram(name: "~nsAutoRefCnt", linkageName: "_ZN17nsAutoRefCntD1Ev", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !6, scope: null, type: !16, function: void ()* @_ZN17nsAutoRefCntD1Ev, declaration: !15, variables: !24) +!22 = !DILocalVariable(name: "this", line: 14, arg: 1, flags: DIFlagArtificial, scope: !5, file: !6, type: !10) +!23 = distinct !DISubprogram(name: "~nsAutoRefCnt", linkageName: "_ZN17nsAutoRefCntD1Ev", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !6, scope: null, type: !16, declaration: !15, variables: !24) !24 = !{!26} -!26 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 18, arg: 1, flags: DIFlagArtificial, scope: !23, file: !6, type: !10) -!27 = !DISubprogram(name: "~nsAutoRefCnt", linkageName: "_ZN17nsAutoRefCntD2Ev", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !6, scope: null, type: !16, function: i32 ()* null, declaration: !15, variables: !28) +!26 = !DILocalVariable(name: "this", line: 18, arg: 1, flags: DIFlagArtificial, scope: !23, file: !6, type: !10) +!27 = distinct !DISubprogram(name: "~nsAutoRefCnt", linkageName: "_ZN17nsAutoRefCntD2Ev", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !6, scope: null, type: !16, declaration: !15, variables: !28) !28 = !{!30} -!30 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 18, arg: 1, flags: DIFlagArtificial, scope: !27, file: !6, type: !10) -!31 = !DISubprogram(name: "operator=", linkageName: "_ZN12nsAutoRefCntaSEi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !6, scope: null, type: !32, declaration: !36, variables: !43) +!30 = !DILocalVariable(name: "this", line: 18, arg: 1, flags: DIFlagArtificial, scope: !27, file: !6, type: !10) +!31 = distinct !DISubprogram(name: "operator=", linkageName: "_ZN12nsAutoRefCntaSEi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !6, scope: null, type: !32, declaration: !36, variables: !43) !32 = !DISubroutineType(types: !33) !33 = !{!9, !34, !9} !34 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !35) @@ -114,8 +116,8 @@ declare void @_Z8moz_freePv(i8*) !41 = !DISubroutineType(types: !42) !42 = !{null, !34} !43 = !{!45, !46} -!45 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 4, arg: 1, flags: DIFlagArtificial, scope: !31, file: !6, type: !34) -!46 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "aValue", line: 4, arg: 2, scope: !31, file: !6, type: !9) +!45 = !DILocalVariable(name: "this", line: 4, arg: 1, flags: DIFlagArtificial, scope: !31, file: !6, type: !34) +!46 = !DILocalVariable(name: "aValue", line: 4, arg: 2, scope: !31, file: !6, type: !9) !47 = !{!49} !49 = !DIGlobalVariable(name: "mRefCnt", line: 9, isLocal: false, isDefinition: true, scope: null, file: !6, type: !37, variable: i32* null) !50 = !DILocation(line: 5, column: 5, scope: !51, inlinedAt: !52) diff --git a/test/DebugInfo/X86/constant-aggregate.ll b/test/DebugInfo/X86/constant-aggregate.ll index daec3b4e7d66..35bf9a516807 100644 --- a/test/DebugInfo/X86/constant-aggregate.ll +++ b/test/DebugInfo/X86/constant-aggregate.ll @@ -40,7 +40,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.10.0" ; Function Attrs: nounwind readnone ssp uwtable -define i32 @_Z3foo1S(i32 %s.coerce) #0 { +define i32 @_Z3foo1S(i32 %s.coerce) #0 !dbg !12 { entry: tail call void @llvm.dbg.value(metadata i32 %s.coerce, i64 0, metadata !18, metadata !37), !dbg !38 tail call void @llvm.dbg.value(metadata i32 1, i64 0, metadata !18, metadata !37), !dbg !38 @@ -48,7 +48,7 @@ entry: } ; Function Attrs: nounwind readnone ssp uwtable -define i32 @_Z3foo1C(i32 %c.coerce) #0 { +define i32 @_Z3foo1C(i32 %c.coerce) #0 !dbg !19 { entry: tail call void @llvm.dbg.value(metadata i32 %c.coerce, i64 0, metadata !23, metadata !37), !dbg !40 tail call void @llvm.dbg.value(metadata i32 2, i64 0, metadata !23, metadata !37), !dbg !40 @@ -56,7 +56,7 @@ entry: } ; Function Attrs: nounwind readnone ssp uwtable -define i32 @_Z3barv() #0 { +define i32 @_Z3barv() #0 !dbg !24 { entry: tail call void @llvm.dbg.value(metadata i32 3, i64 0, metadata !28, metadata !37), !dbg !42 ret i32 3, !dbg !43 @@ -72,7 +72,7 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!33, !34, !35} !llvm.ident = !{!36} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 225364) (llvm/trunk 225366)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !11, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 225364) (llvm/trunk 225366)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !11, globals: !2, imports: !2) !1 = !DIFile(filename: "sroasplit-4.cpp", directory: "") !2 = !{} !3 = !{!4, !8} @@ -84,23 +84,23 @@ attributes #1 = { nounwind readnone } !9 = !{!10} !10 = !DIDerivedType(tag: DW_TAG_member, name: "i", line: 8, size: 32, align: 32, flags: DIFlagPublic, file: !1, scope: !"_ZTS1C", baseType: !7) !11 = !{!12, !19, !24} -!12 = !DISubprogram(name: "foo", linkageName: "_Z3foo1S", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !13, type: !14, function: i32 (i32)* @_Z3foo1S, variables: !17) +!12 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foo1S", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !13, type: !14, variables: !17) !13 = !DIFile(filename: "sroasplit-4.cpp", directory: "") !14 = !DISubroutineType(types: !15) !15 = !{!7, !16} !16 = !DIDerivedType(tag: DW_TAG_typedef, name: "S", line: 1, file: !1, baseType: !"_ZTS1S") !17 = !{!18} -!18 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "s", line: 3, arg: 1, scope: !12, file: !13, type: !16) -!19 = !DISubprogram(name: "foo", linkageName: "_Z3foo1C", line: 10, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 10, file: !1, scope: !13, type: !20, function: i32 (i32)* @_Z3foo1C, variables: !22) +!18 = !DILocalVariable(name: "s", line: 3, arg: 1, scope: !12, file: !13, type: !16) +!19 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foo1C", line: 10, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 10, file: !1, scope: !13, type: !20, variables: !22) !20 = !DISubroutineType(types: !21) !21 = !{!7, !"_ZTS1C"} !22 = !{!23} -!23 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "c", line: 10, arg: 1, scope: !19, file: !13, type: !"_ZTS1C") -!24 = !DISubprogram(name: "bar", linkageName: "_Z3barv", line: 15, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 15, file: !1, scope: !13, type: !25, function: i32 ()* @_Z3barv, variables: !27) +!23 = !DILocalVariable(name: "c", line: 10, arg: 1, scope: !19, file: !13, type: !"_ZTS1C") +!24 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", line: 15, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 15, file: !1, scope: !13, type: !25, variables: !27) !25 = !DISubroutineType(types: !26) !26 = !{!7} !27 = !{!28} -!28 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 16, scope: !24, file: !13, type: !29) +!28 = !DILocalVariable(name: "a", line: 16, scope: !24, file: !13, type: !29) !29 = !DICompositeType(tag: DW_TAG_array_type, size: 32, align: 32, baseType: !30, elements: !31) !30 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !31 = !{!32} diff --git a/test/DebugInfo/X86/cu-ranges-odr.ll b/test/DebugInfo/X86/cu-ranges-odr.ll index 623e2fdd47a5..67da59a0e4bb 100644 --- a/test/DebugInfo/X86/cu-ranges-odr.ll +++ b/test/DebugInfo/X86/cu-ranges-odr.ll @@ -23,14 +23,14 @@ @a = global %class.A zeroinitializer, align 4 @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] -define internal void @__cxx_global_var_init() section ".text.startup" { +define internal void @__cxx_global_var_init() section ".text.startup" !dbg !14 { entry: call void @_ZN1AC2Ei(%class.A* @a, i32 0), !dbg !26 ret void, !dbg !26 } ; Function Attrs: nounwind uwtable -define linkonce_odr void @_ZN1AC2Ei(%class.A* %this, i32 %i) unnamed_addr #0 align 2 { +define linkonce_odr void @_ZN1AC2Ei(%class.A* %this, i32 %i) unnamed_addr #0 align 2 !dbg !18 { entry: %this.addr = alloca %class.A*, align 8 %i.addr = alloca i32, align 4 @@ -48,7 +48,7 @@ entry: ; Function Attrs: nounwind readnone declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 -define internal void @_GLOBAL__I_a() section ".text.startup" { +define internal void @_GLOBAL__I_a() section ".text.startup" !dbg !19 { entry: call void @__cxx_global_var_init(), !dbg !32 ret void, !dbg !32 @@ -61,7 +61,7 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!23, !24} !llvm.ident = !{!25} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 (trunk 199923) (llvm/trunk 199940)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !13, globals: !21, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 (trunk 199923) (llvm/trunk 199940)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !13, globals: !21, imports: !2) !1 = !DIFile(filename: "baz.cpp", directory: "/usr/local/google/home/echristo/tmp") !2 = !{} !3 = !{!4} @@ -74,12 +74,12 @@ attributes #1 = { nounwind readnone } !10 = !{null, !11, !7} !11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A") !13 = !{!14, !18, !19} -!14 = !DISubprogram(name: "__cxx_global_var_init", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !15, type: !16, function: void ()* @__cxx_global_var_init, variables: !2) +!14 = distinct !DISubprogram(name: "__cxx_global_var_init", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !15, type: !16, variables: !2) !15 = !DIFile(filename: "baz.cpp", directory: "/usr/local/google/home/echristo/tmp") !16 = !DISubroutineType(types: !17) !17 = !{null} -!18 = !DISubprogram(name: "A", linkageName: "_ZN1AC2Ei", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !"_ZTS1A", type: !9, function: void (%class.A*, i32)* @_ZN1AC2Ei, declaration: !8, variables: !2) -!19 = !DISubprogram(name: "", linkageName: "_GLOBAL__I_a", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagArtificial, isOptimized: false, scopeLine: 3, file: !1, scope: !15, type: !20, function: void ()* @_GLOBAL__I_a, variables: !2) +!18 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2Ei", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !"_ZTS1A", type: !9, declaration: !8, variables: !2) +!19 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__I_a", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagArtificial, isOptimized: false, scopeLine: 3, file: !1, scope: !15, type: !20, variables: !2) !20 = !DISubroutineType(types: !2) !21 = !{!22} !22 = !DIGlobalVariable(name: "a", line: 8, isLocal: false, isDefinition: true, scope: null, file: !15, type: !4, variable: %class.A* @a) @@ -87,9 +87,9 @@ attributes #1 = { nounwind readnone } !24 = !{i32 1, !"Debug Info Version", i32 3} !25 = !{!"clang version 3.5 (trunk 199923) (llvm/trunk 199940)"} !26 = !DILocation(line: 8, scope: !14) -!27 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !18, type: !28) +!27 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !18, type: !28) !28 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A") !29 = !DILocation(line: 0, scope: !18) -!30 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 3, arg: 2, scope: !18, file: !15, type: !7) +!30 = !DILocalVariable(name: "i", line: 3, arg: 2, scope: !18, file: !15, type: !7) !31 = !DILocation(line: 3, scope: !18) !32 = !DILocation(line: 3, scope: !19) diff --git a/test/DebugInfo/X86/cu-ranges.ll b/test/DebugInfo/X86/cu-ranges.ll index 5611a31cd5fb..543684596d9e 100644 --- a/test/DebugInfo/X86/cu-ranges.ll +++ b/test/DebugInfo/X86/cu-ranges.ll @@ -25,7 +25,7 @@ ; NO-FUNCTION-SECTIONS-NOT: DW_AT_ranges ; Function Attrs: nounwind uwtable -define i32 @foo(i32 %a) #0 { +define i32 @foo(i32 %a) #0 !dbg !4 { entry: %a.addr = alloca i32, align 4 store i32 %a, i32* %a.addr, align 4 @@ -39,7 +39,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 ; Function Attrs: nounwind uwtable -define i32 @bar(i32 %b) #0 { +define i32 @bar(i32 %b) #0 !dbg !9 { entry: %b.addr = alloca i32, align 4 store i32 %b, i32* %b.addr, align 4 @@ -56,20 +56,20 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!10, !11} !llvm.ident = !{!12} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "z.c", directory: "/usr/local/google/home/echristo") !2 = !{} !3 = !{!4, !9} -!4 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i32)* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "z.c", directory: "/usr/local/google/home/echristo") !6 = !DISubroutineType(types: !7) !7 = !{!8, !8} !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = !DISubprogram(name: "bar", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: i32 (i32)* @bar, variables: !2) +!9 = distinct !DISubprogram(name: "bar", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) !10 = !{i32 2, !"Dwarf Version", i32 4} !11 = !{i32 1, !"Debug Info Version", i32 3} !12 = !{!"clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)"} -!13 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 1, arg: 1, scope: !4, file: !5, type: !8) +!13 = !DILocalVariable(name: "a", line: 1, arg: 1, scope: !4, file: !5, type: !8) !14 = !DILocation(line: 1, scope: !4) -!15 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 2, arg: 1, scope: !9, file: !5, type: !8) +!15 = !DILocalVariable(name: "b", line: 2, arg: 1, scope: !9, file: !5, type: !8) !16 = !DILocation(line: 2, scope: !9) diff --git a/test/DebugInfo/X86/data_member_location.ll b/test/DebugInfo/X86/data_member_location.ll index c17c45bcc696..5b33096864bb 100644 --- a/test/DebugInfo/X86/data_member_location.ll +++ b/test/DebugInfo/X86/data_member_location.ll @@ -34,7 +34,7 @@ !llvm.module.flags = !{!13, !15} !llvm.ident = !{!14} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !10, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !10, imports: !2) !1 = !DIFile(filename: "data_member_location.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/X86/dbg-byval-parameter.ll b/test/DebugInfo/X86/dbg-byval-parameter.ll index e07109e08f93..c80f8d90ca89 100644 --- a/test/DebugInfo/X86/dbg-byval-parameter.ll +++ b/test/DebugInfo/X86/dbg-byval-parameter.ll @@ -4,7 +4,7 @@ %struct.Pt = type { double, double } %struct.Rect = type { %struct.Pt, %struct.Pt } -define double @foo(%struct.Rect* byval %my_r0) nounwind ssp { +define double @foo(%struct.Rect* byval %my_r0) nounwind ssp !dbg !1 { entry: %retval = alloca double ; <double*> [#uses=2] %0 = alloca double ; <double*> [#uses=2] @@ -28,10 +28,10 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!3} !llvm.module.flags = !{!21} -!0 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "my_r0", line: 11, arg: 0, scope: !1, file: !2, type: !7) -!1 = !DISubprogram(name: "foo", linkageName: "foo", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !19, scope: !2, type: !4, function: double (%struct.Rect*)* @foo) +!0 = !DILocalVariable(name: "my_r0", line: 11, arg: 1, scope: !1, file: !2, type: !7) +!1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !19, scope: !2, type: !4) !2 = !DIFile(filename: "b2.c", directory: "/tmp/") -!3 = !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !19, enums: !20, retainedTypes: !20, subprograms: !18, imports: null) +!3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !19, enums: !20, retainedTypes: !20, subprograms: !18, imports: null) !4 = !DISubroutineType(types: !5) !5 = !{!6, !7} !6 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float) diff --git a/test/DebugInfo/X86/dbg-const-int.ll b/test/DebugInfo/X86/dbg-const-int.ll index 8482abf373eb..7e90a14c21a2 100644 --- a/test/DebugInfo/X86/dbg-const-int.ll +++ b/test/DebugInfo/X86/dbg-const-int.ll @@ -10,7 +10,7 @@ target triple = "x86_64-apple-macosx10.6.7" ; CHECK-NOT: DW_TAG ; CHECK: DW_AT_name {{.*}} "i" -define i32 @foo() nounwind uwtable readnone optsize ssp { +define i32 @foo() nounwind uwtable readnone optsize ssp !dbg !1 { entry: tail call void @llvm.dbg.value(metadata i32 42, i64 0, metadata !6, metadata !DIExpression()), !dbg !9 ret i32 42, !dbg !10 @@ -21,13 +21,13 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!15} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 132191)", isOptimized: true, emissionKind: 0, file: !13, enums: !14, retainedTypes: !14, subprograms: !11, imports: null) -!1 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !13, scope: !2, type: !3, function: i32 ()* @foo, variables: !12) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 132191)", isOptimized: true, emissionKind: 0, file: !13, enums: !14, retainedTypes: !14, subprograms: !11, imports: null) +!1 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !13, scope: !2, type: !3, variables: !12) !2 = !DIFile(filename: "a.c", directory: "/private/tmp") !3 = !DISubroutineType(types: !4) !4 = !{!5} !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 2, scope: !7, file: !2, type: !5) +!6 = !DILocalVariable(name: "i", line: 2, scope: !7, file: !2, type: !5) !7 = distinct !DILexicalBlock(line: 1, column: 11, file: !13, scope: !1) !8 = !{i32 42} !9 = !DILocation(line: 2, column: 12, scope: !7) diff --git a/test/DebugInfo/X86/dbg-const.ll b/test/DebugInfo/X86/dbg-const.ll index 27a0eabfe493..6d710c512fd7 100644 --- a/test/DebugInfo/X86/dbg-const.ll +++ b/test/DebugInfo/X86/dbg-const.ll @@ -15,7 +15,7 @@ target triple = "x86_64-apple-darwin10.0.0" ;CHECK: ## DW_OP_consts ;CHECK-NEXT: .byte 42 -define i32 @foobar() nounwind readonly noinline ssp { +define i32 @foobar() nounwind readonly noinline ssp !dbg !0 { entry: tail call void @llvm.dbg.value(metadata i32 42, i64 0, metadata !6, metadata !DIExpression()), !dbg !9 %call = tail call i32 @bar(), !dbg !11 @@ -31,13 +31,13 @@ declare i32 @bar() nounwind readnone !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!17} -!0 = !DISubprogram(name: "foobar", linkageName: "foobar", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !15, scope: !1, type: !3, function: i32 ()* @foobar, variables: !14) +!0 = distinct !DISubprogram(name: "foobar", linkageName: "foobar", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !15, scope: !1, type: !3, variables: !14) !1 = !DIFile(filename: "mu.c", directory: "/private/tmp") -!2 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 114183)", isOptimized: true, emissionKind: 1, file: !15, enums: !16, retainedTypes: !16, subprograms: !13, imports: null) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 114183)", isOptimized: true, emissionKind: 1, file: !15, enums: !16, retainedTypes: !16, subprograms: !13, imports: null) !3 = !DISubroutineType(types: !4) !4 = !{!5} !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "j", line: 15, scope: !7, file: !1, type: !5) +!6 = !DILocalVariable(name: "j", line: 15, scope: !7, file: !1, type: !5) !7 = distinct !DILexicalBlock(line: 12, column: 52, file: !15, scope: !0) !8 = !{i32 42} !9 = !DILocation(line: 15, column: 12, scope: !7) diff --git a/test/DebugInfo/X86/dbg-declare-arg.ll b/test/DebugInfo/X86/dbg-declare-arg.ll index 85ff4b920ad1..c35bc8c5f629 100644 --- a/test/DebugInfo/X86/dbg-declare-arg.ll +++ b/test/DebugInfo/X86/dbg-declare-arg.ll @@ -7,7 +7,7 @@ target triple = "x86_64-apple-macosx10.6.7" %class.A = type { i32, i32, i32, i32 } -define void @_Z3fooi(%class.A* sret %agg.result, i32 %i) ssp { +define void @_Z3fooi(%class.A* sret %agg.result, i32 %i) ssp !dbg !19 { entry: %i.addr = alloca i32, align 4 %j = alloca i32, align 4 @@ -48,7 +48,7 @@ nrvo.skipdtor: ; preds = %nrvo.unused, %if.en declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone -define linkonce_odr void @_ZN1AD1Ev(%class.A* %this) unnamed_addr ssp align 2 { +define linkonce_odr void @_ZN1AD1Ev(%class.A* %this) unnamed_addr ssp align 2 !dbg !22 { entry: %this.addr = alloca %class.A*, align 8 store %class.A* %this, %class.A** %this.addr, align 8 @@ -58,7 +58,7 @@ entry: ret void, !dbg !45 } -define linkonce_odr void @_ZN1AD2Ev(%class.A* %this) unnamed_addr nounwind ssp align 2 { +define linkonce_odr void @_ZN1AD2Ev(%class.A* %this) unnamed_addr nounwind ssp align 2 !dbg !25 { entry: %this.addr = alloca %class.A*, align 8 store %class.A* %this, %class.A** %this.addr, align 8 @@ -74,7 +74,7 @@ entry: !0 = !DISubprogram(name: "~A", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !1, type: !11) !1 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 2, size: 128, align: 32, file: !51, scope: !2, elements: !4) -!2 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 (trunk 130127)", isOptimized: false, emissionKind: 1, file: !51, enums: !{}, retainedTypes: !{}, subprograms: !50) +!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 (trunk 130127)", isOptimized: false, emissionKind: 1, file: !51, enums: !{}, retainedTypes: !{}, subprograms: !50) !3 = !DIFile(filename: "a.cc", directory: "/private/tmp") !4 = !{!5, !7, !8, !9, !0, !10, !14} !5 = !DIDerivedType(tag: DW_TAG_member, name: "x", line: 2, size: 32, align: 32, file: !51, scope: !3, baseType: !6) @@ -91,16 +91,16 @@ entry: !16 = !{null, !13, !17} !17 = !DIDerivedType(tag: DW_TAG_reference_type, scope: !2, baseType: !18) !18 = !DIDerivedType(tag: DW_TAG_const_type, file: !3, baseType: !1) -!19 = !DISubprogram(name: "foo", linkageName: "_Z3fooi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !3, type: !20, function: void (%class.A*, i32)* @_Z3fooi) +!19 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !3, type: !20) !20 = !DISubroutineType(types: !21) !21 = !{!1} -!22 = !DISubprogram(name: "~A", linkageName: "_ZN1AD1Ev", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !3, type: !23, function: void (%class.A*)* @_ZN1AD1Ev) +!22 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD1Ev", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !3, type: !23) !23 = !DISubroutineType(types: !24) !24 = !{null} -!25 = !DISubprogram(name: "~A", linkageName: "_ZN1AD2Ev", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !3, type: !23, function: void (%class.A*)* @_ZN1AD2Ev) -!26 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 4, arg: 1, scope: !19, file: !3, type: !6) +!25 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD2Ev", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !3, type: !23) +!26 = !DILocalVariable(name: "i", line: 4, arg: 1, scope: !19, file: !3, type: !6) !27 = !DILocation(line: 4, column: 11, scope: !19) -!28 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "j", line: 5, scope: !29, file: !3, type: !6) +!28 = !DILocalVariable(name: "j", line: 5, scope: !29, file: !3, type: !6) !29 = distinct !DILexicalBlock(line: 4, column: 14, file: !51, scope: !19) !30 = !DILocation(line: 5, column: 7, scope: !29) !31 = !DILocation(line: 5, column: 12, scope: !29) @@ -109,16 +109,16 @@ entry: !34 = distinct !DILexicalBlock(line: 6, column: 16, file: !51, scope: !29) !35 = !DILocation(line: 8, column: 3, scope: !34) !36 = !DILocation(line: 9, column: 9, scope: !29) -!37 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "my_a", line: 9, scope: !29, file: !3, type: !38) +!37 = !DILocalVariable(name: "my_a", line: 9, scope: !29, file: !3, type: !38) !38 = !DIDerivedType(tag: DW_TAG_reference_type, file: !3, baseType: !1) !39 = !DILocation(line: 9, column: 5, scope: !29) !40 = !DILocation(line: 10, column: 3, scope: !29) !41 = !DILocation(line: 11, column: 3, scope: !29) !42 = !DILocation(line: 12, column: 1, scope: !29) -!43 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 2, arg: 1, flags: DIFlagArtificial, scope: !22, file: !3, type: !13) +!43 = !DILocalVariable(name: "this", line: 2, arg: 1, flags: DIFlagArtificial, scope: !22, file: !3, type: !13) !44 = !DILocation(line: 2, column: 47, scope: !22) !45 = !DILocation(line: 2, column: 61, scope: !22) -!46 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 2, arg: 1, flags: DIFlagArtificial, scope: !25, file: !3, type: !13) +!46 = !DILocalVariable(name: "this", line: 2, arg: 1, flags: DIFlagArtificial, scope: !25, file: !3, type: !13) !47 = !DILocation(line: 2, column: 47, scope: !25) !48 = !DILocation(line: 2, column: 54, scope: !49) !49 = distinct !DILexicalBlock(line: 2, column: 52, file: !51, scope: !25) diff --git a/test/DebugInfo/X86/dbg-declare.ll b/test/DebugInfo/X86/dbg-declare.ll index a1420a0ba2ef..1d6cfe859596 100644 --- a/test/DebugInfo/X86/dbg-declare.ll +++ b/test/DebugInfo/X86/dbg-declare.ll @@ -1,7 +1,7 @@ ; RUN: llc < %s -O0 -mtriple x86_64-apple-darwin ; <rdar://problem/11134152> -define i32 @foo(i32* %x) nounwind uwtable ssp { +define i32 @foo(i32* %x) nounwind uwtable ssp !dbg !5 { entry: %x.addr = alloca i32*, align 8 %saved_stack = alloca i8* @@ -30,21 +30,21 @@ declare void @llvm.stackrestore(i8*) nounwind !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!27} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 153698)", isOptimized: false, emissionKind: 0, file: !26, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 153698)", isOptimized: false, emissionKind: 0, file: !26, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "foo", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !26, scope: !0, type: !7, function: i32 (i32*)* @foo) +!5 = distinct !DISubprogram(name: "foo", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !26, scope: !0, type: !7) !6 = !DIFile(filename: "20020104-2.c", directory: "/Volumes/Sandbox/llvm") !7 = !DISubroutineType(types: !8) !8 = !{!9, !10} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11) !11 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9) -!14 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 5, arg: 1, scope: !5, file: !6, type: !10) +!14 = !DILocalVariable(name: "x", line: 5, arg: 1, scope: !5, file: !6, type: !10) !15 = !DILocation(line: 5, column: 21, scope: !5) !16 = !DILocation(line: 7, column: 13, scope: !17) !17 = distinct !DILexicalBlock(line: 6, column: 1, file: !26, scope: !5) -!18 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 7, scope: !17, file: !6, type: !19) +!18 = !DILocalVariable(name: "a", line: 7, scope: !17, file: !6, type: !19) !19 = !DICompositeType(tag: DW_TAG_array_type, align: 8, baseType: !20, elements: !21) !20 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) !21 = !{!22} diff --git a/test/DebugInfo/X86/dbg-file-name.ll b/test/DebugInfo/X86/dbg-file-name.ll index cc18c0804db4..60954b9746ba 100644 --- a/test/DebugInfo/X86/dbg-file-name.ll +++ b/test/DebugInfo/X86/dbg-file-name.ll @@ -5,7 +5,7 @@ declare i32 @printf(i8*, ...) nounwind -define i32 @main() nounwind { +define i32 @main() nounwind !dbg !6 { ret i32 0 } @@ -13,9 +13,9 @@ define i32 @main() nounwind { !llvm.module.flags = !{!12} !1 = !DIFile(filename: "simple.c", directory: "/Users/manav/one/two") -!2 = !DICompileUnit(language: DW_LANG_C89, producer: "LLVM build 00", isOptimized: true, emissionKind: 0, file: !10, enums: !11, retainedTypes: !11, subprograms: !9) +!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "LLVM build 00", isOptimized: true, emissionKind: 0, file: !10, enums: !11, retainedTypes: !11, subprograms: !9) !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = !DISubprogram(name: "main", linkageName: "main", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !10, scope: !1, type: !7, function: i32 ()* @main) +!6 = distinct !DISubprogram(name: "main", linkageName: "main", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !10, scope: !1, type: !7) !7 = !DISubroutineType(types: !8) !8 = !{!5} !9 = !{!6} diff --git a/test/DebugInfo/X86/dbg-i128-const.ll b/test/DebugInfo/X86/dbg-i128-const.ll index de804faabf4a..80ea1769b60e 100644 --- a/test/DebugInfo/X86/dbg-i128-const.ll +++ b/test/DebugInfo/X86/dbg-i128-const.ll @@ -4,7 +4,7 @@ ; CHECK: DW_AT_const_value ; CHECK-NEXT: 42 -define i128 @__foo(i128 %a, i128 %b) nounwind { +define i128 @__foo(i128 %a, i128 %b) nounwind !dbg !3 { entry: tail call void @llvm.dbg.value(metadata i128 42 , i64 0, metadata !1, metadata !DIExpression()), !dbg !11 %add = add i128 %a, %b, !dbg !11 @@ -17,11 +17,11 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.module.flags = !{!16} !0 = !{i128 42 } -!1 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "MAX", line: 29, scope: !2, file: !4, type: !8) +!1 = !DILocalVariable(name: "MAX", line: 29, scope: !2, file: !4, type: !8) !2 = distinct !DILexicalBlock(line: 26, column: 0, file: !13, scope: !3) -!3 = !DISubprogram(name: "__foo", linkageName: "__foo", line: 26, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 26, file: !13, scope: !4, type: !6, function: i128 (i128, i128)* @__foo) +!3 = distinct !DISubprogram(name: "__foo", linkageName: "__foo", line: 26, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 26, file: !13, scope: !4, type: !6) !4 = !DIFile(filename: "foo.c", directory: "/tmp") -!5 = !DICompileUnit(language: DW_LANG_C89, producer: "clang", isOptimized: true, emissionKind: 0, file: !13, enums: !15, retainedTypes: !15, subprograms: !12, imports: null) +!5 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "clang", isOptimized: true, emissionKind: 0, file: !13, enums: !15, retainedTypes: !15, subprograms: !12, imports: null) !6 = !DISubroutineType(types: !7) !7 = !{!8, !8, !8} !8 = !DIDerivedType(tag: DW_TAG_typedef, name: "ti_int", line: 78, file: !14, scope: !4, baseType: !10) diff --git a/test/DebugInfo/X86/dbg-merge-loc-entry.ll b/test/DebugInfo/X86/dbg-merge-loc-entry.ll index 14265139b0fd..fc5c1bbd529d 100644 --- a/test/DebugInfo/X86/dbg-merge-loc-entry.ll +++ b/test/DebugInfo/X86/dbg-merge-loc-entry.ll @@ -12,7 +12,7 @@ target triple = "x86_64-apple-darwin8" @__clz_tab = external constant [256 x i8] -define hidden i128 @__divti3(i128 %u, i128 %v) nounwind readnone { +define hidden i128 @__divti3(i128 %u, i128 %v) nounwind readnone !dbg !9 { entry: tail call void @llvm.dbg.value(metadata i128 %u, i64 0, metadata !14, metadata !DIExpression()), !dbg !15 tail call void @llvm.dbg.value(metadata i64 0, i64 0, metadata !17, metadata !DIExpression()), !dbg !21 @@ -40,24 +40,24 @@ declare %0 @llvm.uadd.with.overflow.i64(i64, i64) nounwind readnone !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!32} -!0 = !DISubprogram(name: "__udivmodti4", line: 879, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 879, file: !29, scope: !1, type: !3) +!0 = distinct !DISubprogram(name: "__udivmodti4", line: 879, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 879, file: !29, scope: !1, type: !3) !1 = !DIFile(filename: "foobar.c", directory: "/tmp") -!2 = !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !29, enums: !31, retainedTypes: !31, subprograms: !28, imports: null) +!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !29, enums: !31, retainedTypes: !31, subprograms: !28, imports: null) !3 = !DISubroutineType(types: !4) !4 = !{!5, !5, !5, !8} !5 = !DIDerivedType(tag: DW_TAG_typedef, name: "UTItype", line: 166, file: !30, scope: !6, baseType: !7) !6 = !DIFile(filename: "foobar.h", directory: "/tmp") !7 = !DIBasicType(tag: DW_TAG_base_type, size: 128, align: 128, encoding: DW_ATE_unsigned) !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !29, scope: !1, baseType: !5) -!9 = !DISubprogram(name: "__divti3", linkageName: "__divti3", line: 1094, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1094, file: !29, scope: !1, type: !10, function: i128 (i128, i128)* @__divti3) +!9 = distinct !DISubprogram(name: "__divti3", linkageName: "__divti3", line: 1094, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1094, file: !29, scope: !1, type: !10) !10 = !DISubroutineType(types: !11) !11 = !{!12, !12, !12} !12 = !DIDerivedType(tag: DW_TAG_typedef, name: "TItype", line: 160, file: !30, scope: !6, baseType: !13) !13 = !DIBasicType(tag: DW_TAG_base_type, size: 128, align: 128, encoding: DW_ATE_signed) -!14 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "u", line: 1093, arg: 0, scope: !9, file: !1, type: !12) +!14 = !DILocalVariable(name: "u", line: 1093, arg: 1, scope: !9, file: !1, type: !12) !15 = !DILocation(line: 1093, scope: !9) !16 = !{i64 0} -!17 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "c", line: 1095, scope: !18, file: !1, type: !19) +!17 = !DILocalVariable(name: "c", line: 1095, scope: !18, file: !1, type: !19) !18 = distinct !DILexicalBlock(line: 1094, column: 0, file: !29, scope: !9) !19 = !DIDerivedType(tag: DW_TAG_typedef, name: "word_type", line: 424, file: !30, scope: !6, baseType: !20) !20 = !DIBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/X86/dbg-prolog-end.ll b/test/DebugInfo/X86/dbg-prolog-end.ll index 870b09120bcf..c3802b9bfa5a 100644 --- a/test/DebugInfo/X86/dbg-prolog-end.ll +++ b/test/DebugInfo/X86/dbg-prolog-end.ll @@ -3,7 +3,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 target triple = "x86_64-apple-macosx10.6.7" ;CHECK: .loc 1 2 11 prologue_end -define i32 @foo(i32 %i) nounwind ssp { +define i32 @foo(i32 %i) nounwind ssp !dbg !1 { entry: %i.addr = alloca i32, align 4 %j = alloca i32, align 4 @@ -24,7 +24,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone -define i32 @main() nounwind ssp { +define i32 @main() nounwind ssp !dbg !6 { entry: %retval = alloca i32, align 4 store i32 0, i32* %retval @@ -36,16 +36,16 @@ entry: !llvm.module.flags = !{!21} !18 = !{!1, !6} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 131100)", isOptimized: false, emissionKind: 0, file: !19, enums: !20, retainedTypes: !20, subprograms: !18, imports: null) -!1 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !19, scope: !2, type: !3, function: i32 (i32)* @foo) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 131100)", isOptimized: false, emissionKind: 0, file: !19, enums: !20, retainedTypes: !20, subprograms: !18, imports: null) +!1 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !19, scope: !2, type: !3) !2 = !DIFile(filename: "/tmp/a.c", directory: "/private/tmp") !3 = !DISubroutineType(types: !4) !4 = !{!5} !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = !DISubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !19, scope: !2, type: !3, function: i32 ()* @main) -!7 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 1, arg: 1, scope: !1, file: !2, type: !5) +!6 = distinct !DISubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !19, scope: !2, type: !3) +!7 = !DILocalVariable(name: "i", line: 1, arg: 1, scope: !1, file: !2, type: !5) !8 = !DILocation(line: 1, column: 13, scope: !1) -!9 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "j", line: 2, scope: !10, file: !2, type: !5) +!9 = !DILocalVariable(name: "j", line: 2, scope: !10, file: !2, type: !5) !10 = distinct !DILexicalBlock(line: 1, column: 16, file: !19, scope: !1) !11 = !DILocation(line: 2, column: 6, scope: !10) !12 = !DILocation(line: 2, column: 11, scope: !10) diff --git a/test/DebugInfo/X86/dbg-subrange.ll b/test/DebugInfo/X86/dbg-subrange.ll index e3bd07355cc3..5239daea800b 100644 --- a/test/DebugInfo/X86/dbg-subrange.ll +++ b/test/DebugInfo/X86/dbg-subrange.ll @@ -6,7 +6,7 @@ target triple = "x86_64-apple-macosx10.7.2" @s = common global [4294967296 x i8] zeroinitializer, align 16 ; CHECK: .quad 4294967296 ## DW_AT_count -define void @bar() nounwind uwtable ssp { +define void @bar() nounwind uwtable ssp !dbg !5 { entry: store i8 97, i8* getelementptr inbounds ([4294967296 x i8], [4294967296 x i8]* @s, i32 0, i64 0), align 1, !dbg !18 ret void, !dbg !20 @@ -15,10 +15,10 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!22} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 144833)", isOptimized: false, emissionKind: 0, file: !21, enums: !1, retainedTypes: !1, subprograms: !3, globals: !11, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 144833)", isOptimized: false, emissionKind: 0, file: !21, enums: !1, retainedTypes: !1, subprograms: !3, globals: !11, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "bar", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !21, scope: !6, type: !7, function: void ()* @bar) +!5 = distinct !DISubprogram(name: "bar", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !21, scope: !6, type: !7) !6 = !DIFile(filename: "small.c", directory: "/private/tmp") !7 = !DISubroutineType(types: !8) !8 = !{null} diff --git a/test/DebugInfo/X86/dbg-value-const-byref.ll b/test/DebugInfo/X86/dbg-value-const-byref.ll index a54ef0590e41..2b4c1dc1a937 100644 --- a/test/DebugInfo/X86/dbg-value-const-byref.ll +++ b/test/DebugInfo/X86/dbg-value-const-byref.ll @@ -47,7 +47,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.9.0" ; Function Attrs: nounwind ssp uwtable -define i32 @foo() #0 { +define i32 @foo() #0 !dbg !4 { entry: %i = alloca i32, align 4 call void @llvm.dbg.value(metadata i32 3, i64 0, metadata !10, metadata !DIExpression()), !dbg !15 @@ -56,7 +56,7 @@ entry: %call1 = call i32 (...) @f1() #3, !dbg !19 call void @llvm.dbg.value(metadata i32 %call1, i64 0, metadata !10, metadata !DIExpression()), !dbg !19 store i32 %call1, i32* %i, align 4, !dbg !19, !tbaa !20 - call void @llvm.dbg.value(metadata i32* %i, i64 0, metadata !10, metadata !DIExpression()), !dbg !24 + call void @llvm.dbg.value(metadata i32* %i, i64 0, metadata !10, metadata !DIExpression(DW_OP_deref)), !dbg !24 call void @f2(i32* %i) #3, !dbg !24 ret i32 0, !dbg !25 } @@ -78,17 +78,17 @@ attributes #3 = { nounwind } !llvm.module.flags = !{!11, !12} !llvm.ident = !{!13} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "dbg-value-const-byref.c", directory: "") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !6, function: i32 ()* @foo, variables: !9) +!4 = distinct !DISubprogram(name: "foo", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !6, variables: !9) !5 = !DIFile(filename: "dbg-value-const-byref.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{!8} !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !9 = !{!10} -!10 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 6, scope: !4, file: !5, type: !8) +!10 = !DILocalVariable(name: "i", line: 6, scope: !4, file: !5, type: !8) !11 = !{i32 2, !"Dwarf Version", i32 2} !12 = !{i32 1, !"Debug Info Version", i32 3} !13 = !{!"clang version 3.5.0 "} diff --git a/test/DebugInfo/X86/dbg-value-dag-combine.ll b/test/DebugInfo/X86/dbg-value-dag-combine.ll index 4331c6591369..6243be8aa4a6 100644 --- a/test/DebugInfo/X86/dbg-value-dag-combine.ll +++ b/test/DebugInfo/X86/dbg-value-dag-combine.ll @@ -6,7 +6,7 @@ target triple = "x86_64-apple-darwin10.0.0" declare <4 x i32> @__amdil_get_global_id_int() declare void @llvm.dbg.value(metadata, i64, metadata, metadata) -define void @__OpenCL_test_kernel(i32 addrspace(1)* %ip) nounwind { +define void @__OpenCL_test_kernel(i32 addrspace(1)* %ip) nounwind !dbg !0 { entry: call void @llvm.dbg.value(metadata i32 addrspace(1)* %ip, i64 0, metadata !7, metadata !DIExpression()), !dbg !8 %0 = call <4 x i32> @__amdil_get_global_id_int() nounwind @@ -15,7 +15,7 @@ entry: call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !13, metadata !DIExpression()), !dbg !14 %tmp2 = load i32, i32 addrspace(1)* %ip, align 4, !dbg !15 %tmp3 = add i32 0, %tmp2, !dbg !15 -; CHECK: ##DEBUG_VALUE: idx <- E{{..$}} +; CHECK: ##DEBUG_VALUE: idx <- %E{{..$}} call void @llvm.dbg.value(metadata i32 %tmp3, i64 0, metadata !13, metadata !DIExpression()), !dbg !15 %arrayidx = getelementptr i32, i32 addrspace(1)* %ip, i32 %1, !dbg !16 store i32 %tmp3, i32 addrspace(1)* %arrayidx, align 4, !dbg !16 @@ -24,20 +24,20 @@ entry: !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!20} -!0 = !DISubprogram(name: "__OpenCL_test_kernel", linkageName: "__OpenCL_test_kernel", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !19, scope: !1, type: !3, function: void (i32 addrspace(1)*)* @__OpenCL_test_kernel) +!0 = distinct !DISubprogram(name: "__OpenCL_test_kernel", linkageName: "__OpenCL_test_kernel", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !19, scope: !1, type: !3) !1 = !DIFile(filename: "OCL6368.tmp.cl", directory: "E:CUsersCmvillmow.AMDCAppDataCLocalCTemp") -!2 = !DICompileUnit(language: DW_LANG_C89, producer: "clc", isOptimized: false, emissionKind: 1, file: !19, enums: !12, retainedTypes: !12, subprograms: !18, imports: null) +!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "clc", isOptimized: false, emissionKind: 1, file: !19, enums: !12, retainedTypes: !12, subprograms: !18, imports: null) !3 = !DISubroutineType(types: !4) !4 = !{null, !5} !5 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, scope: !2, baseType: !6) !6 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) -!7 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "ip", line: 1, arg: 0, scope: !0, file: !1, type: !5) +!7 = !DILocalVariable(name: "ip", line: 1, arg: 1, scope: !0, file: !1, type: !5) !8 = !DILocation(line: 1, column: 42, scope: !0) -!9 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "gid", line: 3, scope: !10, file: !1, type: !6) +!9 = !DILocalVariable(name: "gid", line: 3, scope: !10, file: !1, type: !6) !10 = distinct !DILexicalBlock(line: 2, column: 1, file: !19, scope: !0) !11 = !DILocation(line: 3, column: 41, scope: !10) !12 = !{} -!13 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "idx", line: 4, scope: !10, file: !1, type: !6) +!13 = !DILocalVariable(name: "idx", line: 4, scope: !10, file: !1, type: !6) !14 = !DILocation(line: 4, column: 20, scope: !10) !15 = !DILocation(line: 5, column: 15, scope: !10) !16 = !DILocation(line: 6, column: 18, scope: !10) diff --git a/test/DebugInfo/X86/dbg-value-inlined-parameter.ll b/test/DebugInfo/X86/dbg-value-inlined-parameter.ll index 3fa5cc5a98ab..7ec21f8cf7cb 100644 --- a/test/DebugInfo/X86/dbg-value-inlined-parameter.ll +++ b/test/DebugInfo/X86/dbg-value-inlined-parameter.ll @@ -43,7 +43,7 @@ @p = common global %struct.S1 zeroinitializer, align 8 -define i32 @foo(%struct.S1* nocapture %sp, i32 %nums) nounwind optsize ssp { +define i32 @foo(%struct.S1* nocapture %sp, i32 %nums) nounwind optsize ssp !dbg !0 { entry: tail call void @llvm.dbg.value(metadata %struct.S1* %sp, i64 0, metadata !9, metadata !DIExpression()), !dbg !20 tail call void @llvm.dbg.value(metadata i32 %nums, i64 0, metadata !18, metadata !DIExpression()), !dbg !21 @@ -59,7 +59,7 @@ entry: declare float* @bar(i32) optsize -define void @foobar() nounwind optsize ssp { +define void @foobar() nounwind optsize ssp !dbg !6 { entry: tail call void @llvm.dbg.value(metadata %struct.S1* @p, i64 0, metadata !9, metadata !DIExpression()) nounwind, !dbg !31 tail call void @llvm.dbg.value(metadata i32 1, i64 0, metadata !18, metadata !DIExpression()) nounwind, !dbg !35 @@ -74,16 +74,16 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!43} -!0 = !DISubprogram(name: "foo", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 8, file: !1, scope: !1, type: !3, function: i32 (%struct.S1*, i32)* @foo, variables: !41) +!0 = distinct !DISubprogram(name: "foo", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 8, file: !1, scope: !1, type: !3, variables: !41) !1 = !DIFile(filename: "nm2.c", directory: "/private/tmp") -!2 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 125693)", isOptimized: true, emissionKind: 1, file: !42, enums: !{}, retainedTypes: !{}, subprograms: !39, globals: !40, imports: !44) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 125693)", isOptimized: true, emissionKind: 1, file: !42, enums: !{}, retainedTypes: !{}, subprograms: !39, globals: !40, imports: !44) !3 = !DISubroutineType(types: !4) !4 = !{!5} !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = !DISubprogram(name: "foobar", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !1, scope: !1, type: !7, function: void ()* @foobar) +!6 = distinct !DISubprogram(name: "foobar", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !1, scope: !1, type: !7) !7 = !DISubroutineType(types: !8) !8 = !{null} -!9 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "sp", line: 7, arg: 1, scope: !0, file: !1, type: !10) +!9 = !DILocalVariable(name: "sp", line: 7, arg: 1, scope: !0, file: !1, type: !10) !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !2, baseType: !11) !11 = !DIDerivedType(tag: DW_TAG_typedef, name: "S1", line: 4, file: !42, scope: !2, baseType: !12) !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "S1", line: 1, size: 128, align: 64, file: !42, scope: !2, elements: !13) @@ -92,7 +92,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !2, baseType: !16) !16 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float) !17 = !DIDerivedType(tag: DW_TAG_member, name: "nums", line: 3, size: 32, align: 32, offset: 64, file: !42, scope: !1, baseType: !5) -!18 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "nums", line: 7, arg: 2, scope: !0, file: !1, type: !5) +!18 = !DILocalVariable(name: "nums", line: 7, arg: 2, scope: !0, file: !1, type: !5) !19 = !DIGlobalVariable(name: "p", line: 14, isLocal: false, isDefinition: true, scope: !2, file: !1, type: !11, variable: %struct.S1* @p) !20 = !DILocation(line: 7, column: 13, scope: !0) !21 = !DILocation(line: 7, column: 21, scope: !0) diff --git a/test/DebugInfo/X86/dbg-value-isel.ll b/test/DebugInfo/X86/dbg-value-isel.ll index 04e4531d1d72..ae76beb81409 100644 --- a/test/DebugInfo/X86/dbg-value-isel.ll +++ b/test/DebugInfo/X86/dbg-value-isel.ll @@ -11,7 +11,7 @@ target triple = "x86_64-apple-darwin10.0.0" @lvgv = internal constant [0 x i8*] zeroinitializer @llvm.global.annotations = appending global [1 x %0] [%0 { i8* bitcast (void (i32 addrspace(1)*)* @__OpenCL_nbt02_kernel to i8*), i8* addrspacecast ([1 x i8] addrspace(2)* @sgv to i8*), i8* addrspacecast ([1 x i8] addrspace(2)* @fgv to i8*), i8* bitcast ([0 x i8*]* @lvgv to i8*), i32 0 }], section "llvm.metadata" -define void @__OpenCL_nbt02_kernel(i32 addrspace(1)* %ip) nounwind { +define void @__OpenCL_nbt02_kernel(i32 addrspace(1)* %ip) nounwind !dbg !0 { entry: call void @llvm.dbg.value(metadata i32 addrspace(1)* %ip, i64 0, metadata !8, metadata !DIExpression()), !dbg !9 %0 = call <4 x i32> @__amdil_get_local_id_int() nounwind @@ -81,22 +81,22 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!22} -!0 = !DISubprogram(name: "__OpenCL_nbt02_kernel", linkageName: "__OpenCL_nbt02_kernel", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !20, scope: !1, type: !3, function: void (i32 addrspace(1)*)* @__OpenCL_nbt02_kernel) +!0 = distinct !DISubprogram(name: "__OpenCL_nbt02_kernel", linkageName: "__OpenCL_nbt02_kernel", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !20, scope: !1, type: !3) !1 = !DIFile(filename: "OCLlLwTXZ.cl", directory: "/tmp") -!2 = !DICompileUnit(language: DW_LANG_C89, producer: "clc", isOptimized: false, emissionKind: 1, file: !20, enums: !21, retainedTypes: !21, subprograms: !19, imports: null) +!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "clc", isOptimized: false, emissionKind: 1, file: !20, enums: !21, retainedTypes: !21, subprograms: !19, imports: null) !3 = !DISubroutineType(types: !4) !4 = !{null, !5} !5 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, scope: !2, baseType: !6) !6 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint", file: !20, scope: !2, baseType: !7) !7 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) -!8 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "ip", line: 1, arg: 0, scope: !0, file: !1, type: !5) +!8 = !DILocalVariable(name: "ip", line: 1, arg: 1, scope: !0, file: !1, type: !5) !9 = !DILocation(line: 1, column: 32, scope: !0) -!10 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "tid", line: 3, scope: !11, file: !1, type: !6) +!10 = !DILocalVariable(name: "tid", line: 3, scope: !11, file: !1, type: !6) !11 = distinct !DILexicalBlock(line: 2, column: 1, file: !1, scope: !0) !12 = !DILocation(line: 5, column: 24, scope: !11) -!13 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "gid", line: 3, scope: !11, file: !1, type: !6) +!13 = !DILocalVariable(name: "gid", line: 3, scope: !11, file: !1, type: !6) !14 = !DILocation(line: 6, column: 25, scope: !11) -!15 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "lsz", line: 3, scope: !11, file: !1, type: !6) +!15 = !DILocalVariable(name: "lsz", line: 3, scope: !11, file: !1, type: !6) !16 = !DILocation(line: 7, column: 26, scope: !11) !17 = !DILocation(line: 9, column: 24, scope: !11) !18 = !DILocation(line: 10, column: 1, scope: !0) diff --git a/test/DebugInfo/X86/dbg-value-location.ll b/test/DebugInfo/X86/dbg-value-location.ll index 219fa7a5ff34..df9b4085bf37 100644 --- a/test/DebugInfo/X86/dbg-value-location.ll +++ b/test/DebugInfo/X86/dbg-value-location.ll @@ -16,7 +16,7 @@ target triple = "x86_64-apple-darwin10.0.0" declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone -define i32 @foo(i32 %dev, i64 %cmd, i8* %data, i32 %data2) nounwind optsize ssp { +define i32 @foo(i32 %dev, i64 %cmd, i8* %data, i32 %data2) nounwind optsize ssp !dbg !0 { entry: call void @llvm.dbg.value(metadata i32 %dev, i64 0, metadata !12, metadata !DIExpression()), !dbg !13 %tmp.i = load i32, i32* @dfm, align 4, !dbg !14 @@ -50,23 +50,23 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!29} -!0 = !DISubprogram(name: "foo", line: 19510, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 19510, file: !26, scope: !1, type: !3, function: i32 (i32, i64, i8*, i32)* @foo) +!0 = distinct !DISubprogram(name: "foo", line: 19510, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 19510, file: !26, scope: !1, type: !3) !1 = !DIFile(filename: "/tmp/f.c", directory: "/tmp") -!2 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 124753)", isOptimized: true, emissionKind: 0, file: !27, enums: !28, retainedTypes: !28, subprograms: !24, imports: null) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 124753)", isOptimized: true, emissionKind: 0, file: !27, enums: !28, retainedTypes: !28, subprograms: !24, imports: null) !3 = !DISubroutineType(types: !4) !4 = !{!5} !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = !DISubprogram(name: "bar3", line: 14827, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !26, scope: !1, type: !3, function: i32 (i32)* @bar3) -!7 = !DISubprogram(name: "bar2", line: 15397, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !26, scope: !1, type: !3, function: i32 (i32)* @bar2) -!8 = !DISubprogram(name: "bar", line: 12382, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !26, scope: !1, type: !9, function: i32 (i32, i32*)* @bar) +!6 = distinct !DISubprogram(name: "bar3", line: 14827, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !26, scope: !1, type: !3) +!7 = distinct !DISubprogram(name: "bar2", line: 15397, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !26, scope: !1, type: !3) +!8 = distinct !DISubprogram(name: "bar", line: 12382, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !26, scope: !1, type: !9) !9 = !DISubroutineType(types: !10) !10 = !{!11} !11 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char) -!12 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "var", line: 19509, arg: 0, scope: !0, file: !1, type: !5) +!12 = !DILocalVariable(name: "var", line: 19509, arg: 1, scope: !0, file: !1, type: !5) !13 = !DILocation(line: 19509, column: 20, scope: !0) !14 = !DILocation(line: 18091, column: 2, scope: !15, inlinedAt: !17) !15 = distinct !DILexicalBlock(line: 18086, column: 1, file: !26, scope: !16) -!16 = !DISubprogram(name: "foo_bar", line: 18086, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !26, scope: !1, type: !3) +!16 = distinct !DISubprogram(name: "foo_bar", line: 18086, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !26, scope: !1, type: !3) !17 = !DILocation(line: 19514, column: 2, scope: !18) !18 = distinct !DILexicalBlock(line: 19510, column: 1, file: !26, scope: !0) !22 = !DILocation(line: 18094, column: 2, scope: !15, inlinedAt: !17) diff --git a/test/DebugInfo/X86/dbg-value-range.ll b/test/DebugInfo/X86/dbg-value-range.ll index a8fa9073fa77..2bb5e021036f 100644 --- a/test/DebugInfo/X86/dbg-value-range.ll +++ b/test/DebugInfo/X86/dbg-value-range.ll @@ -2,7 +2,7 @@ %struct.a = type { i32 } -define i32 @bar(%struct.a* nocapture %b) nounwind ssp { +define i32 @bar(%struct.a* nocapture %b) nounwind ssp !dbg !0 { entry: tail call void @llvm.dbg.value(metadata %struct.a* %b, i64 0, metadata !6, metadata !DIExpression()), !dbg !13 %tmp1 = getelementptr inbounds %struct.a, %struct.a* %b, i64 0, i32 0, !dbg !14 @@ -20,18 +20,18 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!24} -!0 = !DISubprogram(name: "bar", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !22, scope: !1, type: !3, function: i32 (%struct.a*)* @bar, variables: !21) +!0 = distinct !DISubprogram(name: "bar", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !22, scope: !1, type: !3, variables: !21) !1 = !DIFile(filename: "bar.c", directory: "/private/tmp") -!2 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 122997)", isOptimized: true, emissionKind: 1, file: !22, enums: !23, retainedTypes: !23, subprograms: !20, imports: null) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 122997)", isOptimized: true, emissionKind: 1, file: !22, enums: !23, retainedTypes: !23, subprograms: !20, imports: null) !3 = !DISubroutineType(types: !4) !4 = !{!5} !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 5, arg: 0, scope: !0, file: !1, type: !7) +!6 = !DILocalVariable(name: "b", line: 5, arg: 1, scope: !0, file: !1, type: !7) !7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !2, baseType: !8) !8 = !DICompositeType(tag: DW_TAG_structure_type, name: "a", line: 1, size: 32, align: 32, file: !22, scope: !2, elements: !9) !9 = !{!10} !10 = !DIDerivedType(tag: DW_TAG_member, name: "c", line: 2, size: 32, align: 32, file: !22, scope: !1, baseType: !5) -!11 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "x", line: 6, scope: !12, file: !1, type: !5) +!11 = !DILocalVariable(name: "x", line: 6, scope: !12, file: !1, type: !5) !12 = distinct !DILexicalBlock(line: 5, column: 22, file: !22, scope: !0) !13 = !DILocation(line: 5, column: 19, scope: !0) !14 = !DILocation(line: 6, column: 14, scope: !12) diff --git a/test/DebugInfo/X86/dbg-value-terminator.ll b/test/DebugInfo/X86/dbg-value-terminator.ll index 5f50b13aa024..8b8bdec18ab1 100644 --- a/test/DebugInfo/X86/dbg-value-terminator.ll +++ b/test/DebugInfo/X86/dbg-value-terminator.ll @@ -9,7 +9,7 @@ ; CHECK: ##DEBUG_VALUE: foo:i %a = type { i32, i32 } -define hidden fastcc %a* @test() #1 { +define hidden fastcc %a* @test() #1 !dbg !1 { entry: %0 = icmp eq %a* undef, null, !dbg !12 br i1 %0, label %"14", label %return, !dbg !12 @@ -113,17 +113,17 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!22} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "Apple clang version", isOptimized: true, emissionKind: 1, file: !20, enums: !21, retainedTypes: !21, subprograms: !18, imports: null) -!1 = !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !20, scope: !2, type: !3, function: %a* ()* @test, variables: !19) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "Apple clang version", isOptimized: true, emissionKind: 1, file: !20, enums: !21, retainedTypes: !21, subprograms: !18, imports: null) +!1 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !20, scope: !2, type: !3, variables: !19) !2 = !DIFile(filename: "a.c", directory: "/private/tmp") !3 = !DISubroutineType(types: !4) !4 = !{!5} !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!6 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 2, arg: 1, scope: !1, file: !2, type: !5) -!7 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "c", line: 2, arg: 2, scope: !1, file: !2, type: !8) +!6 = !DILocalVariable(name: "i", line: 2, arg: 1, scope: !1, file: !2, type: !5) +!7 = !DILocalVariable(name: "c", line: 2, arg: 2, scope: !1, file: !2, type: !8) !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !0, baseType: !9) !9 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) -!10 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 3, scope: !11, file: !2, type: !9) +!10 = !DILocalVariable(name: "a", line: 3, scope: !11, file: !2, type: !9) !11 = distinct !DILexicalBlock(line: 2, column: 25, file: !20, scope: !1) !12 = !DILocation(line: 2, column: 13, scope: !1) !18 = !{!1} diff --git a/test/DebugInfo/X86/dbg_value_direct.ll b/test/DebugInfo/X86/dbg_value_direct.ll index 6446dfe491a6..b7f1ec8ccaa3 100644 --- a/test/DebugInfo/X86/dbg_value_direct.ll +++ b/test/DebugInfo/X86/dbg_value_direct.ll @@ -23,7 +23,7 @@ target triple = "x86_64-unknown-linux-gnu" @__asan_gen_ = private unnamed_addr constant [16 x i8] c"1 32 4 5 .addr \00", align 1 ; Function Attrs: sanitize_address uwtable -define void @_Z4funci(%struct.A* noalias sret %agg.result, i32) #0 "stack-protector-buffer-size"="1" { +define void @_Z4funci(%struct.A* noalias sret %agg.result, i32) #0 "stack-protector-buffer-size"="1" !dbg !4 { entry: %MyAlloca = alloca [96 x i8], align 32 %1 = ptrtoint [96 x i8]* %MyAlloca to i64 @@ -147,11 +147,11 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!22, !27} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "crash.cpp", directory: "/tmp") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "func", linkageName: "_Z4funci", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, function: void (%struct.A*, i32)* @_Z4funci, variables: !2) +!4 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "crash.cpp", directory: "/tmp") !6 = !DISubroutineType(types: !7) !7 = !{!8, !21} @@ -168,8 +168,8 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !19 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8) !21 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !22 = !{i32 2, !"Dwarf Version", i32 3} -!23 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "", line: 6, arg: 1, scope: !4, file: !5, type: !21) -!24 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 7, scope: !4, file: !5, type: !8) +!23 = !DILocalVariable(name: "", line: 6, arg: 1, scope: !4, file: !5, type: !21) +!24 = !DILocalVariable(name: "a", line: 7, scope: !4, file: !5, type: !8) !25 = !DILocation(line: 7, scope: !4) !26 = !DILocation(line: 8, scope: !4) !27 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/debug-dead-local-var.ll b/test/DebugInfo/X86/debug-dead-local-var.ll index d56d17d06e61..9a2872aeb0a8 100644 --- a/test/DebugInfo/X86/debug-dead-local-var.ll +++ b/test/DebugInfo/X86/debug-dead-local-var.ll @@ -16,7 +16,7 @@ ; CHECK: DW_TAG_structure_type ; Function Attrs: nounwind readnone uwtable -define i32 @bar() #0 { +define i32 @bar() #0 !dbg !4 { entry: ret i32 1, !dbg !21 } @@ -27,20 +27,20 @@ attributes #0 = { nounwind readnone uwtable "less-precise-fpmad"="false" "no-fra !llvm.module.flags = !{!18, !19} !llvm.ident = !{!20} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 209255) (llvm/trunk 209253)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 209255) (llvm/trunk 209253)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "debug-dead-local-var.c", directory: "/usr/local/google/home/echristo") !2 = !{} !3 = !{!4, !9} -!4 = !DISubprogram(name: "bar", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 11, file: !1, scope: !5, type: !6, function: i32 ()* @bar, variables: !2) +!4 = distinct !DISubprogram(name: "bar", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 11, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "debug-dead-local-var.c", directory: "/usr/local/google/home/echristo") !6 = !DISubroutineType(types: !7) !7 = !{!8} !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = !DISubprogram(name: "foo", line: 6, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 6, file: !1, scope: !5, type: !10, variables: !12) +!9 = distinct !DISubprogram(name: "foo", line: 6, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 6, file: !1, scope: !5, type: !10, variables: !12) !10 = !DISubroutineType(types: !11) !11 = !{null} !12 = !{!13} -!13 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "xyz", line: 8, scope: !9, file: !5, type: !14) +!13 = !DILocalVariable(name: "xyz", line: 8, scope: !9, file: !5, type: !14) !14 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 8, size: 64, align: 32, file: !1, scope: !9, elements: !15) !15 = !{!16, !17} !16 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 8, size: 32, align: 32, file: !1, scope: !14, baseType: !8) diff --git a/test/DebugInfo/X86/debug-info-access.ll b/test/DebugInfo/X86/debug-info-access.ll index 21da7b2db1bb..c9a50395c716 100644 --- a/test/DebugInfo/X86/debug-info-access.ll +++ b/test/DebugInfo/X86/debug-info-access.ll @@ -96,7 +96,7 @@ target triple = "x86_64-apple-macosx10.10.0" @u = global %union.U zeroinitializer, align 4 ; Function Attrs: nounwind ssp uwtable -define void @_Z4freev() #0 { +define void @_Z4freev() #0 !dbg !30 { ret void, !dbg !41 } @@ -106,7 +106,7 @@ attributes #0 = { nounwind ssp uwtable } !llvm.module.flags = !{!38, !39} !llvm.ident = !{!40} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !29, globals: !34, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !29, globals: !34, imports: !2) !1 = !DIFile(filename: "/llvm/tools/clang/test/CodeGenCXX/debug-info-access.cpp", directory: "") !2 = !{} !3 = !{!4, !12, !22} @@ -136,7 +136,7 @@ attributes #0 = { nounwind ssp uwtable } !27 = !{null, !28} !28 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1U") !29 = !{!30} -!30 = !DISubprogram(name: "free", linkageName: "_Z4freev", line: 35, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 35, file: !1, scope: !31, type: !32, function: void ()* @_Z4freev, variables: !2) +!30 = distinct !DISubprogram(name: "free", linkageName: "_Z4freev", line: 35, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 35, file: !1, scope: !31, type: !32, variables: !2) !31 = !DIFile(filename: "/llvm/tools/clang/test/CodeGenCXX/debug-info-access.cpp", directory: "") !32 = !DISubroutineType(types: !33) !33 = !{null} diff --git a/test/DebugInfo/X86/debug-info-block-captured-self.ll b/test/DebugInfo/X86/debug-info-block-captured-self.ll index e79b093d031a..1c3dc24b3240 100644 --- a/test/DebugInfo/X86/debug-info-block-captured-self.ll +++ b/test/DebugInfo/X86/debug-info-block-captured-self.ll @@ -64,14 +64,14 @@ %0 = type opaque %struct.__block_descriptor = type { i64, i64 } declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 -define internal void @"__24-[Main initWithContext:]_block_invoke"(i8* %.block_descriptor, i8* %obj) #0 { +define internal void @"__24-[Main initWithContext:]_block_invoke"(i8* %.block_descriptor, i8* %obj) #0 !dbg !38 { %block = bitcast i8* %.block_descriptor to <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>*, !dbg !84 %block.captured-self = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>* %block, i32 0, i32 5, !dbg !84 call void @llvm.dbg.declare(metadata <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>* %block, metadata !86, metadata !110), !dbg !87 ret void, !dbg !87 } -define internal void @"__24-[Main initWithContext:]_block_invoke_2"(i8* %.block_descriptor, i8* %object) #0 { +define internal void @"__24-[Main initWithContext:]_block_invoke_2"(i8* %.block_descriptor, i8* %object) #0 !dbg !42 { %block = bitcast i8* %.block_descriptor to <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>*, !dbg !103 %block.captured-self = getelementptr inbounds <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>, <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>* %block, i32 0, i32 5, !dbg !103 call void @llvm.dbg.declare(metadata <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>* %block, metadata !105, metadata !109), !dbg !106 @@ -80,7 +80,7 @@ define internal void @"__24-[Main initWithContext:]_block_invoke_2"(i8* %.block_ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!108} -!0 = !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.3 ", isOptimized: false, runtimeVersion: 2, emissionKind: 0, file: !107, enums: !2, retainedTypes: !4, subprograms: !23, globals: !15, imports: !15) +!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.3 ", isOptimized: false, runtimeVersion: 2, emissionKind: 0, file: !107, enums: !2, retainedTypes: !4, subprograms: !23, globals: !15, imports: !15) !1 = !DIFile(filename: "llvm/tools/clang/test/CodeGenObjC/debug-info-block-captured-self.m", directory: "") !2 = !{!3} !3 = !DICompositeType(tag: DW_TAG_enumeration_type, line: 20, size: 32, align: 32, file: !107, elements: !4) @@ -95,16 +95,16 @@ define internal void @"__24-[Main initWithContext:]_block_invoke_2"(i8* %.block_ !32 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !33) !33 = !DICompositeType(tag: DW_TAG_structure_type, name: "objc_class", flags: DIFlagFwdDecl, file: !107) !34 = !DICompositeType(tag: DW_TAG_structure_type, name: "Main", line: 23, flags: DIFlagArtificial | DIFlagObjectPointer, runtimeLang: DW_LANG_ObjC, file: !107) -!38 = !DISubprogram(name: "__24-[Main initWithContext:]_block_invoke", line: 33, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 33, file: !1, scope: !1, type: !39, function: void (i8*, i8*)* @"__24-[Main initWithContext:]_block_invoke", variables: !15) +!38 = distinct !DISubprogram(name: "__24-[Main initWithContext:]_block_invoke", line: 33, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 33, file: !1, scope: !1, type: !39, variables: !15) !39 = !DISubroutineType(types: !40) !40 = !{null, !41, !27} !41 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null) -!42 = !DISubprogram(name: "__24-[Main initWithContext:]_block_invoke_2", line: 35, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 35, file: !1, scope: !1, type: !39, function: void (i8*, i8*)* @"__24-[Main initWithContext:]_block_invoke_2", variables: !15) +!42 = distinct !DISubprogram(name: "__24-[Main initWithContext:]_block_invoke_2", line: 35, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 35, file: !1, scope: !1, type: !39, variables: !15) !84 = !DILocation(line: 33, scope: !38) -!86 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "self", line: 41, scope: !38, file: !1, type: !34) +!86 = !DILocalVariable(name: "self", line: 41, scope: !38, file: !1, type: !34) !87 = !DILocation(line: 41, scope: !38) !103 = !DILocation(line: 35, scope: !42) -!105 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "self", line: 40, scope: !42, file: !1, type: !34) +!105 = !DILocalVariable(name: "self", line: 40, scope: !42, file: !1, type: !34) !106 = !DILocation(line: 40, scope: !42) !107 = !DIFile(filename: "llvm/tools/clang/test/CodeGenObjC/debug-info-block-captured-self.m", directory: "") !108 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/debug-info-blocks.ll b/test/DebugInfo/X86/debug-info-blocks.ll index a9aadfdb7313..8a929491f28d 100644 --- a/test/DebugInfo/X86/debug-info-blocks.ll +++ b/test/DebugInfo/X86/debug-info-blocks.ll @@ -95,7 +95,7 @@ target triple = "x86_64-apple-darwin" @"\01L_OBJC_LABEL_CLASS_$" = internal global [1 x i8*] [i8* bitcast (%struct._class_t* @"OBJC_CLASS_$_A" to i8*)], section "__DATA, __objc_classlist, regular, no_dead_strip", align 8 @llvm.used = appending global [14 x i8*] [i8* bitcast (%struct._class_t** @"\01L_OBJC_CLASSLIST_SUP_REFS_$_" to i8*), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_" to i8*), i8* bitcast (%struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_" to i8*), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @"\01L_OBJC_METH_VAR_NAME_1", i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @"\01L_OBJC_METH_VAR_NAME_2", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @"\01L_OBJC_CLASS_NAME_", i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @"\01L_OBJC_METH_VAR_TYPE_", i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01l_OBJC_$_INSTANCE_METHODS_A" to i8*), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @"\01L_OBJC_METH_VAR_NAME_3", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @"\01L_OBJC_METH_VAR_TYPE_4", i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._ivar_t] }* @"\01l_OBJC_$_INSTANCE_VARIABLES_A" to i8*), i8* bitcast (%struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_5" to i8*), i8* bitcast ([1 x i8*]* @"\01L_OBJC_LABEL_CLASS_$" to i8*)], section "llvm.metadata" -define internal i8* @"\01-[A init]"(%0* %self, i8* %_cmd) #0 { +define internal i8* @"\01-[A init]"(%0* %self, i8* %_cmd) #0 !dbg !13 { %1 = alloca %0*, align 8 %2 = alloca i8*, align 8 %3 = alloca %struct._objc_super @@ -147,7 +147,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 declare i8* @objc_msgSendSuper2(%struct._objc_super*, i8*, ...) -define internal void @run(void ()* %block) #0 { +define internal void @run(void ()* %block) #0 !dbg !39 { %1 = alloca void ()*, align 8 store void ()* %block, void ()** %1, align 8 call void @llvm.dbg.declare(metadata void ()** %1, metadata !72, metadata !DIExpression()), !dbg !73 @@ -161,7 +161,7 @@ define internal void @run(void ()* %block) #0 { ret void, !dbg !75 } -define internal void @"__9-[A init]_block_invoke"(i8* %.block_descriptor) #0 { +define internal void @"__9-[A init]_block_invoke"(i8* %.block_descriptor) #0 !dbg !27 { %1 = alloca i8*, align 8 %2 = alloca <{ i8*, i32, i32, i8*, %struct.__block_descriptor*, %0* }>*, align 8 %d = alloca %1*, align 8 @@ -206,7 +206,7 @@ declare i8* @objc_msgSend_fixup(i8*, %struct._message_ref_t*, ...) declare i8* @objc_msgSend(i8*, i8*, ...) #2 -define internal void @__copy_helper_block_(i8*, i8*) { +define internal void @__copy_helper_block_(i8*, i8*) !dbg !31 { %3 = alloca i8*, align 8 %4 = alloca i8*, align 8 store i8* %0, i8** %3, align 8 @@ -228,7 +228,7 @@ define internal void @__copy_helper_block_(i8*, i8*) { declare void @_Block_object_assign(i8*, i8*, i32) -define internal void @__destroy_helper_block_(i8*) { +define internal void @__destroy_helper_block_(i8*) !dbg !35 { %2 = alloca i8*, align 8 store i8* %0, i8** %2, align 8 call void @llvm.dbg.declare(metadata i8** %2, metadata !105, metadata !DIExpression()), !dbg !106 @@ -243,7 +243,7 @@ define internal void @__destroy_helper_block_(i8*) { declare void @_Block_object_dispose(i8*, i32) -define i32 @main() #0 { +define i32 @main() #0 !dbg !36 { %1 = alloca i32, align 4 %a = alloca %0*, align 8 store i32 0, i32* %1 @@ -270,7 +270,7 @@ attributes #3 = { nounwind } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!56, !57, !58, !59, !110} -!0 = !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.3 ", isOptimized: false, runtimeVersion: 2, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !12, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.3 ", isOptimized: false, runtimeVersion: 2, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !12, globals: !2, imports: !2) !1 = !DIFile(filename: "llvm/tools/clang/test/CodeGenObjC/<unknown>", directory: "llvm/_build.ninja.Debug") !2 = !{} !3 = !{!4} @@ -283,7 +283,7 @@ attributes #3 = { nounwind } !10 = !DIDerivedType(tag: DW_TAG_member, name: "ivar", line: 35, size: 32, align: 32, file: !5, scope: !6, baseType: !11) !11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !12 = !{!13, !27, !31, !35, !36, !39} -!13 = !DISubprogram(name: "-[A init]", line: 46, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 46, file: !5, scope: !6, type: !14, function: i8* (%0*, i8*)* @"\01-[A init]", variables: !2) +!13 = distinct !DISubprogram(name: "-[A init]", line: 46, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 46, file: !5, scope: !6, type: !14, variables: !2) !14 = !DISubroutineType(types: !15) !15 = !{!16, !23, !24} !16 = !DIDerivedType(tag: DW_TAG_typedef, name: "id", line: 46, file: !5, baseType: !17) @@ -297,19 +297,19 @@ attributes #3 = { nounwind } !24 = !DIDerivedType(tag: DW_TAG_typedef, name: "SEL", line: 46, flags: DIFlagArtificial, file: !5, baseType: !25) !25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !26) !26 = !DICompositeType(tag: DW_TAG_structure_type, name: "objc_selector", flags: DIFlagFwdDecl, file: !1) -!27 = !DISubprogram(name: "__9-[A init]_block_invoke", line: 49, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 49, file: !5, scope: !6, type: !28, function: void (i8*)* @"__9-[A init]_block_invoke", variables: !2) +!27 = distinct !DISubprogram(name: "__9-[A init]_block_invoke", line: 49, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 49, file: !5, scope: !6, type: !28, variables: !2) !28 = !DISubroutineType(types: !29) !29 = !{null, !30} !30 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null) -!31 = !DISubprogram(name: "__copy_helper_block_", line: 52, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 52, file: !1, scope: !32, type: !33, function: void (i8*, i8*)* @__copy_helper_block_, variables: !2) +!31 = distinct !DISubprogram(name: "__copy_helper_block_", line: 52, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 52, file: !1, scope: !32, type: !33, variables: !2) !32 = !DIFile(filename: "llvm/tools/clang/test/CodeGenObjC/<unknown>", directory: "llvm/_build.ninja.Debug") !33 = !DISubroutineType(types: !34) !34 = !{null, !30, !30} -!35 = !DISubprogram(name: "__destroy_helper_block_", line: 52, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 52, file: !1, scope: !32, type: !28, function: void (i8*)* @__destroy_helper_block_, variables: !2) -!36 = !DISubprogram(name: "main", line: 59, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 60, file: !5, scope: !6, type: !37, function: i32 ()* @main, variables: !2) +!35 = distinct !DISubprogram(name: "__destroy_helper_block_", line: 52, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 52, file: !1, scope: !32, type: !28, variables: !2) +!36 = distinct !DISubprogram(name: "main", line: 59, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 60, file: !5, scope: !6, type: !37, variables: !2) !37 = !DISubroutineType(types: !38) !38 = !{!11} -!39 = !DISubprogram(name: "run", line: 39, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 40, file: !5, scope: !6, type: !40, function: void (void ()*)* @run, variables: !2) +!39 = distinct !DISubprogram(name: "run", line: 39, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 40, file: !5, scope: !6, type: !40, variables: !2) !40 = !DISubroutineType(types: !41) !41 = !{null, !42} !42 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !43) @@ -330,10 +330,10 @@ attributes #3 = { nounwind } !57 = !{i32 1, !"Objective-C Image Info Version", i32 0} !58 = !{i32 1, !"Objective-C Image Info Section", !"__DATA, __objc_imageinfo, regular, no_dead_strip"} !59 = !{i32 4, !"Objective-C Garbage Collection", i32 0} -!60 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "self", line: 46, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !13, file: !32, type: !61) +!60 = !DILocalVariable(name: "self", line: 46, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !13, file: !32, type: !61) !61 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4) !62 = !DILocation(line: 46, scope: !13) -!63 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "_cmd", line: 46, arg: 2, flags: DIFlagArtificial, scope: !13, file: !32, type: !64) +!63 = !DILocalVariable(name: "_cmd", line: 46, arg: 2, flags: DIFlagArtificial, scope: !13, file: !32, type: !64) !64 = !DIDerivedType(tag: DW_TAG_typedef, name: "SEL", line: 46, file: !5, baseType: !25) !65 = !DILocation(line: 48, scope: !66) !66 = distinct !DILexicalBlock(line: 47, column: 0, file: !5, scope: !13) @@ -342,11 +342,11 @@ attributes #3 = { nounwind } !69 = distinct !DILexicalBlock(line: 48, column: 0, file: !5, scope: !66) !70 = !DILocation(line: 53, scope: !69) !71 = !DILocation(line: 54, scope: !66) -!72 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "block", line: 39, arg: 1, scope: !39, file: !6, type: !42) +!72 = !DILocalVariable(name: "block", line: 39, arg: 1, scope: !39, file: !6, type: !42) !73 = !DILocation(line: 39, scope: !39) !74 = !DILocation(line: 41, scope: !39) !75 = !DILocation(line: 42, scope: !39) -!76 = !DILocalVariable(tag: DW_TAG_arg_variable, name: ".block_descriptor", line: 49, arg: 1, flags: DIFlagArtificial, scope: !27, file: !6, type: !77) +!76 = !DILocalVariable(name: ".block_descriptor", line: 49, arg: 1, flags: DIFlagArtificial, scope: !27, file: !6, type: !77) !77 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !78) !78 = !DICompositeType(tag: DW_TAG_structure_type, name: "__block_literal_1", line: 49, size: 320, align: 64, file: !5, scope: !6, elements: !79) !79 = !{!80, !81, !82, !83, !84, !87} @@ -359,9 +359,9 @@ attributes #3 = { nounwind } !86 = !DICompositeType(tag: DW_TAG_structure_type, name: "__block_descriptor_withcopydispose", line: 49, flags: DIFlagFwdDecl, file: !1) !87 = !DIDerivedType(tag: DW_TAG_member, name: "self", line: 49, size: 64, align: 64, offset: 256, file: !5, scope: !6, baseType: !61) !88 = !DILocation(line: 49, scope: !27) -!89 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "self", line: 52, scope: !27, file: !32, type: !23) +!89 = !DILocalVariable(name: "self", line: 52, scope: !27, file: !32, type: !23) !90 = !DILocation(line: 52, scope: !27) -!91 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "d", line: 50, scope: !92, file: !6, type: !93) +!91 = !DILocalVariable(name: "d", line: 50, scope: !92, file: !6, type: !93) !92 = distinct !DILexicalBlock(line: 49, column: 0, file: !5, scope: !27) !93 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !94) !94 = !DICompositeType(tag: DW_TAG_structure_type, name: "NSMutableDictionary", line: 30, align: 8, runtimeLang: DW_LANG_ObjC, file: !5, scope: !6, elements: !95) @@ -372,12 +372,12 @@ attributes #3 = { nounwind } !99 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !97, baseType: !9) !100 = !DILocation(line: 50, scope: !92) !101 = !DILocation(line: 51, scope: !92) -!102 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "", line: 52, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !31, file: !32, type: !30) +!102 = !DILocalVariable(name: "", line: 52, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !31, file: !32, type: !30) !103 = !DILocation(line: 52, scope: !31) -!104 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "", line: 52, arg: 2, flags: DIFlagArtificial, scope: !31, file: !32, type: !30) -!105 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "", line: 52, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !35, file: !32, type: !30) +!104 = !DILocalVariable(name: "", line: 52, arg: 2, flags: DIFlagArtificial, scope: !31, file: !32, type: !30) +!105 = !DILocalVariable(name: "", line: 52, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !35, file: !32, type: !30) !106 = !DILocation(line: 52, scope: !35) -!107 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 61, scope: !36, file: !6, type: !61) +!107 = !DILocalVariable(name: "a", line: 61, scope: !36, file: !6, type: !61) !108 = !DILocation(line: 61, scope: !36) !109 = !DILocation(line: 62, scope: !36) !110 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/debug-info-packed-struct.ll b/test/DebugInfo/X86/debug-info-packed-struct.ll index 6829c2d13740..50b68a714ea8 100644 --- a/test/DebugInfo/X86/debug-info-packed-struct.ll +++ b/test/DebugInfo/X86/debug-info-packed-struct.ll @@ -148,7 +148,7 @@ target triple = "x86_64-apple-darwin" !llvm.module.flags = !{!45, !46} !llvm.ident = !{!47} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 240791) (llvm/trunk 240790)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 240791) (llvm/trunk 240790)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) !1 = !DIFile(filename: "/llvm/tools/clang/test/CodeGen/<stdin>", directory: "/llvm/_build.ninja.release") !2 = !{} !3 = !{!4, !18, !25, !35} diff --git a/test/DebugInfo/X86/debug-info-static-member.ll b/test/DebugInfo/X86/debug-info-static-member.ll index 1dc85b954876..a42279b0a4af 100644 --- a/test/DebugInfo/X86/debug-info-static-member.ll +++ b/test/DebugInfo/X86/debug-info-static-member.ll @@ -42,7 +42,7 @@ @_ZN1C1bE = global i32 2, align 4 @_ZN1C1cE = global i32 1, align 4 -define i32 @main() nounwind uwtable { +define i32 @main() nounwind uwtable !dbg !5 { entry: %retval = alloca i32, align 4 %instance_C = alloca %class.C, align 4 @@ -59,10 +59,10 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!34} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 171914)", isOptimized: false, emissionKind: 0, file: !33, enums: !1, retainedTypes: !1, subprograms: !3, globals: !10, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 171914)", isOptimized: false, emissionKind: 0, file: !33, enums: !1, retainedTypes: !1, subprograms: !3, globals: !10, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "main", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 23, file: !33, scope: !6, type: !7, function: i32 ()* @main, variables: !1) +!5 = distinct !DISubprogram(name: "main", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 23, file: !33, scope: !6, type: !7, variables: !1) !6 = !DIFile(filename: "/usr/local/google/home/blaikie/Development/llvm/src/tools/clang/test/CodeGenCXX/debug-info-static-member.cpp", directory: "/home/blaikie/local/Development/llvm/build/clang/x86-64/Debug/llvm") !7 = !DISubroutineType(types: !8) !8 = !{!9} @@ -85,7 +85,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !26 = !DIDerivedType(tag: DW_TAG_member, name: "d", line: 11, size: 32, align: 32, flags: DIFlagPublic, file: !33, scope: !13, baseType: !9) !27 = !DIGlobalVariable(name: "b", linkageName: "_ZN1C1bE", line: 15, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, variable: i32* @_ZN1C1bE, declaration: !19) !28 = !DIGlobalVariable(name: "c", linkageName: "_ZN1C1cE", line: 16, isLocal: false, isDefinition: true, scope: null, file: !6, type: !9, variable: i32* @_ZN1C1cE, declaration: !23) -!29 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "instance_C", line: 20, scope: !5, file: !6, type: !13) +!29 = !DILocalVariable(name: "instance_C", line: 20, scope: !5, file: !6, type: !13) !30 = !DILocation(line: 20, scope: !5) !31 = !DILocation(line: 21, scope: !5) !32 = !DILocation(line: 22, scope: !5) diff --git a/test/DebugInfo/X86/debug-loc-asan.ll b/test/DebugInfo/X86/debug-loc-asan.ll index 68bef4904800..2e0135574496 100644 --- a/test/DebugInfo/X86/debug-loc-asan.ll +++ b/test/DebugInfo/X86/debug-loc-asan.ll @@ -7,15 +7,14 @@ ; int bar(int y) { ; return y + 2; ; } -; with "clang++ -S -emit-llvm -fsanitize=address -O0 -g test.cc" +; with "clang++ -S -emit-llvm -mllvm -asan-skip-promotable-allocas=0 -fsanitize=address -O0 -g test.cc" -; First, argument variable "y" resides in %rdi: -; CHECK: DEBUG_VALUE: bar:y <- RDI - -; Then its address is stored in a location on a stack: +; The address of the (potentially now malloc'ed) alloca ends up +; in RDI, after which it is spilled to the stack. We record the +; spill OFFSET on the stack for checking the debug info below. +; CHECK: #DEBUG_VALUE: bar:y <- [%RDI+0] ; CHECK: movq %rdi, [[OFFSET:[0-9]+]](%rsp) ; CHECK-NEXT: [[START_LABEL:.Ltmp[0-9]+]] -; CHECK-NEXT: DEBUG_VALUE: bar:y <- [RSP+[[OFFSET]]] ; This location should be valid until the end of the function. ; CHECK: .Ldebug_loc{{[0-9]+}}: @@ -42,7 +41,7 @@ target triple = "x86_64-unknown-linux-gnu" @__asan_gen_ = private unnamed_addr constant [16 x i8] c"1 32 4 6 y.addr\00", align 1 ; Function Attrs: nounwind sanitize_address uwtable -define i32 @_Z3bari(i32 %y) #0 { +define i32 @_Z3bari(i32 %y) #0 !dbg !4 { entry: %MyAlloca = alloca [64 x i8], align 32 %0 = ptrtoint [64 x i8]* %MyAlloca to i64 @@ -165,11 +164,11 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!9, !10} !llvm.ident = !{!11} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (209308)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (209308)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "test.cc", directory: "/llvm_cmake_gcc") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "bar", linkageName: "_Z3bari", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i32)* @_Z3bari, variables: !2) +!4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3bari", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "test.cc", directory: "/llvm_cmake_gcc") !6 = !DISubroutineType(types: !7) !7 = !{!8, !8} @@ -177,6 +176,6 @@ attributes #1 = { nounwind readnone } !9 = !{i32 2, !"Dwarf Version", i32 4} !10 = !{i32 2, !"Debug Info Version", i32 3} !11 = !{!"clang version 3.5.0 (209308)"} -!12 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "y", line: 1, arg: 1, scope: !4, file: !5, type: !8) +!12 = !DILocalVariable(name: "y", line: 1, arg: 1, scope: !4, file: !5, type: !8) !13 = !DILocation(line: 2, scope: !4) !14 = !DIExpression(DW_OP_deref) diff --git a/test/DebugInfo/X86/debug-loc-empty-entries.ll b/test/DebugInfo/X86/debug-loc-empty-entries.ll index 3b997fd35e06..776bdbddfb02 100644 --- a/test/DebugInfo/X86/debug-loc-empty-entries.ll +++ b/test/DebugInfo/X86/debug-loc-empty-entries.ll @@ -24,7 +24,7 @@ ;; } ; Function Attrs: noreturn nounwind readnone -define void @_Z3fn1v() #0 { +define void @_Z3fn1v() #0 !dbg !4 { entry: tail call void @llvm.dbg.value(metadata float 1.000000e+00, i64 0, metadata !9, metadata !14), !dbg !15 br label %for.cond, !dbg !16 @@ -44,16 +44,16 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!11, !12} !llvm.ident = !{!13} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 238517) (llvm/trunk 238524)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 238517) (llvm/trunk 238524)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "<stdin>", directory: "/Users/dexonsmith/data/llvm/bootstrap/play/delta2/testcase") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "fn1", linkageName: "_Z3fn1v", scope: !5, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, function: void ()* @_Z3fn1v, variables: !8) +!4 = distinct !DISubprogram(name: "fn1", linkageName: "_Z3fn1v", scope: !5, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, variables: !8) !5 = !DIFile(filename: "t.cpp", directory: "/Users/dexonsmith/data/llvm/bootstrap/play/delta2/testcase") !6 = !DISubroutineType(types: !7) !7 = !{null} !8 = !{!9} -!9 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", scope: !4, file: !5, line: 2, type: !10) +!9 = !DILocalVariable(name: "a", scope: !4, file: !5, line: 2, type: !10) !10 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float) !11 = !{i32 2, !"Dwarf Version", i32 4} !12 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/debug-loc-offset.ll b/test/DebugInfo/X86/debug-loc-offset.ll index cf2fcc8e2229..d6302a1e4247 100644 --- a/test/DebugInfo/X86/debug-loc-offset.ll +++ b/test/DebugInfo/X86/debug-loc-offset.ll @@ -60,7 +60,7 @@ %struct.A = type { i32 (...)**, i32 } ; Function Attrs: nounwind -define i32 @_Z3bari(i32 %b) #0 { +define i32 @_Z3bari(i32 %b) #0 !dbg !4 { entry: %b.addr = alloca i32, align 4 store i32 %b, i32* %b.addr, align 4 @@ -73,7 +73,7 @@ entry: ; Function Attrs: nounwind readnone declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 -define void @_Z3baz1A(%struct.A* %a) #2 { +define void @_Z3baz1A(%struct.A* %a) #2 !dbg !14 { entry: %z = alloca i32, align 4 call void @llvm.dbg.declare(metadata %struct.A* %a, metadata !24, metadata !DIExpression(DW_OP_deref)), !dbg !25 @@ -116,33 +116,33 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.module.flags = !{!18, !19} !llvm.ident = !{!20, !20} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (210479)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (210479)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "debug-loc-offset1.cc", directory: "/llvm_cmake_gcc") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "bar", linkageName: "_Z3bari", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i32)* @_Z3bari, variables: !2) +!4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3bari", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "debug-loc-offset1.cc", directory: "/llvm_cmake_gcc") !6 = !DISubroutineType(types: !7) !7 = !{!8, !8} !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (210479)", isOptimized: false, emissionKind: 1, file: !10, enums: !2, retainedTypes: !11, subprograms: !13, globals: !2, imports: !2) +!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (210479)", isOptimized: false, emissionKind: 1, file: !10, enums: !2, retainedTypes: !11, subprograms: !13, globals: !2, imports: !2) !10 = !DIFile(filename: "debug-loc-offset2.cc", directory: "/llvm_cmake_gcc") !11 = !{!12} !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", line: 1, flags: DIFlagFwdDecl, file: !10, identifier: "_ZTS1A") !13 = !{!14} -!14 = !DISubprogram(name: "baz", linkageName: "_Z3baz1A", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !10, scope: !15, type: !16, function: void (%struct.A*)* @_Z3baz1A, variables: !2) +!14 = distinct !DISubprogram(name: "baz", linkageName: "_Z3baz1A", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !10, scope: !15, type: !16, variables: !2) !15 = !DIFile(filename: "debug-loc-offset2.cc", directory: "/llvm_cmake_gcc") !16 = !DISubroutineType(types: !17) !17 = !{null, !12} !18 = !{i32 2, !"Dwarf Version", i32 4} !19 = !{i32 2, !"Debug Info Version", i32 3} !20 = !{!"clang version 3.5.0 (210479)"} -!21 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 1, arg: 1, scope: !4, file: !5, type: !8) +!21 = !DILocalVariable(name: "b", line: 1, arg: 1, scope: !4, file: !5, type: !8) !22 = !DILocation(line: 1, scope: !4) !23 = !DILocation(line: 2, scope: !4) -!24 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 6, arg: 1, scope: !14, file: !15, type: !"_ZTS1A") +!24 = !DILocalVariable(name: "a", line: 6, arg: 1, scope: !14, file: !15, type: !"_ZTS1A") !25 = !DILocation(line: 6, scope: !14) -!26 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "z", line: 7, scope: !14, file: !15, type: !8) +!26 = !DILocalVariable(name: "z", line: 7, scope: !14, file: !15, type: !8) !27 = !DILocation(line: 7, scope: !14) !28 = !DILocation(line: 8, scope: !29) !29 = distinct !DILexicalBlock(line: 8, column: 0, file: !10, scope: !14) diff --git a/test/DebugInfo/X86/debug-ranges-offset.ll b/test/DebugInfo/X86/debug-ranges-offset.ll index 19c3bcf37483..520f3c45e18c 100644 --- a/test/DebugInfo/X86/debug-ranges-offset.ll +++ b/test/DebugInfo/X86/debug-ranges-offset.ll @@ -19,7 +19,7 @@ @_end = external hidden global i32 ; Function Attrs: sanitize_memory uwtable -define void @_Z1fv() #0 { +define void @_Z1fv() #0 !dbg !4 { entry: %p = alloca i32*, align 8 %0 = ptrtoint i32** %p to i64, !dbg !19 @@ -82,7 +82,7 @@ if.end: ; preds = %16, %if.then declare i8* @_Znwm(i64) #1 ; Function Attrs: sanitize_memory uwtable -define i32 @main() #0 { +define i32 @main() #0 !dbg !13 { entry: %p.i = alloca i32*, align 8 %0 = ptrtoint i32** %p.i to i64, !dbg !30 @@ -202,20 +202,20 @@ attributes #4 = { builtin } !llvm.module.flags = !{!16, !17} !llvm.ident = !{!18} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 207243) (llvm/trunk 207259)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 207243) (llvm/trunk 207259)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "foo.cpp", directory: "/usr/local/google/home/echristo/tmp") !2 = !{} !3 = !{!4, !13} -!4 = !DISubprogram(name: "f", linkageName: "_Z1fv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, function: void ()* @_Z1fv, variables: !8) +!4 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !8) !5 = !DIFile(filename: "foo.cpp", directory: "/usr/local/google/home/echristo/tmp") !6 = !DISubroutineType(types: !7) !7 = !{null} !8 = !{!9} -!9 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "p", line: 4, scope: !4, file: !5, type: !10) +!9 = !DILocalVariable(name: "p", line: 4, scope: !4, file: !5, type: !10) !10 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !11) !11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !12) !12 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!13 = !DISubprogram(name: "main", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !1, scope: !5, type: !14, function: i32 ()* @main, variables: !2) +!13 = distinct !DISubprogram(name: "main", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !1, scope: !5, type: !14, variables: !2) !14 = !DISubroutineType(types: !15) !15 = !{!12} !16 = !{i32 2, !"Dwarf Version", i32 4} @@ -234,7 +234,7 @@ attributes #4 = { builtin } !29 = !DILocation(line: 7, scope: !4) !30 = !DILocation(line: 4, scope: !4, inlinedAt: !31) !31 = !DILocation(line: 10, scope: !13) -!32 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "p", line: 4, scope: !4, file: !5, type: !10) +!32 = !DILocalVariable(name: "p", line: 4, scope: !4, file: !5, type: !10) !33 = !DILocation(line: 5, scope: !21, inlinedAt: !31) !34 = !DILocation(line: 6, scope: !21, inlinedAt: !31) !35 = !DILocation(line: 7, scope: !4, inlinedAt: !31) diff --git a/test/DebugInfo/X86/debug_frame.ll b/test/DebugInfo/X86/debug_frame.ll index 48ce554f0119..563406ccaf90 100644 --- a/test/DebugInfo/X86/debug_frame.ll +++ b/test/DebugInfo/X86/debug_frame.ll @@ -4,7 +4,7 @@ ; CHECK: .cfi_sections .debug_frame -define void @f() nounwind { +define void @f() nounwind !dbg !0 { entry: ret void } @@ -13,9 +13,9 @@ entry: !llvm.module.flags = !{!7} !5 = !{!0} -!0 = !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !6, scope: !1, type: !3, function: void ()* @f) +!0 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !6, scope: !1, type: !3) !1 = !DIFile(filename: "/home/espindola/llvm/test.c", directory: "/home/espindola/llvm/build") -!2 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: true, emissionKind: 0, file: !6, enums: !{}, retainedTypes: !{}, subprograms: !5) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: true, emissionKind: 0, file: !6, enums: !{}, retainedTypes: !{}, subprograms: !5) !3 = !DISubroutineType(types: !4) !4 = !{null} !6 = !DIFile(filename: "/home/espindola/llvm/test.c", directory: "/home/espindola/llvm/build") diff --git a/test/DebugInfo/X86/debugger-tune.ll b/test/DebugInfo/X86/debugger-tune.ll new file mode 100644 index 000000000000..b685612d4a47 --- /dev/null +++ b/test/DebugInfo/X86/debugger-tune.ll @@ -0,0 +1,44 @@ +; Verify target-based defaults for "debugger tuning," and the ability to +; override defaults. +; We use existence of the debug_pubnames section to distinguish the GDB case, +; and the apple_names section to distinguish the LLDB case. SCE has neither. + +; Verify defaults for various targets. +; RUN: llc -mtriple=x86_64-scei-ps4 -filetype=obj < %s | llvm-readobj -sections - | FileCheck --check-prefix=SCE %s +; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj < %s | llvm-readobj -sections - | FileCheck --check-prefix=LLDB %s +; RUN: llc -mtriple=x86_64-pc-freebsd -filetype=obj < %s | llvm-readobj -sections - | FileCheck --check-prefix=LLDB %s +; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj < %s | llvm-readobj -sections - | FileCheck --check-prefix=GDB %s + +; We can override defaults. +; RUN: llc -mtriple=x86_64-scei-ps4 -filetype=obj -debugger-tune=gdb < %s | llvm-readobj -sections - | FileCheck --check-prefix=GDB %s +; RUN: llc -mtriple=x86_64-pc-linux -filetype=obj -debugger-tune=lldb < %s | llvm-readobj -sections - | FileCheck --check-prefix=LLDB %s +; RUN: llc -mtriple=x86_64-apple-darwin12 -filetype=obj -debugger-tune=sce < %s | llvm-readobj -sections - | FileCheck --check-prefix=SCE %s + + +; GDB-NOT: apple_names +; GDB: debug_pubnames +; GDB-NOT: apple_names + +; LLDB-NOT: debug_pubnames +; LLDB: apple_names +; LLDB-NOT: debug_pubnames + +; SCE-NOT: debug_pubnames +; SCE-NOT: apple_names + + +@globalvar = global i32 0, align 4 + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!6, !7} +!llvm.ident = !{!8} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 238808)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!1 = !DIFile(filename: "debugger-tune.cpp", directory: "/home/probinson/projects/scratch") +!2 = !{} +!3 = !{!4} +!4 = !DIGlobalVariable(name: "globalvar", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, variable: i32* @globalvar) +!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!6 = !{i32 2, !"Dwarf Version", i32 4} +!7 = !{i32 2, !"Debug Info Version", i32 3} +!8 = !{!"clang version 3.7.0 (trunk 238808)"} diff --git a/test/DebugInfo/X86/decl-derived-member.ll b/test/DebugInfo/X86/decl-derived-member.ll index 3b833580e9ca..5751f243521e 100644 --- a/test/DebugInfo/X86/decl-derived-member.ll +++ b/test/DebugInfo/X86/decl-derived-member.ll @@ -33,7 +33,7 @@ $_ZN4baseC2Ev = comdat any @_ZTV4base = external unnamed_addr constant [4 x i8*] @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_decl_derived_member.cpp, i8* null }] -define internal void @__cxx_global_var_init() section ".text.startup" { +define internal void @__cxx_global_var_init() section ".text.startup" !dbg !10 { entry: call void @_ZN3fooC2Ev(%struct.foo* @f) #2, !dbg !33 %0 = call i32 @__cxa_atexit(void (i8*)* bitcast (void (%struct.foo*)* @_ZN3fooD2Ev to void (i8*)*), i8* bitcast (%struct.foo* @f to i8*), i8* @__dso_handle) #2, !dbg !33 @@ -41,7 +41,7 @@ entry: } ; Function Attrs: inlinehint nounwind uwtable -define linkonce_odr void @_ZN3fooC2Ev(%struct.foo* %this) unnamed_addr #0 comdat align 2 { +define linkonce_odr void @_ZN3fooC2Ev(%struct.foo* %this) unnamed_addr #0 comdat align 2 !dbg !14 { entry: %this.addr = alloca %struct.foo*, align 8 store %struct.foo* %this, %struct.foo** %this.addr, align 8 @@ -53,7 +53,7 @@ entry: } ; Function Attrs: inlinehint uwtable -define linkonce_odr void @_ZN3fooD2Ev(%struct.foo* %this) unnamed_addr #1 comdat align 2 { +define linkonce_odr void @_ZN3fooD2Ev(%struct.foo* %this) unnamed_addr #1 comdat align 2 !dbg !24 { entry: %this.addr = alloca %struct.foo*, align 8 store %struct.foo* %this, %struct.foo** %this.addr, align 8 @@ -71,7 +71,7 @@ declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*) #2 declare void @llvm.dbg.declare(metadata, metadata, metadata) #3 ; Function Attrs: inlinehint nounwind uwtable -define linkonce_odr void @_ZN4baseC2Ev(%struct.base* %this) unnamed_addr #0 comdat align 2 { +define linkonce_odr void @_ZN4baseC2Ev(%struct.base* %this) unnamed_addr #0 comdat align 2 !dbg !19 { entry: %this.addr = alloca %struct.base*, align 8 store %struct.base* %this, %struct.base** %this.addr, align 8 @@ -100,7 +100,7 @@ attributes #4 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.module.flags = !{!30, !31} !llvm.ident = !{!32} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 (trunk 227104) (llvm/trunk 227103)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !28, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 (trunk 227104) (llvm/trunk 227103)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !28, imports: !2) !1 = !DIFile(filename: "decl-derived-member.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4, !8} @@ -110,23 +110,23 @@ attributes #4 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !7 = !DIDerivedType(tag: DW_TAG_typedef, name: "base_type", line: 4, file: !1, baseType: !"_ZTS4base") !8 = !DICompositeType(tag: DW_TAG_structure_type, name: "base", line: 1, flags: DIFlagFwdDecl, file: !1, identifier: "_ZTS4base") !9 = !{!10, !14, !19, !24, !26} -!10 = !DISubprogram(name: "__cxx_global_var_init", line: 8, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !11, type: !12, function: void ()* @__cxx_global_var_init, variables: !2) +!10 = distinct !DISubprogram(name: "__cxx_global_var_init", line: 8, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !11, type: !12, variables: !2) !11 = !DIFile(filename: "decl-derived-member.cpp", directory: "/tmp/dbginfo") !12 = !DISubroutineType(types: !13) !13 = !{null} -!14 = !DISubprogram(name: "foo", linkageName: "_ZN3fooC2Ev", line: 5, isLocal: false, isDefinition: true, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !"_ZTS3foo", type: !15, function: void (%struct.foo*)* @_ZN3fooC2Ev, declaration: !18, variables: !2) +!14 = distinct !DISubprogram(name: "foo", linkageName: "_ZN3fooC2Ev", line: 5, isLocal: false, isDefinition: true, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !"_ZTS3foo", type: !15, declaration: !18, variables: !2) !15 = !DISubroutineType(types: !16) !16 = !{null, !17} !17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS3foo") !18 = !DISubprogram(name: "foo", isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scope: !"_ZTS3foo", type: !15) -!19 = !DISubprogram(name: "base", linkageName: "_ZN4baseC2Ev", line: 1, isLocal: false, isDefinition: true, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !"_ZTS4base", type: !20, function: void (%struct.base*)* @_ZN4baseC2Ev, declaration: !23, variables: !2) +!19 = distinct !DISubprogram(name: "base", linkageName: "_ZN4baseC2Ev", line: 1, isLocal: false, isDefinition: true, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !"_ZTS4base", type: !20, declaration: !23, variables: !2) !20 = !DISubroutineType(types: !21) !21 = !{null, !22} !22 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS4base") !23 = !DISubprogram(name: "base", isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scope: !"_ZTS4base", type: !20) -!24 = !DISubprogram(name: "~foo", linkageName: "_ZN3fooD2Ev", line: 5, isLocal: false, isDefinition: true, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !"_ZTS3foo", type: !15, function: void (%struct.foo*)* @_ZN3fooD2Ev, declaration: !25, variables: !2) +!24 = distinct !DISubprogram(name: "~foo", linkageName: "_ZN3fooD2Ev", line: 5, isLocal: false, isDefinition: true, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !"_ZTS3foo", type: !15, declaration: !25, variables: !2) !25 = !DISubprogram(name: "~foo", isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scope: !"_ZTS3foo", type: !15) -!26 = !DISubprogram(name: "", linkageName: "_GLOBAL__sub_I_decl_derived_member.cpp", isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, file: !1, scope: !11, type: !27, function: void ()* @_GLOBAL__sub_I_decl_derived_member.cpp, variables: !2) +!26 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__sub_I_decl_derived_member.cpp", isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, file: !1, scope: !11, type: !27, variables: !2) !27 = !DISubroutineType(types: !2) !28 = !{!29} !29 = !DIGlobalVariable(name: "f", line: 8, isLocal: false, isDefinition: true, scope: null, file: !11, type: !"_ZTS3foo", variable: %struct.foo* @f) @@ -134,17 +134,17 @@ attributes #4 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !31 = !{i32 2, !"Debug Info Version", i32 3} !32 = !{!"clang version 3.7.0 (trunk 227104) (llvm/trunk 227103)"} !33 = !DILocation(line: 8, column: 5, scope: !10) -!34 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !14, type: !35) +!34 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !14, type: !35) !35 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS3foo") !36 = !DIExpression() !37 = !DILocation(line: 0, scope: !14) !38 = !DILocation(line: 5, column: 8, scope: !14) -!39 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !24, type: !35) +!39 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !24, type: !35) !40 = !DILocation(line: 0, scope: !24) !41 = !DILocation(line: 5, column: 8, scope: !42) !42 = distinct !DILexicalBlock(line: 5, column: 8, file: !1, scope: !24) !43 = !DILocation(line: 5, column: 8, scope: !24) -!44 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !19, type: !45) +!44 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !19, type: !45) !45 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS4base") !46 = !DILocation(line: 0, scope: !19) !47 = !DILocation(line: 1, column: 8, scope: !19) diff --git a/test/DebugInfo/X86/deleted-bit-piece.ll b/test/DebugInfo/X86/deleted-bit-piece.ll index 63f3be5ea41e..b069cf8e399c 100644 --- a/test/DebugInfo/X86/deleted-bit-piece.ll +++ b/test/DebugInfo/X86/deleted-bit-piece.ll @@ -9,7 +9,7 @@ target triple = "x86_64-apple-macosx10.8.0" ; CHECK: __Z3foov: ; CHECK: retq -define void @_Z3foov() { +define void @_Z3foov() !dbg !12 { entry: br i1 undef, label %exit, label %bb @@ -28,7 +28,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) !0 = !{i32 2, !"Dwarf Version", i32 2} !1 = !{i32 2, !"Debug Info Version", i32 3} -!2 = !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !4, retainedTypes: !5, subprograms: !11, globals: !4, imports: !4) +!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !4, retainedTypes: !5, subprograms: !11, globals: !4, imports: !4) !3 = !DIFile(filename: "foo.cpp", directory: "/path/to/dir") !4 = !{} !5 = !{!6} @@ -38,9 +38,9 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) !9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !"_ZT5Class", baseType: !9, size: 32, align: 32) !11 = !{!12} -!12 = !DISubprogram(name: "foo", scope: null, file: !3, type: !13, isLocal: false, isDefinition: true, isOptimized: false, function: void ()* @_Z3foov) +!12 = distinct !DISubprogram(name: "foo", scope: null, file: !3, type: !13, isLocal: false, isDefinition: true, isOptimized: false) !13 = !DISubroutineType(types: !14) !14 = !{null} -!15 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "v", scope: !12, type: !"_ZT5Class") +!15 = !DILocalVariable(name: "v", scope: !12, type: !"_ZT5Class") !16 = !DIExpression(DW_OP_bit_piece, 32, 32) !17 = !DILocation(line: 2755, column: 9, scope: !12) diff --git a/test/DebugInfo/X86/discriminator.ll b/test/DebugInfo/X86/discriminator.ll index da5acc753c48..e9d8fa58c60d 100644 --- a/test/DebugInfo/X86/discriminator.ll +++ b/test/DebugInfo/X86/discriminator.ll @@ -11,7 +11,7 @@ ; Manually generated debug nodes !14 and !15 to incorporate an ; arbitrary discriminator with value 42. -define i32 @foo(i32 %i) #0 { +define i32 @foo(i32 %i) #0 !dbg !4 { entry: %retval = alloca i32, align 4 %i.addr = alloca i32, align 4 @@ -41,11 +41,11 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "discriminator.c", directory: ".") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i32)* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "discriminator.c", directory: ".") !6 = !DISubroutineType(types: !2) !7 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/DebugInfo/X86/dw_op_minus.ll b/test/DebugInfo/X86/dw_op_minus.ll new file mode 100644 index 000000000000..1c486e06c513 --- /dev/null +++ b/test/DebugInfo/X86/dw_op_minus.ll @@ -0,0 +1,84 @@ +; Test dwarf codegen of DW_OP_minus. +; RUN: llc -O0 -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s + +; This was built by compiling the following source with SafeStack and +; simplifying the result a little. +; extern "C" { +; void Capture(int *); +; void f() { +; int buf[100]; +; Capture(buf); +; } +; } +; The interesting part is !DIExpression(DW_OP_deref, DW_OP_minus, 400) + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@__safestack_unsafe_stack_ptr = external thread_local(initialexec) global i8* + +define void @f() !dbg !4 { +entry: + %unsafe_stack_ptr = load i8*, i8** @__safestack_unsafe_stack_ptr + %unsafe_stack_static_top = getelementptr i8, i8* %unsafe_stack_ptr, i32 -400 + store i8* %unsafe_stack_static_top, i8** @__safestack_unsafe_stack_ptr + %0 = getelementptr i8, i8* %unsafe_stack_ptr, i32 -400 + %buf = bitcast i8* %0 to [100 x i32]* + %1 = bitcast [100 x i32]* %buf to i8*, !dbg !16 + call void @llvm.dbg.declare(metadata i8* %unsafe_stack_ptr, metadata !8, metadata !17), !dbg !18 + %arraydecay = getelementptr inbounds [100 x i32], [100 x i32]* %buf, i64 0, i64 0, !dbg !19 + call void @Capture(i32* %arraydecay), !dbg !20 + store i8* %unsafe_stack_ptr, i8** @__safestack_unsafe_stack_ptr, !dbg !21 + ret void, !dbg !21 +} + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone + +declare void @Capture(i32*) + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!13, !14} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 248518) (llvm/trunk 248512)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3) +!1 = !DIFile(filename: "1.cc", directory: "/tmp") +!2 = !{} +!3 = !{!4} +!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 4, type: !5, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, variables: !7) +!5 = !DISubroutineType(types: !6) +!6 = !{null} +!7 = !{!8} +!8 = !DILocalVariable(name: "buf", scope: !4, file: !1, line: 5, type: !9) +!9 = !DICompositeType(tag: DW_TAG_array_type, baseType: !10, size: 3200, align: 32, elements: !11) +!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!11 = !{!12} +!12 = !DISubrange(count: 100) +!13 = !{i32 2, !"Dwarf Version", i32 4} +!14 = !{i32 2, !"Debug Info Version", i32 3} +!15 = !{!"clang version 3.8.0 (trunk 248518) (llvm/trunk 248512)"} +!16 = !DILocation(line: 5, column: 3, scope: !4) +!17 = !DIExpression(DW_OP_deref, DW_OP_minus, 400) +!18 = !DILocation(line: 5, column: 7, scope: !4) +!19 = !DILocation(line: 6, column: 11, scope: !4) +!20 = !DILocation(line: 6, column: 3, scope: !4) +!21 = !DILocation(line: 7, column: 1, scope: !4) + +; RCX - 400 +; CHECK: .short 6 # Loc expr size +; CHECK-NEXT: .byte 114 # DW_OP_breg2 +; CHECK-NEXT: .byte 0 # 0 +; CHECK-NEXT: .byte 16 # DW_OP_constu +; CHECK-NEXT: .byte 144 # 400 +; CHECK-NEXT: .byte 3 # DW_OP_minus +; CHECK-NEXT: .byte 28 + +; RCX is clobbered in call @Capture, but there is a spilled copy. +; *(RSP + 8) - 400 +; CHECK: .short 7 # Loc expr size +; CHECK-NEXT: .byte 119 # DW_OP_breg7 +; CHECK-NEXT: .byte 8 # 8 +; CHECK-NEXT: .byte 6 # DW_OP_deref +; CHECK-NEXT: .byte 16 # DW_OP_constu +; CHECK-NEXT: .byte 144 # 400 +; CHECK-NEXT: .byte 3 # DW_OP_minus +; CHECK-NEXT: .byte 28 diff --git a/test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll b/test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll index aae155414bd8..be0d89433e7c 100644 --- a/test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll +++ b/test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll @@ -26,21 +26,21 @@ target triple = "x86_64-unknown-linux-gnu" @global = global i32 2, align 4 ; Function Attrs: nounwind readnone uwtable -define i32 @_Z3fooi(i32 %bar) #0 { +define i32 @_Z3fooi(i32 %bar) #0 !dbg !4 { entry: tail call void @llvm.dbg.value(metadata i32 %bar, i64 0, metadata !10, metadata !DIExpression()), !dbg !20 ret i32 %bar, !dbg !20 } ; Function Attrs: nounwind readnone uwtable -define i32 @_Z4foo2i(i32 %bar2) #0 { +define i32 @_Z4foo2i(i32 %bar2) #0 !dbg !11 { entry: tail call void @llvm.dbg.value(metadata i32 %bar2, i64 0, metadata !13, metadata !DIExpression()), !dbg !21 ret i32 %bar2, !dbg !21 } ; Function Attrs: nounwind readonly uwtable -define i32 @main() #1 { +define i32 @main() #1 !dbg !14 { entry: %call = tail call i32 @_Z3fooi(i32 2), !dbg !22 %call1 = tail call i32 @_Z4foo2i(i32 1), !dbg !22 @@ -60,21 +60,21 @@ attributes #2 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!19, !26} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (191881)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !17, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (191881)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !17, imports: !2) !1 = !DIFile(filename: "tmp/debug_ranges/a.cc", directory: "/") !2 = !{} !3 = !{!4, !11, !14} -!4 = !DISubprogram(name: "foo", linkageName: "_Z3fooi", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !5, type: !6, function: i32 (i32)* @_Z3fooi, variables: !9) +!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !9) !5 = !DIFile(filename: "tmp/debug_ranges/a.cc", directory: "/") !6 = !DISubroutineType(types: !7) !7 = !{!8, !8} !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !9 = !{!10} -!10 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "bar", line: 2, arg: 1, scope: !4, file: !5, type: !8) -!11 = !DISubprogram(name: "foo2", linkageName: "_Z4foo2i", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, function: i32 (i32)* @_Z4foo2i, variables: !12) +!10 = !DILocalVariable(name: "bar", line: 2, arg: 1, scope: !4, file: !5, type: !8) +!11 = distinct !DISubprogram(name: "foo2", linkageName: "_Z4foo2i", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !12) !12 = !{!13} -!13 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "bar2", line: 3, arg: 1, scope: !11, file: !5, type: !8) -!14 = !DISubprogram(name: "main", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !15, function: i32 ()* @main, variables: !2) +!13 = !DILocalVariable(name: "bar2", line: 3, arg: 1, scope: !11, file: !5, type: !8) +!14 = distinct !DISubprogram(name: "main", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !15, variables: !2) !15 = !DISubroutineType(types: !16) !16 = !{!8} !17 = !{!18} diff --git a/test/DebugInfo/X86/dwarf-aranges.ll b/test/DebugInfo/X86/dwarf-aranges.ll index 9924697247b3..cb2e87881286 100644 --- a/test/DebugInfo/X86/dwarf-aranges.ll +++ b/test/DebugInfo/X86/dwarf-aranges.ll @@ -48,7 +48,7 @@ target triple = "x86_64-unknown-linux-gnu" @some_other = global i32 5, section "strange+section", align 4 @some_bss = common global i32 0, align 4 -define void @some_code() { +define void @some_code() !dbg !4 { entry: %0 = load i32, i32* @some_data, align 4, !dbg !14 %1 = load i32, i32* @some_other, align 4, !dbg !14 @@ -62,11 +62,11 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!13, !16} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !8, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !8, imports: !2) !1 = !DIFile(filename: "test.c", directory: "/home/kayamon") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "some_code", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, function: void ()* @some_code, variables: !2) +!4 = distinct !DISubprogram(name: "some_code", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "test.c", directory: "/home/kayamon") !6 = !DISubroutineType(types: !7) !7 = !{null} diff --git a/test/DebugInfo/X86/dwarf-linkage-names.ll b/test/DebugInfo/X86/dwarf-linkage-names.ll new file mode 100644 index 000000000000..65cf1914dd40 --- /dev/null +++ b/test/DebugInfo/X86/dwarf-linkage-names.ll @@ -0,0 +1,71 @@ +; DWARF linkage name attributes are optional; verify they are missing for +; PS4 triple or when tuning for SCE. + +; RUN: llc -O0 -mtriple=x86_64-unknown-unknown < %s | FileCheck %s -check-prefix LINKAGE1 +; RUN: llc -O0 -mtriple=x86_64-unknown-unknown < %s | FileCheck %s -check-prefix LINKAGE2 +; RUN: llc -O0 -mtriple=x86_64-scei-ps4 < %s | FileCheck %s -check-prefix NOLINKAGE +; RUN: llc -O0 -mtriple=x86_64-unknown-unknown -debugger-tune=sce < %s | FileCheck %s -check-prefix NOLINKAGE + +; $ clang++ -emit-llvm -S -g dwarf-linkage-names.cpp +; namespace test { +; int global_var; +; int bar() { return global_var; } +;}; + +; With linkage names, we get an attribute for the declaration (first) entry +; for the global variable, and one for the function. + +; This assumes the variable will appear before the function. +; LINKAGE1: .section .debug_info +; LINKAGE1: DW_TAG_variable +; LINKAGE1-NOT: DW_TAG +; LINKAGE1: {{DW_AT_(MIPS_)?linkage_name}} +; LINKAGE1: DW_TAG_subprogram +; LINKAGE1-NOT: DW_TAG +; LINKAGE1: {{DW_AT_(MIPS_)?linkage_name}} +; LINKAGE1: .section + +; Also verify we see the mangled names. We do this as a separate pass to +; avoid depending on the order of .debug_info and .debug_str sections. + +; LINKAGE2-DAG: .asciz "_ZN4test10global_varE" +; LINKAGE2-DAG: .asciz "_ZN4test3barEv" + +; Without linkage names, verify there aren't any linkage-name attributes, +; and no mangled names. + +; NOLINKAGE-NOT: {{DW_AT_(MIPS_)?linkage_name}} +; NOLINKAGE-NOT: .asciz "_ZN4test10global_varE" +; NOLINKAGE-NOT: .asciz "_ZN4test3barEv" + +@_ZN4test10global_varE = global i32 0, align 4 + +; Function Attrs: nounwind uwtable +define i32 @_ZN4test3barEv() #0 !dbg !4 { +entry: + %0 = load i32, i32* @_ZN4test10global_varE, align 4, !dbg !14 + ret i32 %0, !dbg !15 +} + +attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!11, !12} +!llvm.ident = !{!13} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 244662)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3, globals: !9) +!1 = !DIFile(filename: "dwarf-linkage-names.cpp", directory: "/home/probinson/projects/scratch") +!2 = !{} +!3 = !{!4} +!4 = distinct !DISubprogram(name: "bar", linkageName: "_ZN4test3barEv", scope: !5, file: !1, line: 3, type: !6, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, variables: !2) +!5 = !DINamespace(name: "test", scope: null, file: !1, line: 1) +!6 = !DISubroutineType(types: !7) +!7 = !{!8} +!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !{!10} +!10 = !DIGlobalVariable(name: "global_var", linkageName: "_ZN4test10global_varE", scope: !5, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, variable: i32* @_ZN4test10global_varE) +!11 = !{i32 2, !"Dwarf Version", i32 4} +!12 = !{i32 2, !"Debug Info Version", i32 3} +!13 = !{!"clang version 3.8.0 (trunk 244662)"} +!14 = !DILocation(line: 3, column: 21, scope: !4) +!15 = !DILocation(line: 3, column: 14, scope: !4) diff --git a/test/DebugInfo/X86/dwarf-public-names.ll b/test/DebugInfo/X86/dwarf-public-names.ll index c72da38832ee..d850899ce85a 100644 --- a/test/DebugInfo/X86/dwarf-public-names.ll +++ b/test/DebugInfo/X86/dwarf-public-names.ll @@ -43,7 +43,7 @@ ; Skip the output to the header of the pubnames section. ; LINUX: debug_pubnames -; LINUX-NEXT: unit_size = 0x00000128 +; LINUX-NEXT: unit_size = 0x0000012a ; Check for each name in the output. ; LINUX-DAG: "ns" @@ -61,7 +61,7 @@ @global_variable = global %struct.C zeroinitializer, align 1 @_ZN2ns25global_namespace_variableE = global i32 1, align 4 -define void @_ZN1C15member_functionEv(%struct.C* %this) nounwind uwtable align 2 { +define void @_ZN1C15member_functionEv(%struct.C* %this) nounwind uwtable align 2 !dbg !3 { entry: %this.addr = alloca %struct.C*, align 8 store %struct.C* %this, %struct.C** %this.addr, align 8 @@ -73,18 +73,18 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone -define i32 @_ZN1C22static_member_functionEv() nounwind uwtable align 2 { +define i32 @_ZN1C22static_member_functionEv() nounwind uwtable align 2 !dbg !18 { entry: %0 = load i32, i32* @_ZN1C22static_member_variableE, align 4, !dbg !33 ret i32 %0, !dbg !33 } -define i32 @_Z15global_functionv() nounwind uwtable { +define i32 @_Z15global_functionv() nounwind uwtable !dbg !19 { entry: ret i32 -1, !dbg !34 } -define void @_ZN2ns25global_namespace_functionEv() nounwind uwtable { +define void @_ZN2ns25global_namespace_functionEv() nounwind uwtable !dbg !20 { entry: call void @_ZN1C15member_functionEv(%struct.C* @global_variable), !dbg !35 ret void, !dbg !36 @@ -96,10 +96,10 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!38} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (http://llvm.org/git/clang.git a09cd8103a6a719cb2628cdf0c91682250a17bd2) (http://llvm.org/git/llvm.git 47d03cec0afca0c01ae42b82916d1d731716cd20)", isOptimized: false, emissionKind: 0, file: !37, enums: !1, retainedTypes: !1, subprograms: !2, globals: !24, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (http://llvm.org/git/clang.git a09cd8103a6a719cb2628cdf0c91682250a17bd2) (http://llvm.org/git/llvm.git 47d03cec0afca0c01ae42b82916d1d731716cd20)", isOptimized: false, emissionKind: 0, file: !37, enums: !1, retainedTypes: !1, subprograms: !2, globals: !24, imports: !1) !1 = !{} !2 = !{!3, !18, !19, !20} -!3 = !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 9, file: !4, scope: null, type: !5, function: void (%struct.C*)* @_ZN1C15member_functionEv, declaration: !12, variables: !1) +!3 = distinct !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 9, file: !4, scope: null, type: !5, declaration: !12, variables: !1) !4 = !DIFile(filename: "dwarf-public-names.cpp", directory: "/usr2/kparzysz/s.hex/t") !5 = !DISubroutineType(types: !6) !6 = !{null, !7} @@ -114,9 +114,9 @@ attributes #1 = { nounwind readnone } !15 = !DISubroutineType(types: !16) !16 = !{!11} !17 = !{} ; previously: invalid DW_TAG_base_type -!18 = !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 13, file: !4, scope: null, type: !15, function: i32 ()* @_ZN1C22static_member_functionEv, declaration: !14, variables: !1) -!19 = !DISubprogram(name: "global_function", linkageName: "_Z15global_functionv", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 19, file: !4, scope: !4, type: !15, function: i32 ()* @_Z15global_functionv, variables: !1) -!20 = !DISubprogram(name: "global_namespace_function", linkageName: "_ZN2ns25global_namespace_functionEv", line: 24, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 24, file: !4, scope: !21, type: !22, function: void ()* @_ZN2ns25global_namespace_functionEv, variables: !1) +!18 = distinct !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 13, file: !4, scope: null, type: !15, declaration: !14, variables: !1) +!19 = distinct !DISubprogram(name: "global_function", linkageName: "_Z15global_functionv", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 19, file: !4, scope: !4, type: !15, variables: !1) +!20 = distinct !DISubprogram(name: "global_namespace_function", linkageName: "_ZN2ns25global_namespace_functionEv", line: 24, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 24, file: !4, scope: !21, type: !22, variables: !1) !21 = !DINamespace(name: "ns", line: 23, file: !4, scope: null) !22 = !DISubroutineType(types: !23) !23 = !{null} @@ -124,7 +124,7 @@ attributes #1 = { nounwind readnone } !25 = !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", line: 7, isLocal: false, isDefinition: true, scope: !8, file: !4, type: !11, variable: i32* @_ZN1C22static_member_variableE, declaration: !10) !26 = !DIGlobalVariable(name: "global_variable", line: 17, isLocal: false, isDefinition: true, scope: null, file: !4, type: !8, variable: %struct.C* @global_variable) !27 = !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", line: 27, isLocal: false, isDefinition: true, scope: !21, file: !4, type: !11, variable: i32* @_ZN2ns25global_namespace_variableE) -!28 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 9, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !3, file: !4, type: !29) +!28 = !DILocalVariable(name: "this", line: 9, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !3, file: !4, type: !29) !29 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !8) !30 = !DILocation(line: 9, scope: !3) !31 = !DILocation(line: 10, scope: !3) diff --git a/test/DebugInfo/X86/dwarf-pubnames-split.ll b/test/DebugInfo/X86/dwarf-pubnames-split.ll index f17f7848f046..a8e4cc6e433a 100644 --- a/test/DebugInfo/X86/dwarf-pubnames-split.ll +++ b/test/DebugInfo/X86/dwarf-pubnames-split.ll @@ -12,7 +12,7 @@ ; CHECK-NEXT: .long .Lcu_begin0 # Offset of Compilation Unit Info ; Function Attrs: nounwind uwtable -define i32 @main() #0 { +define i32 @main() #0 !dbg !4 { entry: %retval = alloca i32, align 4 store i32 0, i32* %retval @@ -24,11 +24,11 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!9, !11} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 189287) (llvm/trunk 189296)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 189287) (llvm/trunk 189296)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/echristo/tmp") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/echristo/tmp") !6 = !DISubroutineType(types: !7) !7 = !{!8} diff --git a/test/DebugInfo/X86/earlydup-crash.ll b/test/DebugInfo/X86/earlydup-crash.ll index 738b7194488f..73626597d23b 100644 --- a/test/DebugInfo/X86/earlydup-crash.ll +++ b/test/DebugInfo/X86/earlydup-crash.ll @@ -6,7 +6,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone -define internal i8* @framework_construct_pathname(i8* %fname, %struct.cpp_dir* %dir) nounwind ssp { +define internal i8* @framework_construct_pathname(i8* %fname, %struct.cpp_dir* %dir) nounwind ssp !dbg !2 { entry: br i1 undef, label %bb33, label %bb @@ -44,11 +44,11 @@ declare void @foobar(i32) !llvm.dbg.cu = !{!4} !llvm.module.flags = !{!47} -!0 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "frname_len", line: 517, scope: !1, file: !3, type: !38) +!0 = !DILocalVariable(name: "frname_len", line: 517, scope: !1, file: !3, type: !38) !1 = distinct !DILexicalBlock(line: 515, column: 0, file: !44, scope: !2) -!2 = !DISubprogram(name: "framework_construct_pathname", line: 515, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !44, scope: null, type: !5, function: i8* (i8*, %struct.cpp_dir*)* @framework_construct_pathname) +!2 = distinct !DISubprogram(name: "framework_construct_pathname", line: 515, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, file: !44, scope: null, type: !5) !3 = !DIFile(filename: "darwin-c.c", directory: "/Users/espindola/llvm/build-llvm-gcc/gcc/../../llvm-gcc-4.2/gcc/config") -!4 = !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !44, enums: !46, retainedTypes: !46, subprograms: !45) +!4 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !44, enums: !46, retainedTypes: !46, subprograms: !45) !5 = !DISubroutineType(types: !6) !6 = !{!7, !9, !11} !7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !44, scope: !3, baseType: !8) diff --git a/test/DebugInfo/X86/elf-names.ll b/test/DebugInfo/X86/elf-names.ll index e4565c27cf72..2c8571927627 100644 --- a/test/DebugInfo/X86/elf-names.ll +++ b/test/DebugInfo/X86/elf-names.ll @@ -17,10 +17,10 @@ %class.D = type { i32, i32, i32, i32 } -@_ZN1DC1Ev = alias void (%class.D*)* @_ZN1DC2Ev -@_ZN1DC1ERKS_ = alias void (%class.D*, %class.D*)* @_ZN1DC2ERKS_ +@_ZN1DC1Ev = alias void (%class.D*), void (%class.D*)* @_ZN1DC2Ev +@_ZN1DC1ERKS_ = alias void (%class.D*, %class.D*), void (%class.D*, %class.D*)* @_ZN1DC2ERKS_ -define void @_ZN1DC2Ev(%class.D* nocapture %this) unnamed_addr nounwind uwtable align 2 { +define void @_ZN1DC2Ev(%class.D* nocapture %this) unnamed_addr nounwind uwtable align 2 !dbg !5 { entry: tail call void @llvm.dbg.value(metadata %class.D* %this, i64 0, metadata !29, metadata !DIExpression()), !dbg !36 %c1 = getelementptr inbounds %class.D, %class.D* %this, i64 0, i32 0, !dbg !37 @@ -34,7 +34,7 @@ entry: ret void, !dbg !45 } -define void @_ZN1DC2ERKS_(%class.D* nocapture %this, %class.D* nocapture %d) unnamed_addr nounwind uwtable align 2 { +define void @_ZN1DC2ERKS_(%class.D* nocapture %this, %class.D* nocapture %d) unnamed_addr nounwind uwtable align 2 !dbg !31 { entry: tail call void @llvm.dbg.value(metadata %class.D* %this, i64 0, metadata !34, metadata !DIExpression()), !dbg !46 tail call void @llvm.dbg.value(metadata %class.D* %d, i64 0, metadata !35, metadata !DIExpression()), !dbg !46 @@ -62,10 +62,10 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!54} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 167506) (llvm/trunk 167505)", isOptimized: true, emissionKind: 0, file: !53, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 167506) (llvm/trunk 167505)", isOptimized: true, emissionKind: 0, file: !53, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5, !31} -!5 = !DISubprogram(name: "D", linkageName: "_ZN1DC2Ev", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 12, file: !6, scope: null, type: !7, function: void (%class.D*)* @_ZN1DC2Ev, declaration: !17, variables: !27) +!5 = distinct !DISubprogram(name: "D", linkageName: "_ZN1DC2Ev", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 12, file: !6, scope: null, type: !7, declaration: !17, variables: !27) !6 = !DIFile(filename: "foo.cpp", directory: "/usr/local/google/home/echristo") !7 = !DISubroutineType(types: !8) !8 = !{null, !9} @@ -84,12 +84,12 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !23 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !24) !24 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !10) !27 = !{!29} -!29 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 12, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !5, file: !6, type: !30) +!29 = !DILocalVariable(name: "this", line: 12, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !5, file: !6, type: !30) !30 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !10) -!31 = !DISubprogram(name: "D", linkageName: "_ZN1DC2ERKS_", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 19, file: !6, scope: null, type: !21, function: void (%class.D*, %class.D*)* @_ZN1DC2ERKS_, declaration: !20, variables: !32) +!31 = distinct !DISubprogram(name: "D", linkageName: "_ZN1DC2ERKS_", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 19, file: !6, scope: null, type: !21, declaration: !20, variables: !32) !32 = !{!34, !35} -!34 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 19, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !31, file: !6, type: !30) -!35 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "d", line: 19, arg: 2, scope: !31, file: !6, type: !23) +!34 = !DILocalVariable(name: "this", line: 19, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !31, file: !6, type: !30) +!35 = !DILocalVariable(name: "d", line: 19, arg: 2, scope: !31, file: !6, type: !23) !36 = !DILocation(line: 12, scope: !5) !37 = !DILocation(line: 13, scope: !38) !38 = distinct !DILexicalBlock(line: 12, column: 0, file: !6, scope: !5) diff --git a/test/DebugInfo/X86/empty-and-one-elem-array.ll b/test/DebugInfo/X86/empty-and-one-elem-array.ll index 1250b9c64412..550a231f7699 100644 --- a/test/DebugInfo/X86/empty-and-one-elem-array.ll +++ b/test/DebugInfo/X86/empty-and-one-elem-array.ll @@ -5,7 +5,7 @@ %struct.foo = type { i32, [1 x i32] } %struct.bar = type { i32, [0 x i32] } -define i32 @func() nounwind uwtable ssp { +define i32 @func() nounwind uwtable ssp !dbg !5 { entry: %my_foo = alloca %struct.foo, align 4 %my_bar = alloca %struct.bar, align 4 @@ -63,15 +63,15 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!33} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: 0, file: !32, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: 0, file: !32, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "func", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 11, file: !6, scope: !6, type: !7, function: i32 ()* @func, variables: !1) +!5 = distinct !DISubprogram(name: "func", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 11, file: !6, scope: !6, type: !7, variables: !1) !6 = !DIFile(filename: "test.c", directory: "/Volumes/Sandbox/llvm") !7 = !DISubroutineType(types: !8) !8 = !{!9} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "my_foo", line: 12, scope: !11, file: !6, type: !12) +!10 = !DILocalVariable(name: "my_foo", line: 12, scope: !11, file: !6, type: !12) !11 = distinct !DILexicalBlock(line: 11, column: 0, file: !6, scope: !5) !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", line: 1, size: 64, align: 32, file: !32, elements: !13) !13 = !{!14, !15} @@ -81,7 +81,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !17 = !{!18} !18 = !DISubrange(count: 1) !19 = !DILocation(line: 12, scope: !11) -!20 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "my_bar", line: 13, scope: !11, file: !6, type: !21) +!20 = !DILocalVariable(name: "my_bar", line: 13, scope: !11, file: !6, type: !21) !21 = !DICompositeType(tag: DW_TAG_structure_type, name: "bar", line: 6, size: 32, align: 32, file: !32, elements: !22) !22 = !{!23, !24} !23 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 7, size: 32, align: 32, file: !32, scope: !21, baseType: !9) diff --git a/test/DebugInfo/X86/empty-array.ll b/test/DebugInfo/X86/empty-array.ll index ce460a783c05..bad080cb7254 100644 --- a/test/DebugInfo/X86/empty-array.ll +++ b/test/DebugInfo/X86/empty-array.ll @@ -27,7 +27,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!21} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: 0, file: !20, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: 0, file: !20, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) !1 = !{} !3 = !{!5} !5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %class.A* @a) diff --git a/test/DebugInfo/X86/empty.ll b/test/DebugInfo/X86/empty.ll index 1f48a2f21246..695e9ca6ed3f 100644 --- a/test/DebugInfo/X86/empty.ll +++ b/test/DebugInfo/X86/empty.ll @@ -19,7 +19,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!5} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143523)", isOptimized: true, emissionKind: 0, file: !4, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143523)", isOptimized: true, emissionKind: 0, file: !4, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2) !2 = !{} !3 = !DIFile(filename: "empty.c", directory: "/home/nlewycky") !4 = !DIFile(filename: "empty.c", directory: "/home/nlewycky") diff --git a/test/DebugInfo/X86/ending-run.ll b/test/DebugInfo/X86/ending-run.ll index 9e3584615df2..efb85aad73b6 100644 --- a/test/DebugInfo/X86/ending-run.ll +++ b/test/DebugInfo/X86/ending-run.ll @@ -8,7 +8,7 @@ ; CHECK: 0x0000000000000000 7 0 1 0 ; CHECK: 0x0000000000000004 8 18 1 0 0 is_stmt prologue_end -define i32 @callee(i32 %x) nounwind uwtable ssp { +define i32 @callee(i32 %x) nounwind uwtable ssp !dbg !5 { entry: %x.addr = alloca i32, align 4 %y = alloca i32, align 4 @@ -29,17 +29,17 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!20} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 153921) (llvm/trunk 153916)", isOptimized: false, emissionKind: 0, file: !19, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 153921) (llvm/trunk 153916)", isOptimized: false, emissionKind: 0, file: !19, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "callee", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !19, scope: !6, type: !7, function: i32 (i32)* @callee) +!5 = distinct !DISubprogram(name: "callee", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !19, scope: !6, type: !7) !6 = !DIFile(filename: "ending-run.c", directory: "/Users/echristo/tmp") !7 = !DISubroutineType(types: !8) !8 = !{!9, !9} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!12 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 5, arg: 1, scope: !5, file: !6, type: !9) +!12 = !DILocalVariable(name: "x", line: 5, arg: 1, scope: !5, file: !6, type: !9) !13 = !DILocation(line: 5, column: 5, scope: !5) -!14 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "y", line: 8, scope: !15, file: !6, type: !9) +!14 = !DILocalVariable(name: "y", line: 8, scope: !15, file: !6, type: !9) !15 = distinct !DILexicalBlock(line: 7, column: 1, file: !19, scope: !5) !16 = !DILocation(line: 8, column: 9, scope: !15) !17 = !DILocation(line: 8, column: 18, scope: !15) diff --git a/test/DebugInfo/X86/enum-class.ll b/test/DebugInfo/X86/enum-class.ll index 57b2aa404cbb..fda0b4943a9d 100644 --- a/test/DebugInfo/X86/enum-class.ll +++ b/test/DebugInfo/X86/enum-class.ll @@ -8,7 +8,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!23} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 157269) (llvm/trunk 157264)", isOptimized: false, emissionKind: 0, file: !22, enums: !1, retainedTypes: !15, subprograms: !15, globals: !17, imports: !15) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 157269) (llvm/trunk 157264)", isOptimized: false, emissionKind: 0, file: !22, enums: !1, retainedTypes: !15, subprograms: !15, globals: !17, imports: !15) !1 = !{!3, !8, !12} !3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "A", line: 1, size: 32, align: 32, file: !4, baseType: !5, elements: !6) !4 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo/tmp") diff --git a/test/DebugInfo/X86/enum-fwd-decl.ll b/test/DebugInfo/X86/enum-fwd-decl.ll index f5deeb7d6712..ec862d10a704 100644 --- a/test/DebugInfo/X86/enum-fwd-decl.ll +++ b/test/DebugInfo/X86/enum-fwd-decl.ll @@ -6,7 +6,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!9} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 165274) (llvm/trunk 165272)", isOptimized: false, emissionKind: 0, file: !8, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 165274) (llvm/trunk 165272)", isOptimized: false, emissionKind: 0, file: !8, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) !1 = !{} !3 = !{!5} !5 = !DIGlobalVariable(name: "e", line: 2, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i16* @e) diff --git a/test/DebugInfo/X86/externaltyperef.ll b/test/DebugInfo/X86/externaltyperef.ll new file mode 100644 index 000000000000..c344d5f068c3 --- /dev/null +++ b/test/DebugInfo/X86/externaltyperef.ll @@ -0,0 +1,51 @@ +; REQUIRES: object-emission +; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s +; Manually derived by externalizing the composite types from: +; +; namespace N { class B; } +; using N::B; +; class A; +; A *a; +; +; Test the direct use of an external type. +; CHECK: DW_TAG_variable +; CHECK: DW_AT_type [DW_FORM_ref4] {{.*}}{[[PTR:.*]]} +; CHECK: [[PTR]]: DW_TAG_pointer_type +; CHECK: DW_AT_type [DW_FORM_ref4] {{.*}}{[[A:.*]]} +; CHECK: [[A]]: DW_TAG_class_type +; CHECK: DW_AT_declaration [DW_FORM_flag] (0x01) +; CHECK: DW_AT_signature [DW_FORM_ref_sig8] (0x4e834ea939695c24) +; CHECK: [[B:.*]]: DW_TAG_class_type +; CHECK: DW_AT_declaration [DW_FORM_flag] (0x01) +; CHECK: DW_AT_signature [DW_FORM_ref_sig8] (0x942e51c7addda5f7) +; CHECK: DW_TAG_imported_declaration +; CHECK: DW_AT_import [DW_FORM_ref4] {{.*}}[[B]] + +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.10.0" + +%class.A = type opaque + +@a = global %class.A* null, align 8 + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!13, !14, !15} +!llvm.ident = !{!16} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 242039) (llvm/trunk 242046)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, globals: !5, imports: !11) +!1 = !DIFile(filename: "test.cpp", directory: "/") +!2 = !{} +!3 = !{!4, !9} +!4 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !1, flags: DIFlagExternalTypeRef, identifier: "_ZTS1A") +!5 = !{!6} +!6 = !DIGlobalVariable(name: "a", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, variable: %class.A** @a) +!7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1A", size: 64, align: 64) +!8 = !DICompositeType(tag: DW_TAG_class_type, name: "B", file: !1, flags: DIFlagExternalTypeRef, identifier: "_ZTS1B") +!9 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !1, flags: DIFlagExternalTypeRef, identifier: "_ZTSN1N1BE") +!10 = !DINamespace(name: "N", scope: null, file: !1, line: 1) +!11 = !{!12} +!12 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !0, entity: !"_ZTSN1N1BE", line: 4) +!13 = !{i32 2, !"Dwarf Version", i32 2} +!14 = !{i32 2, !"Debug Info Version", i32 3} +!15 = !{i32 1, !"PIC Level", i32 2} +!16 = !{!"clang version 3.7.0 (trunk 242039) (llvm/trunk 242046)"} diff --git a/test/DebugInfo/X86/fission-cu.ll b/test/DebugInfo/X86/fission-cu.ll index 493f84283e2e..d52333ce6d97 100644 --- a/test/DebugInfo/X86/fission-cu.ll +++ b/test/DebugInfo/X86/fission-cu.ll @@ -8,7 +8,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!9} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)", isOptimized: false, splitDebugFilename: "baz.dwo", emissionKind: 0, file: !8, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)", isOptimized: false, splitDebugFilename: "baz.dwo", emissionKind: 0, file: !8, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) !1 = !{} !3 = !{!5} !5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i32* @a) diff --git a/test/DebugInfo/X86/fission-hash.ll b/test/DebugInfo/X86/fission-hash.ll index 74764416d748..84568a92e154 100644 --- a/test/DebugInfo/X86/fission-hash.ll +++ b/test/DebugInfo/X86/fission-hash.ll @@ -9,7 +9,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!3, !4} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 188230) (llvm/trunk 188234)", isOptimized: false, splitDebugFilename: "foo.dwo", emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 188230) (llvm/trunk 188234)", isOptimized: false, splitDebugFilename: "foo.dwo", emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2) !1 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/echristo/tmp") !2 = !{} !3 = !{i32 2, !"Dwarf Version", i32 3} diff --git a/test/DebugInfo/X86/fission-inline.ll b/test/DebugInfo/X86/fission-inline.ll index 53e782756ca8..af7dd95e5b84 100644 --- a/test/DebugInfo/X86/fission-inline.ll +++ b/test/DebugInfo/X86/fission-inline.ll @@ -75,7 +75,7 @@ ; RELOCS-NOT: RELOCATION RECORDS FOR [.rela.debug_ranges] ; Function Attrs: uwtable -define void @_ZN3foo2f3Ez(...) #0 align 2 { +define void @_ZN3foo2f3Ez(...) #0 align 2 !dbg !10 { entry: call void @_Z2f1v(), !dbg !26 call void @_Z2f1v(), !dbg !25 @@ -92,7 +92,7 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.module.flags = !{!22, !23} !llvm.ident = !{!24} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, splitDebugFilename: "fission-inline.dwo", emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !2, imports: !18) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, splitDebugFilename: "fission-inline.dwo", emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !2, imports: !18) !1 = !DIFile(filename: "fission-inline.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} @@ -102,8 +102,8 @@ attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !7 = !DISubroutineType(types: !8) !8 = !{null, null} !9 = !{!10, !11} -!10 = !DISubprogram(name: "f3", linkageName: "_ZN3foo2f3Ez", line: 15, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 15, file: !1, scope: !"_ZTS3foo", type: !7, function: void (...)* @_ZN3foo2f3Ez, declaration: !6, variables: !2) -!11 = !DISubprogram(name: "f2<int>", linkageName: "_ZN3foo2f2IiEEvv", line: 10, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !"_ZTS3foo", type: !12, templateParams: !14, declaration: !17, variables: !2) +!10 = distinct !DISubprogram(name: "f3", linkageName: "_ZN3foo2f3Ez", line: 15, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 15, file: !1, scope: !"_ZTS3foo", type: !7, declaration: !6, variables: !2) +!11 = distinct !DISubprogram(name: "f2<int>", linkageName: "_ZN3foo2f2IiEEvv", line: 10, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !"_ZTS3foo", type: !12, templateParams: !14, declaration: !17, variables: !2) !12 = !DISubroutineType(types: !13) !13 = !{null} !14 = !{!15} diff --git a/test/DebugInfo/X86/fission-ranges.ll b/test/DebugInfo/X86/fission-ranges.ll index e5eb25ce90c7..9c9fd7d6e6fe 100644 --- a/test/DebugInfo/X86/fission-ranges.ll +++ b/test/DebugInfo/X86/fission-ranges.ll @@ -29,16 +29,16 @@ ; CHECK-NEXT: Location description: 11 00 ; CHECK-NEXT: {{^$}} ; CHECK-NEXT: Beginning address index: 3 -; CHECK-NEXT: Length: 21 +; CHECK-NEXT: Length: 25 ; CHECK-NEXT: Location description: 50 93 04 ; CHECK: [[E]]: Beginning address index: 4 -; CHECK-NEXT: Length: 19 +; CHECK-NEXT: Length: 23 ; CHECK-NEXT: Location description: 50 93 04 ; CHECK: [[B]]: Beginning address index: 5 -; CHECK-NEXT: Length: 17 +; CHECK-NEXT: Length: 21 ; CHECK-NEXT: Location description: 50 93 04 ; CHECK: [[D]]: Beginning address index: 6 -; CHECK-NEXT: Length: 17 +; CHECK-NEXT: Length: 21 ; CHECK-NEXT: Location description: 50 93 04 ; Make sure we don't produce any relocations in any .dwo section (though in particular, debug_info.dwo) @@ -82,14 +82,14 @@ @c = external global i32 ; Function Attrs: nounwind uwtable -define void @bar() #0 { +define void @bar() #0 !dbg !4 { entry: tail call fastcc void @foo(), !dbg !27 ret void, !dbg !28 } ; Function Attrs: nounwind uwtable -define internal fastcc void @foo() #0 { +define internal fastcc void @foo() #0 !dbg !8 { entry: tail call void @llvm.dbg.value(metadata i32 1, i64 0, metadata !13, metadata !DIExpression()), !dbg !30 tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !14, metadata !DIExpression()), !dbg !31 @@ -153,26 +153,26 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!26, !43} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 191700) (llvm/trunk 191710)", isOptimized: true, splitDebugFilename: "small.dwo", emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 191700) (llvm/trunk 191710)", isOptimized: true, splitDebugFilename: "small.dwo", emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "small.c", directory: "/usr/local/google/home/echristo/tmp") !2 = !{} !3 = !{!4, !8} -!4 = !DISubprogram(name: "bar", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 19, file: !1, scope: !5, type: !6, function: void ()* @bar, variables: !2) +!4 = distinct !DISubprogram(name: "bar", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 19, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "small.c", directory: "/usr/local/google/home/echristo/tmp") !6 = !DISubroutineType(types: !7) !7 = !{null} -!8 = !DISubprogram(name: "foo", line: 2, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !9, function: void ()* @foo, variables: !12) +!8 = distinct !DISubprogram(name: "foo", line: 2, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !9, variables: !12) !9 = !DISubroutineType(types: !10) !10 = !{null, !11} !11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !12 = !{!13, !14, !15, !16, !18, !19} -!13 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "p", line: 2, arg: 1, scope: !8, file: !5, type: !11) -!14 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 4, scope: !8, file: !5, type: !11) -!15 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "b", line: 4, scope: !8, file: !5, type: !11) -!16 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "d", line: 5, scope: !8, file: !5, type: !17) +!13 = !DILocalVariable(name: "p", line: 2, arg: 1, scope: !8, file: !5, type: !11) +!14 = !DILocalVariable(name: "a", line: 4, scope: !8, file: !5, type: !11) +!15 = !DILocalVariable(name: "b", line: 4, scope: !8, file: !5, type: !11) +!16 = !DILocalVariable(name: "d", line: 5, scope: !8, file: !5, type: !17) !17 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) -!18 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "e", line: 5, scope: !8, file: !5, type: !17) -!19 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "w", line: 12, scope: !20, file: !5, type: !25) +!18 = !DILocalVariable(name: "e", line: 5, scope: !8, file: !5, type: !17) +!19 = !DILocalVariable(name: "w", line: 12, scope: !20, file: !5, type: !25) !20 = distinct !DILexicalBlock(line: 11, column: 0, file: !1, scope: !21) !21 = distinct !DILexicalBlock(line: 10, column: 0, file: !1, scope: !22) !22 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !23) diff --git a/test/DebugInfo/X86/float_const.ll b/test/DebugInfo/X86/float_const.ll index 6e99ffcc1f21..cd94f74dcbe3 100644 --- a/test/DebugInfo/X86/float_const.ll +++ b/test/DebugInfo/X86/float_const.ll @@ -8,7 +8,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.10.0" ; Function Attrs: nounwind optsize readnone uwtable -define void @foo() #0 { +define void @foo() #0 !dbg !7 { entry: tail call void @llvm.dbg.declare(metadata float* undef, metadata !13, metadata !19), !dbg !20 tail call void @llvm.dbg.value(metadata i32 1078523331, i64 0, metadata !13, metadata !19), !dbg !20 @@ -31,20 +31,20 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!15, !16, !17} !llvm.ident = !{!18} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 (trunk 227686)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !6, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 (trunk 227686)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !6, globals: !2, imports: !2) !1 = !DIFile(filename: "foo.c", directory: "") !2 = !{} !3 = !{!4} !4 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !5) !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !6 = !{!7} -!7 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, isOptimized: true, scopeLine: 1, file: !8, scope: !9, type: !10, function: void ()* @foo, variables: !12) +!7 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, isOptimized: true, scopeLine: 1, file: !8, scope: !9, type: !10, variables: !12) !8 = !DIFile(filename: "foo.c", directory: "") !9 = !DIFile(filename: "foo.c", directory: "") !10 = !DISubroutineType(types: !11) !11 = !{null} !12 = !{!13} -!13 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 2, scope: !7, file: !9, type: !14) +!13 = !DILocalVariable(name: "a", line: 2, scope: !7, file: !9, type: !14) !14 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float) !15 = !{i32 2, !"Dwarf Version", i32 2} !16 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/formal_parameter.ll b/test/DebugInfo/X86/formal_parameter.ll index e8a8b5f1803b..89be50bbd4a3 100644 --- a/test/DebugInfo/X86/formal_parameter.ll +++ b/test/DebugInfo/X86/formal_parameter.ll @@ -24,7 +24,7 @@ target triple = "x86_64-apple-macosx10.9.0" ; CHECK-NOT: DW_AT_name {{.*}}map ; Function Attrs: nounwind ssp uwtable -define void @foo(i32 %map) #0 { +define void @foo(i32 %map) #0 !dbg !4 { entry: %map.addr = alloca i32, align 4 store i32 %map, i32* %map.addr, align 4, !tbaa !15 @@ -59,17 +59,17 @@ attributes #3 = { nounwind } !llvm.module.flags = !{!11, !12} !llvm.ident = !{!13} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "formal_parameter.c", directory: "") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !5, type: !6, function: void (i32)* @foo, variables: !9) +!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !9) !5 = !DIFile(filename: "formal_parameter.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{null, !8} !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !9 = !{!10} -!10 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "map", line: 1, arg: 1, scope: !4, file: !5, type: !8) +!10 = !DILocalVariable(name: "map", line: 1, arg: 1, scope: !4, file: !5, type: !8) !11 = !{i32 2, !"Dwarf Version", i32 2} !12 = !{i32 1, !"Debug Info Version", i32 3} !13 = !{!"clang version 3.5.0 "} diff --git a/test/DebugInfo/X86/frame-register.ll b/test/DebugInfo/X86/frame-register.ll index bcf65a1a3853..e7f48597b348 100644 --- a/test/DebugInfo/X86/frame-register.ll +++ b/test/DebugInfo/X86/frame-register.ll @@ -14,7 +14,7 @@ declare i32 @foo(i32 %i) #0 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 ; Function Attrs: nounwind uwtable -define i32 @main() #0 { +define i32 @main() #0 !dbg !9 { entry: %retval = alloca i32, align 4 %i = alloca i32, align 4 @@ -33,27 +33,27 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!12, !13} !llvm.ident = !{!14} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "x.c", directory: "") !2 = !{} !3 = !{!4, !9} -!4 = !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: i32 (i32)* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "x.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{!8, !8} !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = !DISubprogram(name: "main", line: 8, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 9, file: !1, scope: !5, type: !10, function: i32 ()* @main, variables: !2) +!9 = distinct !DISubprogram(name: "main", line: 8, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 9, file: !1, scope: !5, type: !10, variables: !2) !10 = !DISubroutineType(types: !11) !11 = !{!8} !12 = !{i32 2, !"Dwarf Version", i32 4} !13 = !{i32 2, !"Debug Info Version", i32 3} !14 = !{!"clang version 3.7.0"} -!15 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 2, arg: 1, scope: !4, file: !5, type: !8) +!15 = !DILocalVariable(name: "i", line: 2, arg: 1, scope: !4, file: !5, type: !8) !16 = !DIExpression() !17 = !DILocation(line: 2, column: 10, scope: !4) !18 = !DILocation(line: 4, column: 10, scope: !4) !19 = !DILocation(line: 4, column: 3, scope: !4) -!20 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 10, scope: !9, file: !5, type: !8) +!20 = !DILocalVariable(name: "i", line: 10, scope: !9, file: !5, type: !8) !21 = !DILocation(line: 10, column: 7, scope: !9) !22 = !DILocation(line: 11, column: 15, scope: !9) !23 = !DILocation(line: 11, column: 10, scope: !9) diff --git a/test/DebugInfo/X86/generate-odr-hash.ll b/test/DebugInfo/X86/generate-odr-hash.ll index 7ac9a69181f3..51f33e2730ab 100644 --- a/test/DebugInfo/X86/generate-odr-hash.ll +++ b/test/DebugInfo/X86/generate-odr-hash.ll @@ -180,7 +180,7 @@ @llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @_GLOBAL__I_a }] ; Function Attrs: nounwind uwtable -define void @_Z3foov() #0 { +define void @_Z3foov() #0 !dbg !22 { entry: %b = alloca %struct.baz, align 1 call void @llvm.dbg.declare(metadata %struct.baz* %b, metadata !46, metadata !DIExpression()), !dbg !48 @@ -190,14 +190,14 @@ entry: ; Function Attrs: nounwind readnone declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 -define internal void @__cxx_global_var_init() section ".text.startup" { +define internal void @__cxx_global_var_init() section ".text.startup" !dbg !26 { entry: call void @_ZN12_GLOBAL__N_16walrusC2Ev(%"struct.<anonymous namespace>::walrus"* @w), !dbg !50 ret void, !dbg !50 } ; Function Attrs: nounwind uwtable -define internal void @_ZN12_GLOBAL__N_16walrusC2Ev(%"struct.<anonymous namespace>::walrus"* %this) unnamed_addr #0 align 2 { +define internal void @_ZN12_GLOBAL__N_16walrusC2Ev(%"struct.<anonymous namespace>::walrus"* %this) unnamed_addr #0 align 2 !dbg !27 { entry: %this.addr = alloca %"struct.<anonymous namespace>::walrus"*, align 8 store %"struct.<anonymous namespace>::walrus"* %this, %"struct.<anonymous namespace>::walrus"** %this.addr, align 8 @@ -206,7 +206,7 @@ entry: ret void, !dbg !54 } -define internal void @_GLOBAL__I_a() section ".text.startup" { +define internal void @_GLOBAL__I_a() section ".text.startup" !dbg !36 { entry: call void @__cxx_global_var_init(), !dbg !55 ret void, !dbg !55 @@ -219,7 +219,7 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!43, !44} !llvm.ident = !{!45} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, splitDebugFilename: "bar.dwo", emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !21, globals: !38, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, splitDebugFilename: "bar.dwo", emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !21, globals: !38, imports: !2) !1 = !DIFile(filename: "bar.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4, !6, !14, !17} @@ -241,12 +241,12 @@ attributes #1 = { nounwind readnone } !19 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 33, size: 32, align: 32, file: !1, scope: !"_ZTSN6wombatUt_E", baseType: !12) !20 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 34, size: 32, align: 32, offset: 32, file: !1, scope: !"_ZTSN6wombatUt_E", baseType: !12) !21 = !{!22, !26, !27, !36} -!22 = !DISubprogram(name: "foo", linkageName: "_Z3foov", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !23, type: !24, function: void ()* @_Z3foov, variables: !2) +!22 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !23, type: !24, variables: !2) !23 = !DIFile(filename: "bar.cpp", directory: "/tmp/dbginfo") !24 = !DISubroutineType(types: !25) !25 = !{null} -!26 = !DISubprogram(name: "__cxx_global_var_init", line: 29, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 29, file: !1, scope: !23, type: !24, function: void ()* @__cxx_global_var_init, variables: !2) -!27 = !DISubprogram(name: "walrus", linkageName: "_ZN12_GLOBAL__N_16walrusC2Ev", line: 25, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 25, file: !1, scope: !28, type: !32, function: void (%"struct.<anonymous namespace>::walrus"*)* @_ZN12_GLOBAL__N_16walrusC2Ev, declaration: !31, variables: !2) +!26 = distinct !DISubprogram(name: "__cxx_global_var_init", line: 29, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 29, file: !1, scope: !23, type: !24, variables: !2) +!27 = distinct !DISubprogram(name: "walrus", linkageName: "_ZN12_GLOBAL__N_16walrusC2Ev", line: 25, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 25, file: !1, scope: !28, type: !32, declaration: !31, variables: !2) !28 = !DICompositeType(tag: DW_TAG_structure_type, name: "walrus", line: 24, size: 8, align: 8, file: !1, scope: !29, elements: !30) !29 = !DINamespace(line: 23, file: !1, scope: null) !30 = !{!31} @@ -254,7 +254,7 @@ attributes #1 = { nounwind readnone } !32 = !DISubroutineType(types: !33) !33 = !{null, !34} !34 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !28) -!36 = !DISubprogram(name: "", linkageName: "_GLOBAL__I_a", line: 25, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagArtificial, isOptimized: false, scopeLine: 25, file: !1, scope: !23, type: !37, function: void ()* @_GLOBAL__I_a, variables: !2) +!36 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__I_a", line: 25, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagArtificial, isOptimized: false, scopeLine: 25, file: !1, scope: !23, type: !37, variables: !2) !37 = !DISubroutineType(types: !2) !38 = !{!39, !40, !41, !42} !39 = !DIGlobalVariable(name: "b", line: 3, isLocal: false, isDefinition: true, scope: null, file: !23, type: !4, variable: %struct.bar* @b) @@ -264,12 +264,12 @@ attributes #1 = { nounwind readnone } !43 = !{i32 2, !"Dwarf Version", i32 4} !44 = !{i32 1, !"Debug Info Version", i32 3} !45 = !{!"clang version 3.5 "} -!46 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "b", line: 7, scope: !22, file: !23, type: !47) +!46 = !DILocalVariable(name: "b", line: 7, scope: !22, file: !23, type: !47) !47 = !DICompositeType(tag: DW_TAG_structure_type, name: "baz", line: 6, size: 8, align: 8, file: !1, scope: !22, elements: !2) !48 = !DILocation(line: 7, scope: !22) !49 = !DILocation(line: 8, scope: !22) !50 = !DILocation(line: 29, scope: !26) -!51 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !27, type: !52) +!51 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !27, type: !52) !52 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !28) !53 = !DILocation(line: 0, scope: !27) !54 = !DILocation(line: 25, scope: !27) diff --git a/test/DebugInfo/X86/ghost-sdnode-dbgvalues.ll b/test/DebugInfo/X86/ghost-sdnode-dbgvalues.ll index ef249e8fab9c..20bb1b3f145f 100644 --- a/test/DebugInfo/X86/ghost-sdnode-dbgvalues.ll +++ b/test/DebugInfo/X86/ghost-sdnode-dbgvalues.ll @@ -29,7 +29,7 @@ ; when run with r221709 reverted, then it really doesn't test anything anymore. ; Function Attrs: nounwind ssp uwtable -define i32 @foo(i32 %a) #0 { +define i32 @foo(i32 %a) #0 !dbg !8 { entry: call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !16, metadata !17), !dbg !18 %conv = trunc i32 %a to i16, !dbg !19 @@ -68,7 +68,7 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!13, !14} !llvm.ident = !{!15} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !7, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !7, globals: !2, imports: !2) !1 = !DIFile(filename: "ghost-sdnode-dbgvalues.c", directory: "/tmp") !2 = !{} !3 = !{!4} @@ -76,7 +76,7 @@ attributes #1 = { nounwind readnone } !5 = !DIFile(filename: "/usr/include/sys/_types/_int16_t.h", directory: "/tmp") !6 = !DIBasicType(tag: DW_TAG_base_type, name: "short", size: 16, align: 16, encoding: DW_ATE_signed) !7 = !{!8} -!8 = !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !9, type: !10, function: i32 (i32)* @foo, variables: !2) +!8 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !9, type: !10, variables: !2) !9 = !DIFile(filename: "ghost-sdnode-dbgvalues.c", directory: "/tmp") !10 = !DISubroutineType(types: !11) !11 = !{!12, !12} @@ -84,22 +84,22 @@ attributes #1 = { nounwind readnone } !13 = !{i32 2, !"Dwarf Version", i32 2} !14 = !{i32 2, !"Debug Info Version", i32 3} !15 = !{!"clang version 3.6.0 "} -!16 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 3, arg: 1, scope: !8, file: !9, type: !12) +!16 = !DILocalVariable(name: "a", line: 3, arg: 1, scope: !8, file: !9, type: !12) !17 = !DIExpression() !18 = !DILocation(line: 3, column: 13, scope: !8) !19 = !DILocation(line: 4, column: 5, scope: !8) -!20 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "b", line: 4, scope: !8, file: !9, type: !12) +!20 = !DILocalVariable(name: "b", line: 4, scope: !8, file: !9, type: !12) !21 = !DILocation(line: 4, column: 9, scope: !8) !22 = !DILocation(line: 5, column: 5, scope: !8) -!23 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "c", line: 5, scope: !8, file: !9, type: !12) +!23 = !DILocalVariable(name: "c", line: 5, scope: !8, file: !9, type: !12) !24 = !DILocation(line: 5, column: 9, scope: !8) !25 = !DILocation(line: 6, column: 5, scope: !8) -!26 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "d", line: 6, scope: !8, file: !9, type: !12) +!26 = !DILocalVariable(name: "d", line: 6, scope: !8, file: !9, type: !12) !27 = !DILocation(line: 6, column: 9, scope: !8) !28 = !DILocation(line: 7, column: 5, scope: !8) -!29 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "e", line: 7, scope: !8, file: !9, type: !12) +!29 = !DILocalVariable(name: "e", line: 7, scope: !8, file: !9, type: !12) !30 = !DILocation(line: 7, column: 9, scope: !8) !31 = !DILocation(line: 8, column: 5, scope: !8) -!32 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "f", line: 8, scope: !8, file: !9, type: !12) +!32 = !DILocalVariable(name: "f", line: 8, scope: !8, file: !9, type: !12) !33 = !DILocation(line: 8, column: 9, scope: !8) !34 = !DILocation(line: 9, column: 5, scope: !8) diff --git a/test/DebugInfo/X86/gnu-public-names-empty.ll b/test/DebugInfo/X86/gnu-public-names-empty.ll index d87d8ef19008..4bd33df10dce 100644 --- a/test/DebugInfo/X86/gnu-public-names-empty.ll +++ b/test/DebugInfo/X86/gnu-public-names-empty.ll @@ -12,7 +12,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!3, !4} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 191846) (llvm/trunk 191866)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 191846) (llvm/trunk 191866)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2) !1 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/echristo/tmp") !2 = !{} !3 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/DebugInfo/X86/gnu-public-names.ll b/test/DebugInfo/X86/gnu-public-names.ll index 2022dfaa687c..584c879c064a 100644 --- a/test/DebugInfo/X86/gnu-public-names.ll +++ b/test/DebugInfo/X86/gnu-public-names.ll @@ -240,7 +240,7 @@ @_ZN5outer12_GLOBAL__N_11cE = internal global i32 0, align 4 ; Function Attrs: nounwind uwtable -define void @_ZN1C15member_functionEv(%struct.C* %this) #0 align 2 { +define void @_ZN1C15member_functionEv(%struct.C* %this) #0 align 2 !dbg !20 { entry: %this.addr = alloca %struct.C*, align 8 store %struct.C* %this, %struct.C** %this.addr, align 8 @@ -254,33 +254,33 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 ; Function Attrs: nounwind uwtable -define i32 @_ZN1C22static_member_functionEv() #0 align 2 { +define i32 @_ZN1C22static_member_functionEv() #0 align 2 !dbg !21 { entry: %0 = load i32, i32* @_ZN1C22static_member_variableE, align 4, !dbg !57 ret i32 %0, !dbg !57 } ; Function Attrs: nounwind uwtable -define i32 @_Z15global_functionv() #0 { +define i32 @_Z15global_functionv() #0 !dbg !22 { entry: ret i32 -1, !dbg !58 } ; Function Attrs: nounwind uwtable -define void @_ZN2ns25global_namespace_functionEv() #0 { +define void @_ZN2ns25global_namespace_functionEv() #0 !dbg !23 { entry: call void @_ZN1C15member_functionEv(%struct.C* @global_variable), !dbg !59 ret void, !dbg !60 } ; Function Attrs: nounwind uwtable -define i32* @_Z2f3v() #0 { +define i32* @_Z2f3v() #0 !dbg !26 { entry: ret i32* @_ZZ2f3vE1z, !dbg !61 } ; Function Attrs: nounwind uwtable -define i32 @_Z2f7v() #0 { +define i32 @_Z2f7v() #0 !dbg !30 { entry: %0 = load i32, i32* @_ZN12_GLOBAL__N_11iE, align 4, !dbg !62 %call = call i32* @_Z2f3v(), !dbg !62 @@ -300,7 +300,7 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!48, !49} !llvm.ident = !{!50} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 234897) (llvm/trunk 234911)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !19, globals: !31, imports: !44) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 234897) (llvm/trunk 234911)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !19, globals: !31, imports: !44) !1 = !DIFile(filename: "gnu-public-names.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4, !15} @@ -320,17 +320,17 @@ attributes #1 = { nounwind readnone } !17 = !{!18} !18 = !DIDerivedType(tag: DW_TAG_member, name: "A", scope: !"_ZTSN2ns1DE", file: !1, line: 30, baseType: !7, size: 32, align: 32) !19 = !{!20, !21, !22, !23, !26, !30} -!20 = !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", scope: !"_ZTS1C", file: !1, line: 9, type: !9, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, function: void (%struct.C*)* @_ZN1C15member_functionEv, declaration: !8, variables: !2) -!21 = !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", scope: !"_ZTS1C", file: !1, line: 13, type: !13, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, function: i32 ()* @_ZN1C22static_member_functionEv, declaration: !12, variables: !2) -!22 = !DISubprogram(name: "global_function", linkageName: "_Z15global_functionv", scope: !1, file: !1, line: 19, type: !13, isLocal: false, isDefinition: true, scopeLine: 19, flags: DIFlagPrototyped, isOptimized: false, function: i32 ()* @_Z15global_functionv, variables: !2) -!23 = !DISubprogram(name: "global_namespace_function", linkageName: "_ZN2ns25global_namespace_functionEv", scope: !16, file: !1, line: 24, type: !24, isLocal: false, isDefinition: true, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @_ZN2ns25global_namespace_functionEv, variables: !2) +!20 = distinct !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", scope: !"_ZTS1C", file: !1, line: 9, type: !9, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, declaration: !8, variables: !2) +!21 = distinct !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", scope: !"_ZTS1C", file: !1, line: 13, type: !13, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, declaration: !12, variables: !2) +!22 = distinct !DISubprogram(name: "global_function", linkageName: "_Z15global_functionv", scope: !1, file: !1, line: 19, type: !13, isLocal: false, isDefinition: true, scopeLine: 19, flags: DIFlagPrototyped, isOptimized: false, variables: !2) +!23 = distinct !DISubprogram(name: "global_namespace_function", linkageName: "_ZN2ns25global_namespace_functionEv", scope: !16, file: !1, line: 24, type: !24, isLocal: false, isDefinition: true, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false, variables: !2) !24 = !DISubroutineType(types: !25) !25 = !{null} -!26 = !DISubprogram(name: "f3", linkageName: "_Z2f3v", scope: !1, file: !1, line: 40, type: !27, isLocal: false, isDefinition: true, scopeLine: 40, flags: DIFlagPrototyped, isOptimized: false, function: i32* ()* @_Z2f3v, variables: !2) +!26 = distinct !DISubprogram(name: "f3", linkageName: "_Z2f3v", scope: !1, file: !1, line: 40, type: !27, isLocal: false, isDefinition: true, scopeLine: 40, flags: DIFlagPrototyped, isOptimized: false, variables: !2) !27 = !DISubroutineType(types: !28) !28 = !{!29} !29 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64) -!30 = !DISubprogram(name: "f7", linkageName: "_Z2f7v", scope: !1, file: !1, line: 57, type: !13, isLocal: false, isDefinition: true, scopeLine: 57, flags: DIFlagPrototyped, isOptimized: false, function: i32 ()* @_Z2f7v, variables: !2) +!30 = distinct !DISubprogram(name: "f7", linkageName: "_Z2f7v", scope: !1, file: !1, line: 57, type: !13, isLocal: false, isDefinition: true, scopeLine: 57, flags: DIFlagPrototyped, isOptimized: false, variables: !2) !31 = !{!32, !33, !34, !35, !36, !37, !39, !41} !32 = !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", scope: !0, file: !1, line: 7, type: !7, isLocal: false, isDefinition: true, variable: i32* @_ZN1C22static_member_variableE, declaration: !6) !33 = !DIGlobalVariable(name: "global_variable", scope: !0, file: !1, line: 17, type: !"_ZTS1C", isLocal: false, isDefinition: true, variable: %struct.C* @global_variable) @@ -351,7 +351,7 @@ attributes #1 = { nounwind readnone } !48 = !{i32 2, !"Dwarf Version", i32 4} !49 = !{i32 2, !"Debug Info Version", i32 3} !50 = !{!"clang version 3.7.0 (trunk 234897) (llvm/trunk 234911)"} -!51 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, scope: !20, type: !52, flags: DIFlagArtificial | DIFlagObjectPointer) +!51 = !DILocalVariable(name: "this", arg: 1, scope: !20, type: !52, flags: DIFlagArtificial | DIFlagObjectPointer) !52 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1C", size: 64, align: 64) !53 = !DIExpression() !54 = !DILocation(line: 0, scope: !20) diff --git a/test/DebugInfo/X86/header.ll b/test/DebugInfo/X86/header.ll index 8575c4a672a2..1b210d0b90a2 100644 --- a/test/DebugInfo/X86/header.ll +++ b/test/DebugInfo/X86/header.ll @@ -11,17 +11,17 @@ ; CHECK: .section .debug_str -define void @f() { +define void @f() !dbg !4 { ret void, !dbg !9 } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!7, !8} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "foo", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "foo", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "/foo/test.c", directory: "/foo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, function: void ()* @f, variables: !2) +!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, variables: !2) !5 = !DISubroutineType(types: !6) !6 = !{null} !7 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/DebugInfo/X86/inline-member-function.ll b/test/DebugInfo/X86/inline-member-function.ll index 73cd1947f4f4..712a20c3a4a8 100644 --- a/test/DebugInfo/X86/inline-member-function.ll +++ b/test/DebugInfo/X86/inline-member-function.ll @@ -37,7 +37,7 @@ @i = global i32 0, align 4 ; Function Attrs: uwtable -define i32 @main() #0 { +define i32 @main() #0 !dbg !13 { entry: %this.addr.i = alloca %struct.foo*, align 8 %x.addr.i = alloca i32, align 4 @@ -65,7 +65,7 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!20, !21} !llvm.ident = !{!22} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !12, globals: !18, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !12, globals: !18, imports: !2) !1 = !DIFile(filename: "inline.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} @@ -77,19 +77,19 @@ attributes #1 = { nounwind readnone } !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS3foo") !12 = !{!13, !17} -!13 = !DISubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !14, type: !15, function: i32 ()* @main, variables: !2) +!13 = distinct !DISubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !14, type: !15, variables: !2) !14 = !DIFile(filename: "inline.cpp", directory: "/tmp/dbginfo") !15 = !DISubroutineType(types: !16) !16 = !{!9} -!17 = !DISubprogram(name: "func", linkageName: "_ZN3foo4funcEi", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !"_ZTS3foo", type: !7, declaration: !6, variables: !2) +!17 = distinct !DISubprogram(name: "func", linkageName: "_ZN3foo4funcEi", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !"_ZTS3foo", type: !7, declaration: !6, variables: !2) !18 = !{!19} !19 = !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: null, file: !14, type: !9, variable: i32* @i) !20 = !{i32 2, !"Dwarf Version", i32 4} !21 = !{i32 1, !"Debug Info Version", i32 3} !22 = !{!"clang version 3.5.0 "} !23 = !DILocation(line: 8, scope: !13) -!24 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !25) +!24 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !17, type: !25) !25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS3foo") !26 = !DILocation(line: 0, scope: !17, inlinedAt: !23) -!27 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 2, arg: 2, scope: !17, file: !14, type: !9) +!27 = !DILocalVariable(name: "x", line: 2, arg: 2, scope: !17, file: !14, type: !9) !28 = !DILocation(line: 2, scope: !17, inlinedAt: !23) diff --git a/test/DebugInfo/X86/inline-seldag-test.ll b/test/DebugInfo/X86/inline-seldag-test.ll index c8e75cf3fcb3..62b946611f4f 100644 --- a/test/DebugInfo/X86/inline-seldag-test.ll +++ b/test/DebugInfo/X86/inline-seldag-test.ll @@ -23,7 +23,7 @@ ; ASM: testl ; Function Attrs: nounwind uwtable -define void @func() #0 { +define void @func() #0 !dbg !4 { entry: %y.addr.i = alloca i32, align 4 %x = alloca i32, align 4 @@ -48,26 +48,26 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!12, !13} !llvm.ident = !{!14} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "inline-seldag-test.c", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4, !8} -!4 = !DISubprogram(name: "func", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 4, file: !1, scope: !5, type: !6, function: void ()* @func, variables: !2) +!4 = distinct !DISubprogram(name: "func", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 4, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "inline-seldag-test.c", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !7) !7 = !{null} -!8 = !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !9, variables: !2) +!8 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !9, variables: !2) !9 = !DISubroutineType(types: !10) !10 = !{!11, !11} !11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !12 = !{i32 2, !"Dwarf Version", i32 4} !13 = !{i32 1, !"Debug Info Version", i32 3} !14 = !{!"clang version 3.5.0 "} -!15 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "x", line: 5, scope: !4, file: !5, type: !16) +!15 = !DILocalVariable(name: "x", line: 5, scope: !4, file: !5, type: !16) !16 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !11) !17 = !DILocation(line: 5, scope: !4) !18 = !DILocation(line: 6, column: 7, scope: !4) -!19 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "y", line: 1, arg: 1, scope: !8, file: !5, type: !11) +!19 = !DILocalVariable(name: "y", line: 1, arg: 1, scope: !8, file: !5, type: !11) !20 = !DILocation(line: 1, scope: !8, inlinedAt: !18) !21 = !DILocation(line: 2, scope: !8, inlinedAt: !18) !22 = !DILocation(line: 7, scope: !4) diff --git a/test/DebugInfo/X86/inlined-formal-parameter.ll b/test/DebugInfo/X86/inlined-formal-parameter.ll index 3cc4e5a65a66..49c1747d7d6d 100644 --- a/test/DebugInfo/X86/inlined-formal-parameter.ll +++ b/test/DebugInfo/X86/inlined-formal-parameter.ll @@ -25,7 +25,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin" ; Function Attrs: nounwind ssp uwtable -define void @foo() #0 { +define void @foo() #0 !dbg !4 { entry: tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !12, metadata !17) #3, !dbg !18 tail call void @sink() #3, !dbg !20 @@ -48,19 +48,19 @@ attributes #3 = { nounwind } !llvm.module.flags = !{!13, !14, !15} !llvm.ident = !{!16} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 235110) (llvm/trunk 235108)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 235110) (llvm/trunk 235108)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "t.c", directory: "/path/to/dir") !2 = !{} !3 = !{!4, !7} -!4 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, function: void ()* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, variables: !2) !5 = !DISubroutineType(types: !6) !6 = !{null} -!7 = !DISubprogram(name: "bar", scope: !1, file: !1, line: 2, type: !8, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, variables: !11) +!7 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 2, type: !8, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, variables: !11) !8 = !DISubroutineType(types: !9) !9 = !{null, !10} !10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !11 = !{!12} -!12 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", arg: 1, scope: !7, file: !1, line: 2, type: !10) +!12 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 2, type: !10) !13 = !{i32 2, !"Dwarf Version", i32 2} !14 = !{i32 2, !"Debug Info Version", i32 3} !15 = !{i32 1, !"PIC Level", i32 2} diff --git a/test/DebugInfo/X86/inlined-indirect-value.ll b/test/DebugInfo/X86/inlined-indirect-value.ll index 7f95691fbb8f..d203650d05c5 100644 --- a/test/DebugInfo/X86/inlined-indirect-value.ll +++ b/test/DebugInfo/X86/inlined-indirect-value.ll @@ -22,7 +22,7 @@ target triple = "x86_64-unknown-linux-gnu" @x = common global i32 0, align 4 @y = common global i32 0, align 4 -define i32 @main() { +define i32 @main() !dbg !4 { ; CHECK: .loc 1 {{[89]}} ; CHECK-NOT: .loc ; CHECK: movl $1 @@ -49,15 +49,15 @@ select.end: ; preds = %entry, %select.mid !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!13, !14} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports: !2) !1 = !DIFile(filename: "inline-break.c", directory: "/build/dir") !2 = !{} !3 = !{!4, !8} -!4 = !DISubprogram(name: "main", scope: !1, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true, scopeLine: 7, isOptimized: true, function: i32 ()* @main, variables: !2) +!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true, scopeLine: 7, isOptimized: true, variables: !2) !5 = !DISubroutineType(types: !6) !6 = !{!7} !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!8 = !DISubprogram(name: "f1", scope: !1, file: !1, line: 3, type: !5, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: true, variables: !2) +!8 = distinct !DISubprogram(name: "f1", scope: !1, file: !1, line: 3, type: !5, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: true, variables: !2) !9 = !{!10, !12} !10 = !DIGlobalVariable(name: "x", scope: !0, file: !1, line: 1, type: !11, isLocal: false, isDefinition: true, variable: i32* @x) !11 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !7) diff --git a/test/DebugInfo/X86/instcombine-instrinsics.ll b/test/DebugInfo/X86/instcombine-instrinsics.ll index 8241e6498f96..f4f7e1403d32 100644 --- a/test/DebugInfo/X86/instcombine-instrinsics.ll +++ b/test/DebugInfo/X86/instcombine-instrinsics.ll @@ -28,7 +28,7 @@ target triple = "x86_64-apple-macosx10.9.0" %struct.i14 = type { i64 } ; Function Attrs: nounwind ssp uwtable -define void @init() #0 { +define void @init() #0 !dbg !4 { %p = alloca %struct.i14*, align 8 call void @llvm.dbg.declare(metadata %struct.i14** %p, metadata !11, metadata !DIExpression()), !dbg !18 store %struct.i14* null, %struct.i14** %p, align 8, !dbg !18 @@ -54,18 +54,18 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "instcombine_intrinsics.c", directory: "") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "init", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !1, scope: !5, type: !6, function: void ()* @init, variables: !2) +!4 = distinct !DISubprogram(name: "init", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 7, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "instcombine_intrinsics.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{null} !8 = !{i32 2, !"Dwarf Version", i32 2} !9 = !{i32 1, !"Debug Info Version", i32 3} !10 = !{!"clang version 3.5.0 "} -!11 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "p", line: 8, scope: !4, file: !5, type: !12) +!11 = !DILocalVariable(name: "p", line: 8, scope: !4, file: !5, type: !12) !12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !13) !13 = !DIDerivedType(tag: DW_TAG_typedef, name: "i14", line: 3, file: !1, baseType: !14) !14 = !DICompositeType(tag: DW_TAG_structure_type, line: 1, size: 64, align: 64, file: !1, elements: !15) diff --git a/test/DebugInfo/X86/lexical_block.ll b/test/DebugInfo/X86/lexical_block.ll index 2619f12f69ed..5fdfcdfe269b 100644 --- a/test/DebugInfo/X86/lexical_block.ll +++ b/test/DebugInfo/X86/lexical_block.ll @@ -22,7 +22,7 @@ ; } ; Function Attrs: nounwind uwtable -define void @_Z1bv() #0 { +define void @_Z1bv() #0 !dbg !4 { entry: %i = alloca i32, align 4 call void @llvm.dbg.declare(metadata i32* %i, metadata !11, metadata !DIExpression()), !dbg !14 @@ -48,18 +48,18 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "lexical_block.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "b", linkageName: "_Z1bv", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void ()* @_Z1bv, variables: !2) +!4 = distinct !DISubprogram(name: "b", linkageName: "_Z1bv", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "lexical_block.cpp", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !7) !7 = !{null} !8 = !{i32 2, !"Dwarf Version", i32 4} !9 = !{i32 1, !"Debug Info Version", i32 3} !10 = !{!"clang version 3.5.0 "} -!11 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 2, scope: !12, file: !5, type: !13) +!11 = !DILocalVariable(name: "i", line: 2, scope: !12, file: !5, type: !13) !12 = distinct !DILexicalBlock(line: 2, column: 0, file: !1, scope: !4) !13 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !14 = !DILocation(line: 2, scope: !12) diff --git a/test/DebugInfo/X86/line-info.ll b/test/DebugInfo/X86/line-info.ll index a3d957f8bc48..bdd91db9eecb 100644 --- a/test/DebugInfo/X86/line-info.ll +++ b/test/DebugInfo/X86/line-info.ll @@ -14,7 +14,7 @@ ; int main() { ; } -define i32 @foo(i32 %x) #0 { +define i32 @foo(i32 %x) #0 !dbg !4 { entry: %x.addr = alloca i32, align 4 store i32 %x, i32* %x.addr, align 4 @@ -27,7 +27,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 -define i32 @main() #0 { +define i32 @main() #0 !dbg !10 { entry: ret i32 0, !dbg !17 } @@ -38,21 +38,21 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!19} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "list0.c", directory: "/usr/local/google/home/blaikie/dev/scratch") !2 = !{} !3 = !{!4, !10} -!4 = !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !5, scope: !6, type: !7, function: i32 (i32)* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !5, scope: !6, type: !7, variables: !2) !5 = !DIFile(filename: "./list0.h", directory: "/usr/local/google/home/blaikie/dev/scratch") !6 = !DIFile(filename: "./list0.h", directory: "/usr/local/google/home/blaikie/dev/scratch") !7 = !DISubroutineType(types: !8) !8 = !{!9, !9} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !1, scope: !11, type: !12, function: i32 ()* @main, variables: !2) +!10 = distinct !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 2, file: !1, scope: !11, type: !12, variables: !2) !11 = !DIFile(filename: "list0.c", directory: "/usr/local/google/home/blaikie/dev/scratch") !12 = !DISubroutineType(types: !13) !13 = !{!9} -!14 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 1, arg: 1, scope: !4, file: !6, type: !9) +!14 = !DILocalVariable(name: "x", line: 1, arg: 1, scope: !4, file: !6, type: !9) !15 = !DILocation(line: 1, scope: !4) !16 = !DILocation(line: 2, scope: !4) !17 = !DILocation(line: 3, scope: !18) diff --git a/test/DebugInfo/X86/linkage-name.ll b/test/DebugInfo/X86/linkage-name.ll index 330a7f9e53a1..4408d5132c46 100644 --- a/test/DebugInfo/X86/linkage-name.ll +++ b/test/DebugInfo/X86/linkage-name.ll @@ -9,7 +9,7 @@ @a = global %class.A zeroinitializer, align 1 -define i32 @_ZN1A1aEi(%class.A* %this, i32 %b) nounwind uwtable ssp align 2 { +define i32 @_ZN1A1aEi(%class.A* %this, i32 %b) nounwind uwtable ssp align 2 !dbg !5 { entry: %this.addr = alloca %class.A*, align 8 %b.addr = alloca i32, align 4 @@ -27,10 +27,10 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!29} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 152691) (llvm/trunk 152692)", isOptimized: false, emissionKind: 0, file: !28, enums: !1, retainedTypes: !1, subprograms: !3, globals: !18, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.1 (trunk 152691) (llvm/trunk 152692)", isOptimized: false, emissionKind: 0, file: !28, enums: !1, retainedTypes: !1, subprograms: !3, globals: !18, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "a", linkageName: "_ZN1A1aEi", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !6, scope: null, type: !7, function: i32 (%class.A*, i32)* @_ZN1A1aEi, declaration: !13) +!5 = distinct !DISubprogram(name: "a", linkageName: "_ZN1A1aEi", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !6, scope: null, type: !7, declaration: !13) !6 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo") !7 = !DISubroutineType(types: !8) !8 = !{!9, !10, !9} @@ -41,10 +41,10 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !13 = !DISubprogram(name: "a", linkageName: "_ZN1A1aEi", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrivate | DIFlagPrototyped, isOptimized: false, file: !6, scope: !11, type: !7) !18 = !{!20} !20 = !DIGlobalVariable(name: "a", line: 9, isLocal: false, isDefinition: true, scope: null, file: !6, type: !11, variable: %class.A* @a) -!21 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 5, arg: 1, flags: DIFlagArtificial, scope: !5, file: !6, type: !22) +!21 = !DILocalVariable(name: "this", line: 5, arg: 1, flags: DIFlagArtificial, scope: !5, file: !6, type: !22) !22 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11) !23 = !DILocation(line: 5, column: 8, scope: !5) -!24 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 5, arg: 2, scope: !5, file: !6, type: !9) +!24 = !DILocalVariable(name: "b", line: 5, arg: 2, scope: !5, file: !6, type: !9) !25 = !DILocation(line: 5, column: 14, scope: !5) !26 = !DILocation(line: 6, column: 4, scope: !27) !27 = distinct !DILexicalBlock(line: 5, column: 17, file: !6, scope: !5) diff --git a/test/DebugInfo/X86/live-debug-values.ll b/test/DebugInfo/X86/live-debug-values.ll new file mode 100644 index 000000000000..615d498041bb --- /dev/null +++ b/test/DebugInfo/X86/live-debug-values.ll @@ -0,0 +1,152 @@ +; RUN: llc -filetype=asm %s -o - | FileCheck %s + +; Test the extension of debug ranges from predecessors. +; Generated from the source file LiveDebugValues.c: +; #include <stdio.h> +; int m; +; extern int inc(int n); +; extern int change(int n); +; extern int modify(int n); +; int main(int argc, char **argv) { +; int n; +; if (argc != 2) +; n = 2; +; else +; n = atoi(argv[1]); +; n = change(n); +; if (n > 10) { +; m = modify(n); +; m = m + n; // var `m' doesn't has a dbg.value +; } +; else +; m = inc(n); // var `m' doesn't has a dbg.value +; printf("m(main): %d\n", m); +; return 0; +; } +; with clang -g -O3 -emit-llvm -c LiveDebugValues.c -S -o live-debug-values.ll +; This case will also produce multiple locations but only the debug range +; extension is tested here. + +; DBG_VALUE for variable "n" is extended into BB#5 from its predecessors BB#3 +; and BB#4. +; CHECK: .LBB0_5: +; CHECK-NEXT: #DEBUG_VALUE: main:n <- %EBX +; CHECK-NEXT: #DEBUG_VALUE: main:argv <- %RSI + +; ModuleID = 'LiveDebugValues.c' +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@m = common global i32 0, align 4 +@.str = private unnamed_addr constant [13 x i8] c"m(main): %d\0A\00", align 1 + +; Function Attrs: nounwind uwtable +define i32 @main(i32 %argc, i8** nocapture readonly %argv) #0 !dbg !4 { +entry: + tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !12, metadata !20), !dbg !21 + tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !13, metadata !20), !dbg !22 + %cmp = icmp eq i32 %argc, 2, !dbg !24 + br i1 %cmp, label %if.else, label %if.end, !dbg !26 + +if.else: ; preds = %entry + %arrayidx = getelementptr inbounds i8*, i8** %argv, i64 1, !dbg !27 + %0 = load i8*, i8** %arrayidx, align 8, !dbg !27, !tbaa !28 + %call = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %0) #4, !dbg !32 + tail call void @llvm.dbg.value(metadata i32 %call, i64 0, metadata !14, metadata !20), !dbg !33 + br label %if.end + +if.end: ; preds = %entry, %if.else + %n.0 = phi i32 [ %call, %if.else ], [ 2, %entry ] + %call1 = tail call i32 @change(i32 %n.0) #4, !dbg !34 + tail call void @llvm.dbg.value(metadata i32 %call1, i64 0, metadata !14, metadata !20), !dbg !33 + %cmp2 = icmp sgt i32 %call1, 10, !dbg !35 + br i1 %cmp2, label %if.then.3, label %if.else.5, !dbg !37 + +if.then.3: ; preds = %if.end + %call4 = tail call i32 @modify(i32 %call1) #4, !dbg !38 + %add = add nsw i32 %call4, %call1, !dbg !40 + br label %if.end.7, !dbg !41 + +if.else.5: ; preds = %if.end + %call6 = tail call i32 @inc(i32 %call1) #4, !dbg !42 + br label %if.end.7 + +if.end.7: ; preds = %if.else.5, %if.then.3 + %storemerge = phi i32 [ %call6, %if.else.5 ], [ %add, %if.then.3 ] + store i32 %storemerge, i32* @m, align 4, !dbg !43, !tbaa !44 + %call8 = tail call i32 (i8*, ...) @printf(i8* nonnull getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %storemerge) #4, !dbg !46 + ret i32 0, !dbg !47 +} + +declare i32 @atoi(...) #1 + +declare i32 @change(i32) #1 + +declare i32 @modify(i32) #1 + +declare i32 @inc(i32) #1 + +; Function Attrs: nounwind +declare i32 @printf(i8* nocapture readonly, ...) #2 + +; Function Attrs: nounwind readnone +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #3 + +attributes #0 = { nounwind uwtable } +attributes #1 = { nounwind } +attributes #2 = { nounwind } +attributes #3 = { nounwind readnone } +attributes #4 = { nounwind } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!17, !18} +!llvm.ident = !{!19} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 253049) ", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3, globals: !15) +!1 = !DIFile(filename: "LiveDebugValues.c", directory: "/home/vt/julia/test/tvvikram") +!2 = !{} +!3 = !{!4} +!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, variables: !11) +!5 = !DISubroutineType(types: !6) +!6 = !{!7, !7, !8} +!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64) +!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64) +!10 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) +!11 = !{!12, !13, !14} +!12 = !DILocalVariable(name: "argc", arg: 1, scope: !4, file: !1, line: 6, type: !7) +!13 = !DILocalVariable(name: "argv", arg: 2, scope: !4, file: !1, line: 6, type: !8) +!14 = !DILocalVariable(name: "n", scope: !4, file: !1, line: 7, type: !7) +!15 = !{!16} +!16 = !DIGlobalVariable(name: "m", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, variable: i32* @m) +!17 = !{i32 2, !"Dwarf Version", i32 4} +!18 = !{i32 2, !"Debug Info Version", i32 3} +!19 = !{!"clang version 3.8.0 (trunk 253049) "} +!20 = !DIExpression() +!21 = !DILocation(line: 6, column: 14, scope: !4) +!22 = !DILocation(line: 6, column: 27, scope: !23) +!23 = !DILexicalBlockFile(scope: !4, file: !1, discriminator: 1) +!24 = !DILocation(line: 8, column: 12, scope: !25) +!25 = distinct !DILexicalBlock(scope: !4, file: !1, line: 8, column: 7) +!26 = !DILocation(line: 8, column: 7, scope: !4) +!27 = !DILocation(line: 11, column: 14, scope: !25) +!28 = !{!29, !29, i64 0} +!29 = !{!"any pointer", !30, i64 0} +!30 = !{!"omnipotent char", !31, i64 0} +!31 = !{!"Simple C/C++ TBAA"} +!32 = !DILocation(line: 11, column: 9, scope: !25) +!33 = !DILocation(line: 7, column: 7, scope: !23) +!34 = !DILocation(line: 12, column: 7, scope: !4) +!35 = !DILocation(line: 13, column: 9, scope: !36) +!36 = distinct !DILexicalBlock(scope: !4, file: !1, line: 13, column: 7) +!37 = !DILocation(line: 13, column: 7, scope: !4) +!38 = !DILocation(line: 14, column: 9, scope: !39) +!39 = distinct !DILexicalBlock(scope: !36, file: !1, line: 13, column: 15) +!40 = !DILocation(line: 15, column: 11, scope: !39) +!41 = !DILocation(line: 16, column: 3, scope: !39) +!42 = !DILocation(line: 18, column: 9, scope: !36) +!43 = !DILocation(line: 15, column: 7, scope: !39) +!44 = !{!45, !45, i64 0} +!45 = !{!"int", !30, i64 0} +!46 = !DILocation(line: 19, column: 3, scope: !4) +!47 = !DILocation(line: 20, column: 3, scope: !4) diff --git a/test/DebugInfo/X86/low-pc-cu.ll b/test/DebugInfo/X86/low-pc-cu.ll index 727a7bb3dec1..f98da6f5ae28 100644 --- a/test/DebugInfo/X86/low-pc-cu.ll +++ b/test/DebugInfo/X86/low-pc-cu.ll @@ -21,7 +21,7 @@ ; CHECK-V4: DW_AT_high_pc [DW_FORM_data4] ; Function Attrs: nounwind uwtable -define void @z() #0 { +define void @z() #0 !dbg !4 { entry: ret void, !dbg !11 } @@ -32,11 +32,11 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !llvm.module.flags = !{!8, !9} !llvm.ident = !{!10} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "z.c", directory: "/usr/local/google/home/echristo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "z", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void ()* @z, variables: !2) +!4 = distinct !DISubprogram(name: "z", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "z.c", directory: "/usr/local/google/home/echristo") !6 = !DISubroutineType(types: !7) !7 = !{null} diff --git a/test/DebugInfo/X86/memberfnptr.ll b/test/DebugInfo/X86/memberfnptr.ll index a53264d2c856..9b1c57dd7442 100644 --- a/test/DebugInfo/X86/memberfnptr.ll +++ b/test/DebugInfo/X86/memberfnptr.ll @@ -24,7 +24,7 @@ declare void @_ZN1A3fooEv(%struct.A*) !llvm.module.flags = !{!14, !15, !16} !llvm.ident = !{!17} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !10, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !10, imports: !2) !1 = !DIFile(filename: "memberfnptr.cpp", directory: "") !2 = !{} !3 = !{!4} diff --git a/test/DebugInfo/X86/mi-print.ll b/test/DebugInfo/X86/mi-print.ll index b5d7b0ef067f..086e88deffb0 100644 --- a/test/DebugInfo/X86/mi-print.ll +++ b/test/DebugInfo/X86/mi-print.ll @@ -14,7 +14,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.10.0" ; Function Attrs: nounwind readnone ssp uwtable -define i32 @bar(i32 %x) #0 { +define i32 @bar(i32 %x) #0 !dbg !4 { entry: tail call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !9, metadata !17), !dbg !18 tail call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !19, metadata !17), !dbg !21 @@ -31,26 +31,26 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!13, !14, !15} !llvm.ident = !{!16} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 233919) (llvm/trunk 233920)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 233919) (llvm/trunk 233920)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "t.c", directory: "/Users/dexonsmith/data/llvm/debug-info/test/DebugInfo/X86") !2 = !{} !3 = !{!4, !10} -!4 = !DISubprogram(name: "bar", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, function: i32 (i32)* @bar, variables: !8) +!4 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, variables: !8) !5 = !DISubroutineType(types: !6) !6 = !{!7, !7} !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !8 = !{!9} -!9 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", arg: 1, scope: !4, file: !1, line: 2, type: !7) -!10 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: true, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, variables: !11) +!9 = !DILocalVariable(name: "x", arg: 1, scope: !4, file: !1, line: 2, type: !7) +!10 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: true, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, variables: !11) !11 = !{!12} -!12 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", arg: 1, scope: !10, file: !1, line: 1, type: !7) +!12 = !DILocalVariable(name: "x", arg: 1, scope: !10, file: !1, line: 1, type: !7) !13 = !{i32 2, !"Dwarf Version", i32 2} !14 = !{i32 2, !"Debug Info Version", i32 3} !15 = !{i32 1, !"PIC Level", i32 2} !16 = !{!"clang version 3.7.0 (trunk 233919) (llvm/trunk 233920)"} !17 = !DIExpression() !18 = !DILocation(line: 2, column: 13, scope: !4) -!19 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", arg: 1, scope: !10, file: !1, line: 1, type: !7) +!19 = !DILocalVariable(name: "x", arg: 1, scope: !10, file: !1, line: 1, type: !7) !20 = distinct !DILocation(line: 2, column: 25, scope: !4) !21 = !DILocation(line: 1, column: 20, scope: !10, inlinedAt: !20) !22 = !DILocation(line: 2, column: 18, scope: !4) diff --git a/test/DebugInfo/X86/misched-dbg-value.ll b/test/DebugInfo/X86/misched-dbg-value.ll index c660e1f72a9f..e85e241c589f 100644 --- a/test/DebugInfo/X86/misched-dbg-value.ll +++ b/test/DebugInfo/X86/misched-dbg-value.ll @@ -46,7 +46,7 @@ @PtrGlb = common global %struct.Record* null, align 8 @PtrGlbNext = common global %struct.Record* null, align 8 -define void @Proc8(i32* nocapture %Array1Par, [51 x i32]* nocapture %Array2Par, i32 %IntParI1, i32 %IntParI2) nounwind optsize { +define void @Proc8(i32* nocapture %Array1Par, [51 x i32]* nocapture %Array2Par, i32 %IntParI1, i32 %IntParI2) nounwind optsize !dbg !12 { entry: tail call void @llvm.dbg.value(metadata i32* %Array1Par, i64 0, metadata !23, metadata !DIExpression()), !dbg !64 tail call void @llvm.dbg.value(metadata [51 x i32]* %Array2Par, i64 0, metadata !24, metadata !DIExpression()), !dbg !65 @@ -103,7 +103,7 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!83} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 175015)", isOptimized: true, emissionKind: 1, file: !82, enums: !1, retainedTypes: !10, subprograms: !11, globals: !29, imports: !10) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 175015)", isOptimized: true, emissionKind: 1, file: !82, enums: !1, retainedTypes: !10, subprograms: !11, globals: !29, imports: !10) !1 = !{!2} !2 = !DICompositeType(tag: DW_TAG_enumeration_type, line: 128, size: 32, align: 32, file: !82, elements: !4) !3 = !DIFile(filename: "dry.c", directory: "/Users/manmanren/test-Nov/rdar_13183203/test2") @@ -115,7 +115,7 @@ attributes #1 = { nounwind readnone } !9 = !DIEnumerator(name: "Ident5", value: 10003) ; [ DW_TAG_enumerator ] [Ident5 :: 10003] !10 = !{} !11 = !{!12} -!12 = !DISubprogram(name: "Proc8", line: 180, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 185, file: !82, scope: !3, type: !13, function: void (i32*, [51 x i32]*, i32, i32)* @Proc8, variables: !22) +!12 = distinct !DISubprogram(name: "Proc8", line: 180, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 185, file: !82, scope: !3, type: !13, variables: !22) !13 = !DISubroutineType(types: !14) !14 = !{null, !15, !17, !21, !21} !15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !16) @@ -126,12 +126,12 @@ attributes #1 = { nounwind readnone } !20 = !DISubrange(count: 51) !21 = !DIDerivedType(tag: DW_TAG_typedef, name: "OneToFifty", line: 132, file: !82, baseType: !16) !22 = !{!23, !24, !25, !26, !27, !28} -!23 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "Array1Par", line: 181, arg: 1, scope: !12, file: !3, type: !15) -!24 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "Array2Par", line: 182, arg: 2, scope: !12, file: !3, type: !17) -!25 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "IntParI1", line: 183, arg: 3, scope: !12, file: !3, type: !21) -!26 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "IntParI2", line: 184, arg: 4, scope: !12, file: !3, type: !21) -!27 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "IntLoc", line: 186, scope: !12, file: !3, type: !21) -!28 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "IntIndex", line: 187, scope: !12, file: !3, type: !21) +!23 = !DILocalVariable(name: "Array1Par", line: 181, arg: 1, scope: !12, file: !3, type: !15) +!24 = !DILocalVariable(name: "Array2Par", line: 182, arg: 2, scope: !12, file: !3, type: !17) +!25 = !DILocalVariable(name: "IntParI1", line: 183, arg: 3, scope: !12, file: !3, type: !21) +!26 = !DILocalVariable(name: "IntParI2", line: 184, arg: 4, scope: !12, file: !3, type: !21) +!27 = !DILocalVariable(name: "IntLoc", line: 186, scope: !12, file: !3, type: !21) +!28 = !DILocalVariable(name: "IntIndex", line: 187, scope: !12, file: !3, type: !21) !29 = !{!30, !35, !36, !38, !39, !40, !42, !46, !63} !30 = !DIGlobalVariable(name: "Version", line: 111, isLocal: false, isDefinition: true, scope: null, file: !3, type: !31, variable: [4 x i8]* @Version) !31 = !DICompositeType(tag: DW_TAG_array_type, size: 32, align: 8, baseType: !32, elements: !33) diff --git a/test/DebugInfo/X86/missing-file-line.ll b/test/DebugInfo/X86/missing-file-line.ll index 455868cb1736..19064579af36 100644 --- a/test/DebugInfo/X86/missing-file-line.ll +++ b/test/DebugInfo/X86/missing-file-line.ll @@ -11,7 +11,7 @@ target triple = "x86_64-unknown-linux-gnu" %struct.S = type { %struct.S* } -define void @f() { +define void @f() !dbg !4 { %x = alloca %struct.S, align 8 ; CHECK: DW_TAG_typedef ; CHECK-NOT: DW_AT_decl_file @@ -36,17 +36,17 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 !llvm.module.flags = !{!7, !8} !llvm.ident = !{!9} -!0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "file.c", directory: "/dir") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "f", scope: !1, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true, scopeLine: 7, isOptimized: false, function: void ()* @f, variables: !2) +!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 7, type: !5, isLocal: false, isDefinition: true, scopeLine: 7, isOptimized: false, variables: !2) !5 = !DISubroutineType(types: !6) !6 = !{null} !7 = !{i32 2, !"Dwarf Version", i32 4} !8 = !{i32 2, !"Debug Info Version", i32 3} !9 = !{!"clang"} -!10 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "x", scope: !4, file: !1, line: 8, type: !11) +!10 = !DILocalVariable(name: "x", scope: !4, file: !1, line: 8, type: !11) !11 = !DIDerivedType(tag: DW_TAG_typedef, name: "SS", baseType: !12) !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", size: 64, align: 64, elements: !13) !13 = !{!14} diff --git a/test/DebugInfo/X86/multiple-aranges.ll b/test/DebugInfo/X86/multiple-aranges.ll index 571454bd8d02..17a475d59345 100644 --- a/test/DebugInfo/X86/multiple-aranges.ll +++ b/test/DebugInfo/X86/multiple-aranges.ll @@ -44,14 +44,14 @@ target triple = "x86_64-unknown-linux-gnu" !llvm.dbg.cu = !{!0, !7} !llvm.module.flags = !{!12, !13} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !3, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, 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") !2 = !{} !3 = !{!4} !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: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!7 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !8, enums: !2, retainedTypes: !2, subprograms: !2, globals: !9, imports: !2) +!7 = distinct !DICompileUnit(language: DW_LANG_C99, 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") !9 = !{!10} !10 = !DIGlobalVariable(name: "rainbows", line: 1, isLocal: false, isDefinition: true, scope: null, file: !11, type: !6, variable: i32* @rainbows) diff --git a/test/DebugInfo/X86/multiple-at-const-val.ll b/test/DebugInfo/X86/multiple-at-const-val.ll index 01e3af20d2d4..97db71952905 100644 --- a/test/DebugInfo/X86/multiple-at-const-val.ll +++ b/test/DebugInfo/X86/multiple-at-const-val.ll @@ -19,7 +19,7 @@ @_ZSt4cout = external global %"class.std::basic_ostream" @.str = private unnamed_addr constant [6 x i8] c"c is \00", align 1 -define i32 @main() { +define i32 @main() !dbg !960 { entry: %call1.i = tail call %"class.std::basic_ostream"* @test(%"class.std::basic_ostream"* @_ZSt4cout, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5) ret i32 0 @@ -32,7 +32,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!1803} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 174207)", isOptimized: true, emissionKind: 0, file: !1802, enums: !1, retainedTypes: !955, subprograms: !956, globals: !1786, imports: !955) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 174207)", isOptimized: true, emissionKind: 0, file: !1802, enums: !1, retainedTypes: !955, subprograms: !956, globals: !1786, imports: !955) !1 = !{!26} !4 = !DINamespace(name: "std", line: 48, scope: !5) !5 = !DIFile(filename: "os_base.h", directory: "/privite/tmp") @@ -54,7 +54,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !79 = !DIDerivedType(tag: DW_TAG_typedef, name: "ostate", line: 327, file: !1801, scope: !49, baseType: !26) !955 = !{} !956 = !{!960} -!960 = !DISubprogram(name: "main", line: 73, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 73, file: !1802, scope: null, type: !54, function: i32 ()* @main, variables: !955) +!960 = distinct !DISubprogram(name: "main", line: 73, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 73, file: !1802, scope: null, type: !54, variables: !955) !961 = !DIFile(filename: "student2.cpp", directory: "/privite/tmp") !1786 = !{!1800} !1800 = !DIGlobalVariable(name: "badbit", linkageName: "badbit", line: 331, isLocal: true, isDefinition: true, scope: !5, file: !5, type: !78, variable: i32 1, declaration: !77) diff --git a/test/DebugInfo/X86/nodebug_with_debug_loc.ll b/test/DebugInfo/X86/nodebug_with_debug_loc.ll index 8153b3352d4e..4ccf22bdc5aa 100644 --- a/test/DebugInfo/X86/nodebug_with_debug_loc.ll +++ b/test/DebugInfo/X86/nodebug_with_debug_loc.ll @@ -97,7 +97,7 @@ attributes #3 = { nounwind } !llvm.module.flags = !{!23, !24} !llvm.ident = !{!25} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !10, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !10, globals: !2, imports: !2) !1 = !DIFile(filename: "<stdin>", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} @@ -108,23 +108,23 @@ attributes #3 = { nounwind } !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !9) !9 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) !10 = !{!11, !17} -!11 = !DISubprogram(name: "f", linkageName: "_Z1fv", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 14, file: !5, scope: !12, type: !13, variables: !15) +!11 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 14, file: !5, scope: !12, type: !13, variables: !15) !12 = !DIFile(filename: "repro.cpp", directory: "/tmp/dbginfo") !13 = !DISubroutineType(types: !14) !14 = !{null} !15 = !{!16} -!16 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "str2", line: 15, scope: !11, file: !12, type: !"_ZTS6string") -!17 = !DISubprogram(name: "s2", linkageName: "_Z2s2P6string", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !5, scope: !12, type: !18, variables: !21) +!16 = !DILocalVariable(name: "str2", line: 15, scope: !11, file: !12, type: !"_ZTS6string") +!17 = distinct !DISubprogram(name: "s2", linkageName: "_Z2s2P6string", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !5, scope: !12, type: !18, variables: !21) !18 = !DISubroutineType(types: !19) !19 = !{null, !20} !20 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !"_ZTS6string") !21 = !{!22} -!22 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "lhs", line: 13, arg: 1, scope: !17, file: !12, type: !20) +!22 = !DILocalVariable(name: "lhs", line: 13, arg: 1, scope: !17, file: !12, type: !20) !23 = !{i32 2, !"Dwarf Version", i32 4} !24 = !{i32 2, !"Debug Info Version", i32 3} !25 = !{!"clang version 3.5.0 "} !26 = !DILocation(line: 15, scope: !11) -!27 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "lhs", line: 13, arg: 1, scope: !17, file: !12, type: !20) +!27 = !DILocalVariable(name: "lhs", line: 13, arg: 1, scope: !17, file: !12, type: !20) !28 = !DILocation(line: 16, scope: !11) !29 = !DILocation(line: 13, scope: !17, inlinedAt: !28) !30 = !DILocation(line: 17, scope: !11) diff --git a/test/DebugInfo/X86/nondefault-subrange-array.ll b/test/DebugInfo/X86/nondefault-subrange-array.ll index 20406cfa0f16..fc82fa560a40 100644 --- a/test/DebugInfo/X86/nondefault-subrange-array.ll +++ b/test/DebugInfo/X86/nondefault-subrange-array.ll @@ -30,7 +30,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!21} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: 0, file: !20, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: 0, file: !20, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) !1 = !{} !3 = !{!5} !5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %class.A* @a) diff --git a/test/DebugInfo/X86/nophysreg.ll b/test/DebugInfo/X86/nophysreg.ll index f4478efb67f8..ddf014b43b77 100644 --- a/test/DebugInfo/X86/nophysreg.ll +++ b/test/DebugInfo/X86/nophysreg.ll @@ -53,7 +53,7 @@ target triple = "x86_64-apple-macosx10.10.0" %struct.A = type { i32*, i32 } ; Function Attrs: alwaysinline ssp uwtable -define void @_Z2f21A(i32* %p5.coerce0, i32 %p5.coerce1) #0 { +define void @_Z2f21A(i32* %p5.coerce0, i32 %p5.coerce1) #0 !dbg !11 { entry: tail call void @llvm.dbg.value(metadata i32* %p5.coerce0, i64 0, metadata !16, metadata !33), !dbg !34 tail call void @llvm.dbg.value(metadata i32 %p5.coerce1, i64 0, metadata !16, metadata !35), !dbg !34 @@ -68,7 +68,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 declare void @_Z2f1Pii(i32*, i32) #2 ; Function Attrs: ssp uwtable -define void @_Z1fv() #3 { +define void @_Z1fv() #3 !dbg !17 { entry: %x = alloca i32, align 4 %ref.tmp = alloca i32, align 4 @@ -136,7 +136,7 @@ attributes #3 = { ssp uwtable } !llvm.module.flags = !{!29, !30, !31} !llvm.ident = !{!32} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 (trunk 227088) (llvm/trunk 227091)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !10, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 (trunk 227088) (llvm/trunk 227091)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !10, globals: !2, imports: !2) !1 = !DIFile(filename: "test.cpp", directory: "") !2 = !{} !3 = !{!4} @@ -147,24 +147,24 @@ attributes #3 = { ssp uwtable } !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !9 = !DIDerivedType(tag: DW_TAG_member, name: "m2", line: 3, size: 32, align: 32, offset: 64, file: !1, scope: !"_ZTS1A", baseType: !8) !10 = !{!11, !17} -!11 = !DISubprogram(name: "f2", linkageName: "_Z2f21A", line: 7, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 7, file: !1, scope: !12, type: !13, function: void (i32*, i32)* @_Z2f21A, variables: !15) +!11 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f21A", line: 7, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 7, file: !1, scope: !12, type: !13, variables: !15) !12 = !DIFile(filename: "test.cpp", directory: "") !13 = !DISubroutineType(types: !14) !14 = !{null, !"_ZTS1A"} !15 = !{!16} -!16 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "p5", line: 7, arg: 1, scope: !11, file: !12, type: !"_ZTS1A") -!17 = !DISubprogram(name: "f", linkageName: "_Z1fv", line: 12, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 12, file: !1, scope: !12, type: !18, function: void ()* @_Z1fv, variables: !20) +!16 = !DILocalVariable(name: "p5", line: 7, arg: 1, scope: !11, file: !12, type: !"_ZTS1A") +!17 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", line: 12, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 12, file: !1, scope: !12, type: !18, variables: !20) !18 = !DISubroutineType(types: !19) !19 = !{null} !20 = !{!21, !23, !26, !27, !28} -!21 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "x", line: 14, scope: !22, file: !12, type: !8) +!21 = !DILocalVariable(name: "x", line: 14, scope: !22, file: !12, type: !8) !22 = distinct !DILexicalBlock(line: 13, column: 18, file: !1, scope: !17) -!23 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "y", line: 17, scope: !24, file: !12, type: !25) +!23 = !DILocalVariable(name: "y", line: 17, scope: !24, file: !12, type: !25) !24 = distinct !DILexicalBlock(line: 16, column: 20, file: !1, scope: !22) !25 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) -!26 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "j", line: 19, scope: !24, file: !12, type: !25) -!27 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "I", line: 21, scope: !24, file: !12, type: !25) -!28 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "g", line: 24, scope: !24, file: !12, type: !"_ZTS1A") +!26 = !DILocalVariable(name: "j", line: 19, scope: !24, file: !12, type: !25) +!27 = !DILocalVariable(name: "I", line: 21, scope: !24, file: !12, type: !25) +!28 = !DILocalVariable(name: "g", line: 24, scope: !24, file: !12, type: !"_ZTS1A") !29 = !{i32 2, !"Dwarf Version", i32 2} !30 = !{i32 2, !"Debug Info Version", i32 3} !31 = !{i32 1, !"PIC Level", i32 2} @@ -196,7 +196,7 @@ attributes #3 = { ssp uwtable } !57 = !DILocation(line: 23, column: 15, scope: !24) !58 = !DILocation(line: 23, column: 7, scope: !24) !59 = !DILocation(line: 24, column: 9, scope: !24) -!60 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "p5", line: 7, arg: 1, scope: !11, file: !12, type: !"_ZTS1A") +!60 = !DILocalVariable(name: "p5", line: 7, arg: 1, scope: !11, file: !12, type: !"_ZTS1A") !61 = distinct !DILocation(line: 26, column: 7, scope: !24) !62 = !DILocation(line: 7, column: 42, scope: !11, inlinedAt: !61) !63 = !DILocation(line: 7, column: 48, scope: !11, inlinedAt: !61) diff --git a/test/DebugInfo/X86/objc-fwd-decl.ll b/test/DebugInfo/X86/objc-fwd-decl.ll index 5b0aca5f92f5..30024dc414b5 100644 --- a/test/DebugInfo/X86/objc-fwd-decl.ll +++ b/test/DebugInfo/X86/objc-fwd-decl.ll @@ -12,7 +12,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!9, !10, !11, !12, !14} -!0 = !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.1 (trunk 152054 trunk 152094)", isOptimized: false, runtimeVersion: 2, emissionKind: 0, file: !13, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.1 (trunk 152054 trunk 152094)", isOptimized: false, runtimeVersion: 2, emissionKind: 0, file: !13, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) !1 = !{} !3 = !{!5} !5 = !DIGlobalVariable(name: "a", line: 3, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %0** @a) diff --git a/test/DebugInfo/X86/objc-property-void.ll b/test/DebugInfo/X86/objc-property-void.ll index 0737fe2d2cb4..190d5fe00e7f 100644 --- a/test/DebugInfo/X86/objc-property-void.ll +++ b/test/DebugInfo/X86/objc-property-void.ll @@ -51,7 +51,7 @@ target triple = "x86_64-apple-macosx10.9.0" @llvm.used = appending global [8 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01L_OBJC_CLASS_NAME_", i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @"\01L_OBJC_METH_VAR_TYPE_", i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01l_OBJC_$_INSTANCE_METHODS_Foo" to i8*), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01L_OBJC_PROP_NAME_ATTR_", i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @"\01L_OBJC_PROP_NAME_ATTR_1", i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._prop_t] }* @"\01l_OBJC_$_PROP_LIST_Foo" to i8*), i8* bitcast ([1 x i8*]* @"\01L_OBJC_LABEL_CLASS_$" to i8*)], section "llvm.metadata" ; Function Attrs: ssp uwtable -define internal void @"\01-[Foo foo]"(%0* %self, i8* %_cmd) #0 { +define internal void @"\01-[Foo foo]"(%0* %self, i8* %_cmd) #0 !dbg !10 { entry: %self.addr = alloca %0*, align 8 %_cmd.addr = alloca i8*, align 8 @@ -72,7 +72,7 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!17, !18, !19, !20, !21, !22} !llvm.ident = !{!23} -!0 = !DICompileUnit(language: DW_LANG_ObjC, isOptimized: false, runtimeVersion: 2, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, isOptimized: false, runtimeVersion: 2, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !2, imports: !2) !1 = !DIFile(filename: "-", directory: "") !2 = !{} !3 = !{!4} @@ -82,7 +82,7 @@ attributes #1 = { nounwind readnone } !7 = !{!8} !8 = !DIObjCProperty(name: "foo", line: 2, attributes: 2117, file: !6) !9 = !{!10} -!10 = !DISubprogram(name: "-[Foo foo]", line: 5, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !5, scope: !6, type: !11, function: void (%0*, i8*)* @"\01-[Foo foo]", variables: !2) +!10 = distinct !DISubprogram(name: "-[Foo foo]", line: 5, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !5, scope: !6, type: !11, variables: !2) !11 = !DISubroutineType(types: !12) !12 = !{null, !13, !14} !13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4) @@ -96,9 +96,9 @@ attributes #1 = { nounwind readnone } !21 = !{i32 2, !"Dwarf Version", i32 2} !22 = !{i32 1, !"Debug Info Version", i32 3} !23 = !{!""} -!24 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "self", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !10, type: !25) +!24 = !DILocalVariable(name: "self", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !10, type: !25) !25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4) !26 = !DILocation(line: 0, scope: !10) -!27 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "_cmd", arg: 2, flags: DIFlagArtificial, scope: !10, type: !28) +!27 = !DILocalVariable(name: "_cmd", arg: 2, flags: DIFlagArtificial, scope: !10, type: !28) !28 = !DIDerivedType(tag: DW_TAG_typedef, name: "SEL", line: 5, file: !5, baseType: !15) !29 = !DILocation(line: 5, scope: !10) diff --git a/test/DebugInfo/X86/op_deref.ll b/test/DebugInfo/X86/op_deref.ll index 86f629e9c152..535c7390a54c 100644 --- a/test/DebugInfo/X86/op_deref.ll +++ b/test/DebugInfo/X86/op_deref.ll @@ -20,13 +20,13 @@ ; right now, so we check the asm output: ; RUN: llc -O0 -mtriple=x86_64-apple-darwin %s -o - -filetype=asm | FileCheck %s -check-prefix=ASM-CHECK ; vla should have a register-indirect address at one point. -; ASM-CHECK: DEBUG_VALUE: vla <- RCX +; ASM-CHECK: DEBUG_VALUE: vla <- [%RCX+0] ; ASM-CHECK: DW_OP_breg2 ; RUN: llvm-as %s -o - | llvm-dis - | FileCheck %s --check-prefix=PRETTY-PRINT -; PRETTY-PRINT: DIExpression(DW_OP_deref, DW_OP_deref) +; PRETTY-PRINT: DIExpression(DW_OP_deref) -define void @testVLAwithSize(i32 %s) nounwind uwtable ssp { +define void @testVLAwithSize(i32 %s) nounwind uwtable ssp !dbg !5 { entry: %s.addr = alloca i32, align 4 %saved_stack = alloca i8* @@ -80,24 +80,24 @@ declare void @llvm.stackrestore(i8*) nounwind !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!29} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 156005) (llvm/trunk 156000)", isOptimized: false, emissionKind: 1, file: !28, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 156005) (llvm/trunk 156000)", isOptimized: false, emissionKind: 1, file: !28, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "testVLAwithSize", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !28, scope: !6, type: !7, function: void (i32)* @testVLAwithSize, variables: !1) +!5 = distinct !DISubprogram(name: "testVLAwithSize", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !28, scope: !6, type: !7, variables: !1) !6 = !DIFile(filename: "bar.c", directory: "/Users/echristo/tmp") !7 = !DISubroutineType(types: !8) !8 = !{null, !9} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "s", line: 1, arg: 1, scope: !5, file: !6, type: !9) +!10 = !DILocalVariable(name: "s", line: 1, arg: 1, scope: !5, file: !6, type: !9) !11 = !DILocation(line: 1, column: 26, scope: !5) !12 = !DILocation(line: 3, column: 13, scope: !13) !13 = distinct !DILexicalBlock(line: 2, column: 1, file: !28, scope: !5) -!14 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "vla", line: 3, scope: !13, file: !6, type: !15) +!14 = !DILocalVariable(name: "vla", line: 3, scope: !13, file: !6, type: !15) !15 = !DICompositeType(tag: DW_TAG_array_type, align: 32, baseType: !9, elements: !16) !16 = !{!17} !17 = !DISubrange(count: -1) !18 = !DILocation(line: 3, column: 7, scope: !13) -!19 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 4, scope: !13, file: !6, type: !9) +!19 = !DILocalVariable(name: "i", line: 4, scope: !13, file: !6, type: !9) !20 = !DILocation(line: 4, column: 7, scope: !13) !21 = !DILocation(line: 5, column: 8, scope: !22) !22 = distinct !DILexicalBlock(line: 5, column: 3, file: !28, scope: !13) @@ -108,4 +108,4 @@ declare void @llvm.stackrestore(i8*) nounwind !27 = !DILocation(line: 8, column: 1, scope: !13) !28 = !DIFile(filename: "bar.c", directory: "/Users/echristo/tmp") !29 = !{i32 1, !"Debug Info Version", i32 3} -!30 = !DIExpression(DW_OP_deref, DW_OP_deref) +!30 = !DIExpression(DW_OP_deref) diff --git a/test/DebugInfo/X86/parameters.ll b/test/DebugInfo/X86/parameters.ll index 044f51e6e6b9..1d71efc0719d 100644 --- a/test/DebugInfo/X86/parameters.ll +++ b/test/DebugInfo/X86/parameters.ll @@ -40,7 +40,7 @@ %"struct.pr14763::foo" = type { i8 } ; Function Attrs: uwtable -define void @_ZN7pr147634funcENS_3fooE(%"struct.pr14763::foo"* noalias sret %agg.result, %"struct.pr14763::foo"* %f) #0 { +define void @_ZN7pr147634funcENS_3fooE(%"struct.pr14763::foo"* noalias sret %agg.result, %"struct.pr14763::foo"* %f) #0 !dbg !4 { entry: call void @llvm.dbg.declare(metadata %"struct.pr14763::foo"* %f, metadata !22, metadata !DIExpression(DW_OP_deref)), !dbg !24 call void @_ZN7pr147633fooC1ERKS0_(%"struct.pr14763::foo"* %agg.result, %"struct.pr14763::foo"* %f), !dbg !25 @@ -53,7 +53,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 declare void @_ZN7pr147633fooC1ERKS0_(%"struct.pr14763::foo"*, %"struct.pr14763::foo"*) #2 ; Function Attrs: uwtable -define void @_ZN7pr147635func2EbNS_3fooE(i1 zeroext %b, %"struct.pr14763::foo"* %g) #0 { +define void @_ZN7pr147635func2EbNS_3fooE(i1 zeroext %b, %"struct.pr14763::foo"* %g) #0 !dbg !17 { entry: %b.addr = alloca i8, align 1 %frombool = zext i1 %b to i8 @@ -82,11 +82,11 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!21, !33} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "pass.cpp", directory: "/tmp") !2 = !{} !3 = !{!4, !17} -!4 = !DISubprogram(name: "func", linkageName: "_ZN7pr147634funcENS_3fooE", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, function: void (%"struct.pr14763::foo"*, %"struct.pr14763::foo"*)* @_ZN7pr147634funcENS_3fooE, variables: !2) +!4 = distinct !DISubprogram(name: "func", linkageName: "_ZN7pr147634funcENS_3fooE", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, variables: !2) !5 = !DINamespace(name: "pr14763", line: 1, file: !1, scope: null) !6 = !DISubroutineType(types: !7) !7 = !{!8, !8} @@ -98,18 +98,18 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !8) !14 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !15) !15 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8) -!17 = !DISubprogram(name: "func2", linkageName: "_ZN7pr147635func2EbNS_3fooE", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 12, file: !1, scope: !5, type: !18, function: void (i1, %"struct.pr14763::foo"*)* @_ZN7pr147635func2EbNS_3fooE, variables: !2) +!17 = distinct !DISubprogram(name: "func2", linkageName: "_ZN7pr147635func2EbNS_3fooE", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 12, file: !1, scope: !5, type: !18, variables: !2) !18 = !DISubroutineType(types: !19) !19 = !{null, !20, !8} !20 = !DIBasicType(tag: DW_TAG_base_type, name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean) !21 = !{i32 2, !"Dwarf Version", i32 3} -!22 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "f", line: 6, arg: 1, scope: !4, file: !23, type: !8) +!22 = !DILocalVariable(name: "f", line: 6, arg: 1, scope: !4, file: !23, type: !8) !23 = !DIFile(filename: "pass.cpp", directory: "/tmp") !24 = !DILocation(line: 6, scope: !4) !25 = !DILocation(line: 7, scope: !4) -!26 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 12, arg: 1, scope: !17, file: !23, type: !20) +!26 = !DILocalVariable(name: "b", line: 12, arg: 1, scope: !17, file: !23, type: !20) !27 = !DILocation(line: 12, scope: !17) -!28 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "g", line: 12, arg: 2, scope: !17, file: !23, type: !8) +!28 = !DILocalVariable(name: "g", line: 12, arg: 2, scope: !17, file: !23, type: !8) !29 = !DILocation(line: 13, scope: !30) !30 = distinct !DILexicalBlock(line: 13, column: 0, file: !1, scope: !17) !31 = !DILocation(line: 14, scope: !30) diff --git a/test/DebugInfo/X86/pieces-1.ll b/test/DebugInfo/X86/pieces-1.ll index f96e045f8285..9d4f5265b3c2 100644 --- a/test/DebugInfo/X86/pieces-1.ll +++ b/test/DebugInfo/X86/pieces-1.ll @@ -30,7 +30,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.9.0" ; Function Attrs: nounwind ssp uwtable -define i32 @foo(i64 %s.coerce0, i32 %s.coerce1) #0 { +define i32 @foo(i64 %s.coerce0, i32 %s.coerce1) #0 !dbg !4 { entry: call void @llvm.dbg.value(metadata i64 %s.coerce0, i64 0, metadata !20, metadata !24), !dbg !21 call void @llvm.dbg.value(metadata i32 %s.coerce1, i64 0, metadata !22, metadata !27), !dbg !21 @@ -50,11 +50,11 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!17, !18} !llvm.ident = !{!19} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "pieces.c", directory: "") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, function: i32 (i64, i32)* @foo, variables: !15) +!4 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !15) !5 = !DIFile(filename: "pieces.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{!8, !9} @@ -66,13 +66,13 @@ attributes #1 = { nounwind readnone } !13 = !DIBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed) !14 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 1, size: 32, align: 32, offset: 64, file: !1, scope: !10, baseType: !8) !15 = !{!16} -!16 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9) +!16 = !DILocalVariable(name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9) !17 = !{i32 2, !"Dwarf Version", i32 4} !18 = !{i32 1, !"Debug Info Version", i32 3} !19 = !{!"clang version 3.5 "} -!20 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9) +!20 = !DILocalVariable(name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9) !21 = !DILocation(line: 3, scope: !4) -!22 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9) +!22 = !DILocalVariable(name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9) !23 = !DILocation(line: 4, scope: !4) !24 = !DIExpression(DW_OP_bit_piece, 0, 64) !25 = !{} diff --git a/test/DebugInfo/X86/pieces-2.ll b/test/DebugInfo/X86/pieces-2.ll index 7c39d323c3e3..8a43f452d32b 100644 --- a/test/DebugInfo/X86/pieces-2.ll +++ b/test/DebugInfo/X86/pieces-2.ll @@ -29,7 +29,7 @@ target triple = "x86_64-apple-macosx10.9.0" %struct.Inner = type { i32, i64 } ; Function Attrs: nounwind ssp uwtable -define i32 @foo(%struct.Outer* byval align 8 %outer) #0 { +define i32 @foo(%struct.Outer* byval align 8 %outer) #0 !dbg !4 { entry: call void @llvm.dbg.declare(metadata %struct.Outer* %outer, metadata !25, metadata !DIExpression()), !dbg !26 %i1.sroa.0.0..sroa_idx = getelementptr inbounds %struct.Outer, %struct.Outer* %outer, i64 0, i32 0, i64 1, i32 0, !dbg !27 @@ -57,11 +57,11 @@ attributes #2 = { nounwind } !llvm.module.flags = !{!22, !23} !llvm.ident = !{!24} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "sroasplit-1.c", directory: "") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !5, type: !6, function: i32 (%struct.Outer*)* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "sroasplit-1.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{!8, !9} @@ -82,10 +82,10 @@ attributes #2 = { nounwind } !22 = !{i32 2, !"Dwarf Version", i32 2} !23 = !{i32 1, !"Debug Info Version", i32 3} !24 = !{!"clang version 3.5.0 "} -!25 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "outer", line: 10, arg: 1, scope: !4, file: !5, type: !9) +!25 = !DILocalVariable(name: "outer", line: 10, arg: 1, scope: !4, file: !5, type: !9) !26 = !DILocation(line: 10, scope: !4) !27 = !DILocation(line: 11, scope: !4) -!28 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i1", line: 11, scope: !4, file: !5, type: !14) +!28 = !DILocalVariable(name: "i1", line: 11, scope: !4, file: !5, type: !14) !29 = !DIExpression(DW_OP_bit_piece, 0, 32) !31 = !{i32 3, i32 0, i32 12} !32 = !DILocation(line: 12, scope: !4) diff --git a/test/DebugInfo/X86/pieces-3.ll b/test/DebugInfo/X86/pieces-3.ll index 97ff9aadfcfc..7a93e393b25f 100644 --- a/test/DebugInfo/X86/pieces-3.ll +++ b/test/DebugInfo/X86/pieces-3.ll @@ -26,7 +26,7 @@ ; CHECK: .debug_loc ; CHECK: [[LOC]]: ; CHECK: Beginning address offset: 0x0000000000000000 -; CHECK: Ending address offset: 0x0000000000000004 +; CHECK: Ending address offset: 0x0000000000000008 ; rdi, piece 0x00000008, piece 0x00000004, rsi, piece 0x00000004 ; CHECK: Location description: 55 93 08 93 04 54 93 04 ; @@ -35,7 +35,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.9.0" ; Function Attrs: nounwind ssp uwtable -define i32 @foo(i64 %outer.coerce0, i64 %outer.coerce1) #0 { +define i32 @foo(i64 %outer.coerce0, i64 %outer.coerce1) #0 !dbg !4 { call void @llvm.dbg.value(metadata i64 %outer.coerce0, i64 0, metadata !24, metadata !25), !dbg !26 call void @llvm.dbg.declare(metadata !{null}, metadata !27, metadata !28), !dbg !26 call void @llvm.dbg.value(metadata i64 %outer.coerce1, i64 0, metadata !29, metadata !30), !dbg !26 @@ -67,11 +67,11 @@ attributes #2 = { nounwind } !llvm.module.flags = !{!21, !22} !llvm.ident = !{!23} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "sroasplit-2.c", directory: "") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !5, type: !6, function: i32 (i64, i64)* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "sroasplit-2.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{!8, !9} @@ -91,16 +91,16 @@ attributes #2 = { nounwind } !21 = !{i32 2, !"Dwarf Version", i32 2} !22 = !{i32 1, !"Debug Info Version", i32 3} !23 = !{!"clang version 3.5.0 "} -!24 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "outer", line: 10, arg: 1, scope: !4, file: !5, type: !9) +!24 = !DILocalVariable(name: "outer", line: 10, arg: 1, scope: !4, file: !5, type: !9) !25 = !DIExpression(DW_OP_bit_piece, 0, 64) !26 = !DILocation(line: 10, scope: !4) -!27 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "outer", line: 10, arg: 1, scope: !4, file: !5, type: !9) +!27 = !DILocalVariable(name: "outer", line: 10, arg: 1, scope: !4, file: !5, type: !9) !28 = !DIExpression(DW_OP_bit_piece, 64, 64) -!29 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "outer", line: 10, arg: 1, scope: !4, file: !5, type: !9) +!29 = !DILocalVariable(name: "outer", line: 10, arg: 1, scope: !4, file: !5, type: !9) !30 = !DIExpression(DW_OP_bit_piece, 96, 32) -!31 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "outer", line: 10, arg: 1, scope: !4, file: !5, type: !9) +!31 = !DILocalVariable(name: "outer", line: 10, arg: 1, scope: !4, file: !5, type: !9) !32 = !DIExpression(DW_OP_bit_piece, 64, 32) !33 = !DILocation(line: 11, scope: !4) -!34 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i1", line: 11, scope: !4, file: !5, type: !14) +!34 = !DILocalVariable(name: "i1", line: 11, scope: !4, file: !5, type: !14) !35 = !DIExpression(DW_OP_bit_piece, 0, 32) !36 = !DILocation(line: 12, scope: !4) diff --git a/test/DebugInfo/X86/pointer-type-size.ll b/test/DebugInfo/X86/pointer-type-size.ll index f5abdfe89251..cc43c7604c08 100644 --- a/test/DebugInfo/X86/pointer-type-size.ll +++ b/test/DebugInfo/X86/pointer-type-size.ll @@ -11,7 +11,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!14} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 147882)", isOptimized: false, emissionKind: 0, file: !13, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 147882)", isOptimized: false, emissionKind: 0, file: !13, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) !1 = !{} !3 = !{!5} !5 = !DIGlobalVariable(name: "crass", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %struct.crass* @crass) diff --git a/test/DebugInfo/X86/pr11300.ll b/test/DebugInfo/X86/pr11300.ll index b68609dd7184..c6124687b2c4 100644 --- a/test/DebugInfo/X86/pr11300.ll +++ b/test/DebugInfo/X86/pr11300.ll @@ -14,7 +14,7 @@ %struct.foo = type { i8 } -define void @_Z3zedP3foo(%struct.foo* %x) uwtable { +define void @_Z3zedP3foo(%struct.foo* %x) uwtable !dbg !5 { entry: %x.addr = alloca %struct.foo*, align 8 store %struct.foo* %x, %struct.foo** %x.addr, align 8 @@ -26,7 +26,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone -define linkonce_odr void @_ZN3foo3barEv(%struct.foo* %this) nounwind uwtable align 2 { +define linkonce_odr void @_ZN3foo3barEv(%struct.foo* %this) nounwind uwtable align 2 !dbg !20 { entry: %this.addr = alloca %struct.foo*, align 8 store %struct.foo* %this, %struct.foo** %this.addr, align 8 @@ -38,10 +38,10 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!33} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 ()", isOptimized: false, emissionKind: 0, file: !32, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 ()", isOptimized: false, emissionKind: 0, file: !32, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5, !20} -!5 = !DISubprogram(name: "zed", linkageName: "_Z3zedP3foo", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !6, scope: !6, type: !7, function: void (%struct.foo*)* @_Z3zedP3foo) +!5 = distinct !DISubprogram(name: "zed", linkageName: "_Z3zedP3foo", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !6, scope: !6, type: !7) !6 = !DIFile(filename: "/home/espindola/llvm/test.cc", directory: "/home/espindola/tmpfs/build") !7 = !DISubroutineType(types: !8) !8 = !{null, !9} @@ -52,13 +52,13 @@ entry: !13 = !DISubroutineType(types: !14) !14 = !{null, !15} !15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, baseType: !10) -!20 = !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !6, scope: null, type: !13, function: void (%struct.foo*)* @_ZN3foo3barEv, declaration: !12) -!23 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "x", line: 4, arg: 1, scope: !5, file: !6, type: !9) +!20 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !6, scope: null, type: !13, declaration: !12) +!23 = !DILocalVariable(name: "x", line: 4, arg: 1, scope: !5, file: !6, type: !9) !24 = !DILocation(line: 4, column: 15, scope: !5) !25 = !DILocation(line: 4, column: 20, scope: !26) !26 = distinct !DILexicalBlock(line: 4, column: 18, file: !6, scope: !5) !27 = !DILocation(line: 4, column: 30, scope: !26) -!28 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 2, arg: 1, flags: DIFlagArtificial, scope: !20, file: !6, type: !15) +!28 = !DILocalVariable(name: "this", line: 2, arg: 1, flags: DIFlagArtificial, scope: !20, file: !6, type: !15) !29 = !DILocation(line: 2, column: 8, scope: !20) !30 = !DILocation(line: 2, column: 15, scope: !31) !31 = distinct !DILexicalBlock(line: 2, column: 14, file: !6, scope: !20) diff --git a/test/DebugInfo/X86/pr12831.ll b/test/DebugInfo/X86/pr12831.ll index 98b9ce488603..89f599838977 100644 --- a/test/DebugInfo/X86/pr12831.ll +++ b/test/DebugInfo/X86/pr12831.ll @@ -9,10 +9,10 @@ target triple = "x86_64-unknown-linux-gnu" %class.anon = type { i8 } %class.anon.0 = type { i8 } -@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" = internal alias void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" -@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" = internal alias void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" +@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" = internal alias void (%class.function*), void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_" +@"_ZN8functionIFvvEEC1IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" = internal alias void (%class.function*), void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_" -define void @_ZN17BPLFunctionWriter9writeExprEv(%class.BPLFunctionWriter* %this) nounwind uwtable align 2 { +define void @_ZN17BPLFunctionWriter9writeExprEv(%class.BPLFunctionWriter* %this) nounwind uwtable align 2 !dbg !5 { entry: %this.addr = alloca %class.BPLFunctionWriter*, align 8 %agg.tmp = alloca %class.function, align 1 @@ -78,10 +78,10 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!162} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 ", isOptimized: false, emissionKind: 0, file: !161, enums: !1, retainedTypes: !1, subprograms: !3, globals: !128) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 ", isOptimized: false, emissionKind: 0, file: !161, enums: !1, retainedTypes: !1, subprograms: !3, globals: !128) !1 = !{} !3 = !{!5, !106, !107, !126, !127} -!5 = !DISubprogram(name: "writeExpr", linkageName: "_ZN17BPLFunctionWriter9writeExprEv", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 19, file: !6, scope: null, type: !7, function: void (%class.BPLFunctionWriter*)* @_ZN17BPLFunctionWriter9writeExprEv, declaration: !103, variables: !1) +!5 = distinct !DISubprogram(name: "writeExpr", linkageName: "_ZN17BPLFunctionWriter9writeExprEv", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 19, file: !6, scope: null, type: !7, declaration: !103, variables: !1) !6 = !DIFile(filename: "BPLFunctionWriter2.ii", directory: "/home/peter/crashdelta") !7 = !DISubroutineType(types: !8) !8 = !{null, !9} @@ -156,8 +156,8 @@ entry: !99 = !DISubroutineType(types: !100) !100 = !{null} !103 = !DISubprogram(name: "writeExpr", linkageName: "_ZN17BPLFunctionWriter9writeExprEv", line: 17, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrivate | DIFlagPrototyped, isOptimized: false, scopeLine: 17, file: !6, scope: !10, type: !7) -!106 = !DISubprogram(name: "function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:23:36> >", linkageName: "_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !6, scope: null, type: !59, function: void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_", templateParams: !82, declaration: !58, variables: !1) -!107 = !DISubprogram(name: "_M_not_empty_function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:23:36> >", linkageName: "_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_1_0EEvRKT_", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: null, type: !108, function: void (%class.anon.0*)* @"_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_1_0EEvRKT_", templateParams: !111, declaration: !113, variables: !1) +!106 = distinct !DISubprogram(name: "function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:23:36> >", linkageName: "_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_1_0EET_", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !6, scope: null, type: !59, templateParams: !82, declaration: !58, variables: !1) +!107 = distinct !DISubprogram(name: "_M_not_empty_function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:23:36> >", linkageName: "_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_1_0EEvRKT_", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: null, type: !108, templateParams: !111, declaration: !113, variables: !1) !108 = !DISubroutineType(types: !109) !109 = !{null, !110} !110 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !61) @@ -172,32 +172,32 @@ entry: !119 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !26) !120 = !{!121} !121 = !DITemplateTypeParameter(name: "_Tp", type: !26) -!126 = !DISubprogram(name: "function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:20:36> >", linkageName: "_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !6, scope: null, type: !23, function: void (%class.function*)* @"_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_", templateParams: !47, declaration: !22, variables: !1) -!127 = !DISubprogram(name: "_M_not_empty_function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:20:36> >", linkageName: "_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_0EEvRKT_", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: null, type: !117, function: void (%class.anon*)* @"_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_0EEvRKT_", templateParams: !120, declaration: !116, variables: !1) +!126 = distinct !DISubprogram(name: "function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:20:36> >", linkageName: "_ZN8functionIFvvEEC2IZN17BPLFunctionWriter9writeExprEvE3$_0EET_", line: 8, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !6, scope: null, type: !23, templateParams: !47, declaration: !22, variables: !1) +!127 = distinct !DISubprogram(name: "_M_not_empty_function<BPLFunctionWriter::<lambda at BPLFunctionWriter2.ii:20:36> >", linkageName: "_ZN13_Base_manager21_M_not_empty_functionIZN17BPLFunctionWriter9writeExprEvE3$_0EEvRKT_", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: null, type: !117, templateParams: !120, declaration: !116, variables: !1) !128 = !{!130} !130 = !DIGlobalVariable(name: "__stored_locally", linkageName: "__stored_locally", line: 2, isLocal: true, isDefinition: true, scope: !114, file: !6, type: !131, variable: i1 1) !131 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !132) !132 = !DIBasicType(tag: DW_TAG_base_type, name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean) -!133 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 19, arg: 1, flags: DIFlagArtificial, scope: !5, file: !6, type: !134) +!133 = !DILocalVariable(name: "this", line: 19, arg: 1, flags: DIFlagArtificial, scope: !5, file: !6, type: !134) !134 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !10) !135 = !DILocation(line: 19, column: 39, scope: !5) !136 = !DILocation(line: 20, column: 17, scope: !137) !137 = distinct !DILexicalBlock(line: 19, column: 51, file: !6, scope: !5) !138 = !DILocation(line: 23, column: 17, scope: !137) !139 = !DILocation(line: 26, column: 15, scope: !137) -!140 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 8, arg: 1, flags: DIFlagArtificial, scope: !106, file: !6, type: !141) +!140 = !DILocalVariable(name: "this", line: 8, arg: 1, flags: DIFlagArtificial, scope: !106, file: !6, type: !141) !141 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !20) !142 = !DILocation(line: 8, column: 45, scope: !106) -!143 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "__f", line: 8, arg: 2, scope: !106, file: !6, type: !61) +!143 = !DILocalVariable(name: "__f", line: 8, arg: 2, scope: !106, file: !6, type: !61) !144 = !DILocation(line: 8, column: 63, scope: !106) !145 = !DILocation(line: 9, column: 9, scope: !146) !146 = distinct !DILexicalBlock(line: 8, column: 81, file: !6, scope: !106) !147 = !DILocation(line: 10, column: 13, scope: !146) !148 = !DILocation(line: 4, column: 5, scope: !149) !149 = distinct !DILexicalBlock(line: 3, column: 105, file: !6, scope: !107) -!150 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 8, arg: 1, flags: DIFlagArtificial, scope: !126, file: !6, type: !141) +!150 = !DILocalVariable(name: "this", line: 8, arg: 1, flags: DIFlagArtificial, scope: !126, file: !6, type: !141) !151 = !DILocation(line: 8, column: 45, scope: !126) -!152 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "__f", line: 8, arg: 2, scope: !126, file: !6, type: !26) +!152 = !DILocalVariable(name: "__f", line: 8, arg: 2, scope: !126, file: !6, type: !26) !153 = !DILocation(line: 8, column: 63, scope: !126) !154 = !DILocation(line: 9, column: 9, scope: !155) !155 = distinct !DILexicalBlock(line: 8, column: 81, file: !6, scope: !126) diff --git a/test/DebugInfo/X86/pr13303.ll b/test/DebugInfo/X86/pr13303.ll index df31a7994469..a369b4259583 100644 --- a/test/DebugInfo/X86/pr13303.ll +++ b/test/DebugInfo/X86/pr13303.ll @@ -5,7 +5,7 @@ ; Check that the prologue ends with is_stmt here. ; CHECK: 0x0000000000000000 {{.*}} is_stmt -define i32 @main() nounwind uwtable { +define i32 @main() nounwind uwtable !dbg !5 { entry: %retval = alloca i32, align 4 store i32 0, i32* %retval @@ -15,10 +15,10 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!13} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 160143)", isOptimized: false, emissionKind: 0, file: !12, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 160143)", isOptimized: false, emissionKind: 0, file: !12, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !12, scope: !6, type: !7, function: i32 ()* @main, variables: !1) +!5 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !12, scope: !6, type: !7, variables: !1) !6 = !DIFile(filename: "PR13303.c", directory: "/home/probinson") !7 = !DISubroutineType(types: !8) !8 = !{!9} diff --git a/test/DebugInfo/X86/pr19307.ll b/test/DebugInfo/X86/pr19307.ll index e04131fe322c..39a800704b19 100644 --- a/test/DebugInfo/X86/pr19307.ll +++ b/test/DebugInfo/X86/pr19307.ll @@ -35,7 +35,7 @@ target triple = "x86_64-unknown-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"items=\00", align 1 ; Function Attrs: uwtable -define void @_Z11parse_rangeRyS_Ss(i64* %offset, i64* %limit, %"class.std::basic_string"* %range) #0 { +define void @_Z11parse_rangeRyS_Ss(i64* %offset, i64* %limit, %"class.std::basic_string"* %range) #0 !dbg !13 { entry: %offset.addr = alloca i64*, align 8 %limit.addr = alloca i64*, align 8 @@ -84,7 +84,7 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !llvm.module.flags = !{!42, !43} !llvm.ident = !{!44} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (209308)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !12, globals: !2, imports: !21) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (209308)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !12, globals: !2, imports: !21) !1 = !DIFile(filename: "pr19307.cc", directory: "/llvm_cmake_gcc") !2 = !{} !3 = !{!4, !6, !8} @@ -97,7 +97,7 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !10 = !DINamespace(name: "std", line: 153, file: !11, scope: null) !11 = !DIFile(filename: "/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu/bits/c++config.h", directory: "/llvm_cmake_gcc") !12 = !{!13} -!13 = !DISubprogram(name: "parse_range", linkageName: "_Z11parse_rangeRyS_Ss", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !14, type: !15, function: void (i64*, i64*, %"class.std::basic_string"*)* @_Z11parse_rangeRyS_Ss, variables: !2) +!13 = distinct !DISubprogram(name: "parse_range", linkageName: "_Z11parse_rangeRyS_Ss", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !14, type: !15, variables: !2) !14 = !DIFile(filename: "pr19307.cc", directory: "/llvm_cmake_gcc") !15 = !DISubroutineType(types: !16) !16 = !{null, !17, !17, !19} @@ -129,10 +129,10 @@ attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "n !42 = !{i32 2, !"Dwarf Version", i32 4} !43 = !{i32 2, !"Debug Info Version", i32 3} !44 = !{!"clang version 3.5.0 (209308)"} -!45 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "offset", line: 3, arg: 1, scope: !13, file: !14, type: !17) +!45 = !DILocalVariable(name: "offset", line: 3, arg: 1, scope: !13, file: !14, type: !17) !46 = !DILocation(line: 3, scope: !13) -!47 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "limit", line: 3, arg: 2, scope: !13, file: !14, type: !17) -!48 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "range", line: 4, arg: 3, scope: !13, file: !14, type: !19) +!47 = !DILocalVariable(name: "limit", line: 3, arg: 2, scope: !13, file: !14, type: !17) +!48 = !DILocalVariable(name: "range", line: 4, arg: 3, scope: !13, file: !14, type: !19) !49 = !DILocation(line: 4, scope: !13) !50 = !DILocation(line: 5, scope: !51) !51 = distinct !DILexicalBlock(line: 5, column: 0, file: !1, scope: !13) diff --git a/test/DebugInfo/X86/processes-relocations.ll b/test/DebugInfo/X86/processes-relocations.ll index bb49e6bef784..e138eaaae6d8 100644 --- a/test/DebugInfo/X86/processes-relocations.ll +++ b/test/DebugInfo/X86/processes-relocations.ll @@ -13,7 +13,7 @@ !llvm.module.flags = !{!3, !4} !llvm.ident = !{!5} -!0 = !DICompileUnit(file: !1, language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2, emissionKind: 1) +!0 = distinct !DICompileUnit(file: !1, language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2, emissionKind: 1) !1 = !DIFile(filename: "empty.c", directory: "/a") !2 = !{} !3 = !{i32 2, !"Dwarf Version", i32 4} diff --git a/test/DebugInfo/X86/prologue-stack.ll b/test/DebugInfo/X86/prologue-stack.ll index cd362e380951..b3447d344e14 100644 --- a/test/DebugInfo/X86/prologue-stack.ll +++ b/test/DebugInfo/X86/prologue-stack.ll @@ -6,7 +6,7 @@ ; return 0; ; } -define i32 @isel_line_test2() nounwind uwtable { +define i32 @isel_line_test2() nounwind uwtable !dbg !5 { ; The stack adjustment should be part of the prologue. ; CHECK: isel_line_test2: ; CHECK: {{subq|leaq}} {{.*}}, %rsp @@ -21,10 +21,10 @@ declare i32 @callme(i32) !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!14} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 164980) (llvm/trunk 164979)", isOptimized: false, emissionKind: 0, file: !13, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 (trunk 164980) (llvm/trunk 164979)", isOptimized: false, emissionKind: 0, file: !13, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "isel_line_test2", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 4, file: !13, scope: !6, type: !7, function: i32 ()* @isel_line_test2, variables: !1) +!5 = distinct !DISubprogram(name: "isel_line_test2", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 4, file: !13, scope: !6, type: !7, variables: !1) !6 = !DIFile(filename: "bar.c", directory: "/usr/local/google/home/echristo/tmp") !7 = !DISubroutineType(types: !8) !8 = !{!9} diff --git a/test/DebugInfo/X86/ref_addr_relocation.ll b/test/DebugInfo/X86/ref_addr_relocation.ll index 488f98ef8e1f..fd074a3a2d91 100644 --- a/test/DebugInfo/X86/ref_addr_relocation.ll +++ b/test/DebugInfo/X86/ref_addr_relocation.ll @@ -58,7 +58,7 @@ !llvm.dbg.cu = !{!0, !9} !llvm.module.flags = !{!14, !15} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 191799)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !6, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 191799)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !6, imports: !2) !1 = !DIFile(filename: "tu1.cpp", directory: "/Users/manmanren/test-Nov/type_unique_air/ref_addr") !2 = !{} !3 = !{!4} @@ -67,7 +67,7 @@ !6 = !{!7} !7 = !DIGlobalVariable(name: "f", line: 2, isLocal: false, isDefinition: true, scope: null, file: !8, type: !4, variable: %struct.foo* @f) !8 = !DIFile(filename: "tu1.cpp", directory: "/Users/manmanren/test-Nov/type_unique_air/ref_addr") -!9 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 191799)", isOptimized: false, emissionKind: 0, file: !10, enums: !2, retainedTypes: !3, subprograms: !2, globals: !11, imports: !2) +!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 191799)", isOptimized: false, emissionKind: 0, file: !10, enums: !2, retainedTypes: !3, subprograms: !2, globals: !11, imports: !2) !10 = !DIFile(filename: "tu2.cpp", directory: "/Users/manmanren/test-Nov/type_unique_air/ref_addr") !11 = !{!12} !12 = !DIGlobalVariable(name: "g", line: 2, isLocal: false, isDefinition: true, scope: null, file: !13, type: !4, variable: %struct.foo* @g) diff --git a/test/DebugInfo/X86/reference-argument.ll b/test/DebugInfo/X86/reference-argument.ll index 401553ec9711..9433b8785311 100644 --- a/test/DebugInfo/X86/reference-argument.ll +++ b/test/DebugInfo/X86/reference-argument.ll @@ -1,10 +1,18 @@ -; RUN: llc -O0 -mtriple=x86_64-apple-darwin -filetype=asm %s -o - | FileCheck %s +; RUN: llc -mtriple=x86_64-apple-macosx10.9.0 -filetype=obj -O0 < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s ; ModuleID = 'aggregate-indirect-arg.cpp' ; extracted from debuginfo-tests/aggregate-indirect-arg.cpp -; v should not be a pointer. -; CHECK: ##DEBUG_VALUE: foo:v <- RSI -; rdar://problem/13658587 +; v should be a pointer. +; CHECK: DW_TAG_subprogram +; CHECK: DW_AT_specification {{.*}} "_ZN1A3fooE4SVal" +; CHECK-NOT: DW_TAG_subprogram +; CHECK: DW_TAG_formal_parameter +; CHECK: DW_AT_name {{.*}} "this" +; CHECK-NOT: DW_TAG_subprogram +; CHECK: DW_TAG_formal_parameter +; rsi+0 +; CHECK-NEXT: DW_AT_location [DW_FORM_block1] (<0x02> 74 00{{ *}}) +; CHECK-NEXT: DW_AT_name {{.*}} "v" 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.9.0" @@ -14,14 +22,15 @@ target triple = "x86_64-apple-macosx10.9.0" declare void @_Z3barR4SVal(%class.SVal* %v) declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 +declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1 declare i32 @main() ; Function Attrs: nounwind ssp uwtable -define linkonce_odr void @_ZN1A3fooE4SVal(%class.A* %this, %class.SVal* %v) nounwind ssp uwtable align 2 { +define linkonce_odr void @_ZN1A3fooE4SVal(%class.A* %this, %class.SVal* %v) nounwind ssp uwtable align 2 !dbg !35 { entry: %this.addr = alloca %class.A*, align 8 store %class.A* %this, %class.A** %this.addr, align 8 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !59, metadata !DIExpression()), !dbg !61 - call void @llvm.dbg.declare(metadata %class.SVal* %v, metadata !62, metadata !DIExpression(DW_OP_deref)), !dbg !61 + call void @llvm.dbg.value(metadata %class.SVal* %v, i64 0, metadata !62, metadata !DIExpression(DW_OP_deref)), !dbg !61 %this1 = load %class.A*, %class.A** %this.addr call void @_Z3barR4SVal(%class.SVal* %v), !dbg !61 ret void, !dbg !61 @@ -32,11 +41,11 @@ declare void @_ZN4SValD2Ev(%class.SVal* %this) !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!47, !68} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "aggregate-indirect-arg.cpp", directory: "") !2 = !{} !3 = !{!4, !29, !33, !34, !35} -!4 = !DISubprogram(name: "bar", linkageName: "_Z3barR4SVal", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 19, file: !1, scope: !5, type: !6, function: void (%class.SVal*)* @_Z3barR4SVal, variables: !2) +!4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barR4SVal", line: 19, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 19, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "aggregate-indirect-arg.cpp", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{null, !8} @@ -58,13 +67,13 @@ declare void @_ZN4SValD2Ev(%class.SVal* %this) !25 = !{null, !19, !26} !26 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !27) !27 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9) -!29 = !DISubprogram(name: "main", line: 25, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 25, file: !1, scope: !5, type: !30, function: i32 ()* @main, variables: !2) +!29 = distinct !DISubprogram(name: "main", line: 25, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 25, file: !1, scope: !5, type: !30, variables: !2) !30 = !DISubroutineType(types: !31) !31 = !{!32} !32 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!33 = !DISubprogram(name: "~SVal", linkageName: "_ZN4SValD1Ev", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 14, file: !1, scope: null, type: !17, function: void (%class.SVal*)* @_ZN4SValD1Ev, declaration: !16, variables: !2) -!34 = !DISubprogram(name: "~SVal", linkageName: "_ZN4SValD2Ev", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 14, file: !1, scope: null, type: !17, function: void (%class.SVal*)* @_ZN4SValD2Ev, declaration: !16, variables: !2) -!35 = !DISubprogram(name: "foo", linkageName: "_ZN1A3fooE4SVal", line: 22, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 22, file: !1, scope: null, type: !36, function: void (%class.A*, %class.SVal*)* @_ZN1A3fooE4SVal, declaration: !41, variables: !2) +!33 = distinct !DISubprogram(name: "~SVal", linkageName: "_ZN4SValD1Ev", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 14, file: !1, scope: null, type: !17, declaration: !16, variables: !2) +!34 = distinct !DISubprogram(name: "~SVal", linkageName: "_ZN4SValD2Ev", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 14, file: !1, scope: null, type: !17, declaration: !16, variables: !2) +!35 = distinct !DISubprogram(name: "foo", linkageName: "_ZN1A3fooE4SVal", line: 22, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 22, file: !1, scope: null, type: !36, declaration: !41, variables: !2) !36 = !DISubroutineType(types: !37) !37 = !{null, !38, !9} !38 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !39) @@ -75,24 +84,24 @@ declare void @_ZN4SValD2Ev(%class.SVal* %this) !44 = !DISubroutineType(types: !45) !45 = !{null, !38} !47 = !{i32 2, !"Dwarf Version", i32 3} -!48 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "v", line: 19, arg: 1, scope: !4, file: !5, type: !8) +!48 = !DILocalVariable(name: "v", line: 19, arg: 1, scope: !4, file: !5, type: !8) !49 = !DILocation(line: 19, scope: !4) -!50 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "v", line: 26, scope: !29, file: !5, type: !9) +!50 = !DILocalVariable(name: "v", line: 26, scope: !29, file: !5, type: !9) !51 = !DILocation(line: 26, scope: !29) !52 = !DILocation(line: 27, scope: !29) !53 = !DILocation(line: 28, scope: !29) -!54 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 29, scope: !29, file: !5, type: !39) +!54 = !DILocalVariable(name: "a", line: 29, scope: !29, file: !5, type: !39) !55 = !DILocation(line: 29, scope: !29) !56 = !DILocation(line: 30, scope: !29) !57 = !DILocation(line: 31, scope: !29) !58 = !DILocation(line: 32, scope: !29) -!59 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 22, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !35, file: !5, type: !60) +!59 = !DILocalVariable(name: "this", line: 22, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !35, file: !5, type: !60) !60 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !39) !61 = !DILocation(line: 22, scope: !35) -!62 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "v", line: 22, arg: 2, scope: !35, file: !5, type: !9) -!63 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 14, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !33, file: !5, type: !64) +!62 = !DILocalVariable(name: "v", line: 22, arg: 2, scope: !35, file: !5, type: !9) +!63 = !DILocalVariable(name: "this", line: 14, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !33, file: !5, type: !64) !64 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9) !65 = !DILocation(line: 14, scope: !33) -!66 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", line: 14, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !34, file: !5, type: !64) +!66 = !DILocalVariable(name: "this", line: 14, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !34, file: !5, type: !64) !67 = !DILocation(line: 14, scope: !34) !68 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/rvalue-ref.ll b/test/DebugInfo/X86/rvalue-ref.ll index 4e4da67beb08..c72a3aa2c04d 100644 --- a/test/DebugInfo/X86/rvalue-ref.ll +++ b/test/DebugInfo/X86/rvalue-ref.ll @@ -5,7 +5,7 @@ @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 -define void @_Z3fooOi(i32* %i) uwtable ssp { +define void @_Z3fooOi(i32* %i) uwtable ssp !dbg !5 { entry: %i.addr = alloca i32*, align 8 store i32* %i, i32** %i.addr, align 8 @@ -23,16 +23,16 @@ declare i32 @printf(i8*, ...) !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!17} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 157054) (llvm/trunk 157060)", isOptimized: false, emissionKind: 0, file: !16, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 157054) (llvm/trunk 157060)", isOptimized: false, emissionKind: 0, file: !16, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "foo", linkageName: "_Z3fooOi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !16, scope: !6, type: !7, function: void (i32*)* @_Z3fooOi, variables: !1) +!5 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooOi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !16, scope: !6, type: !7, variables: !1) !6 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo/tmp") !7 = !DISubroutineType(types: !8) !8 = !{null, !9} !9 = !DIDerivedType(tag: DW_TAG_rvalue_reference_type, baseType: !10) !10 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!11 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 4, arg: 1, scope: !5, file: !6, type: !9) +!11 = !DILocalVariable(name: "i", line: 4, arg: 1, scope: !5, file: !6, type: !9) !12 = !DILocation(line: 4, column: 17, scope: !5) !13 = !DILocation(line: 6, column: 3, scope: !14) !14 = distinct !DILexicalBlock(line: 5, column: 1, file: !16, scope: !5) diff --git a/test/DebugInfo/X86/safestack-byval.ll b/test/DebugInfo/X86/safestack-byval.ll new file mode 100644 index 000000000000..f1f6b6c1d911 --- /dev/null +++ b/test/DebugInfo/X86/safestack-byval.ll @@ -0,0 +1,91 @@ +; Test dwarf codegen for DILocalVariable of a byval function argument that +; points to neither an argument nor an alloca. This kind of IR is generated by +; SafeStack for unsafe byval arguments. +; RUN: llc -mtriple=x86_64-unknown-unknown -stop-after expand-isel-pseudos %s -o /dev/null | FileCheck %s + +; This was built by compiling the following source with SafeStack and +; simplifying the result a little. +; struct S { +; int a[100]; +; }; +; +; int f(S zzz, unsigned long len) { +; return zzz.a[len]; +; } + +; CHECK: ![[ZZZ:.*]] = !DILocalVariable(name: "zzz", +; CHECK: ![[ZZZ_EXPR:.*]] = !DIExpression(DW_OP_deref, DW_OP_minus, 400) +; CHECK: DBG_VALUE {{.*}} ![[ZZZ]], ![[ZZZ_EXPR]] + +%struct.S = type { [100 x i32] } + +@__safestack_unsafe_stack_ptr = external thread_local(initialexec) global i8* + +; Function Attrs: norecurse nounwind readonly safestack uwtable +define i32 @_Z1f1Sm(%struct.S* byval nocapture readonly align 8 %zzz, i64 %len) #0 !dbg !12 { +entry: + %unsafe_stack_ptr = load i8*, i8** @__safestack_unsafe_stack_ptr, !dbg !22 + %unsafe_stack_static_top = getelementptr i8, i8* %unsafe_stack_ptr, i32 -400, !dbg !22 + store i8* %unsafe_stack_static_top, i8** @__safestack_unsafe_stack_ptr, !dbg !22 +; !17 describes "zzz" + call void @llvm.dbg.declare(metadata i8* %unsafe_stack_ptr, metadata !17, metadata !23), !dbg !22 + %0 = getelementptr i8, i8* %unsafe_stack_ptr, i32 -400, !dbg !22 + %zzz.unsafe-byval = bitcast i8* %0 to %struct.S*, !dbg !22 + %1 = bitcast %struct.S* %zzz to i8*, !dbg !24 + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 400, i32 8, i1 false), !dbg !24 + tail call void @llvm.dbg.value(metadata i64 %len, i64 0, metadata !18, metadata !25), !dbg !24 + %arrayidx = getelementptr inbounds %struct.S, %struct.S* %zzz.unsafe-byval, i64 0, i32 0, i64 %len, !dbg !26 + %2 = load i32, i32* %arrayidx, align 4, !dbg !26, !tbaa !27 + store i8* %unsafe_stack_ptr, i8** @__safestack_unsafe_stack_ptr, !dbg !31 + ret i32 %2, !dbg !31 +} + +; 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 + +; Function Attrs: argmemonly nounwind +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #2 + +attributes #0 = { norecurse nounwind readonly safestack uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { nounwind readnone } +attributes #2 = { argmemonly nounwind } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!19, !20} +!llvm.ident = !{!21} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 254107) (llvm/trunk 254109)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !11) +!1 = !DIFile(filename: "../llvm/1.cc", directory: "/tmp/build") +!2 = !{} +!3 = !{!4} +!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !1, line: 4, size: 3200, align: 32, elements: !5, identifier: "_ZTS1S") +!5 = !{!6} +!6 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !"_ZTS1S", file: !1, line: 5, baseType: !7, size: 3200, align: 32) +!7 = !DICompositeType(tag: DW_TAG_array_type, baseType: !8, size: 3200, align: 32, elements: !9) +!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) +!9 = !{!10} +!10 = !DISubrange(count: 100) +!11 = !{!12} +!12 = distinct !DISubprogram(name: "f", linkageName: "_Z1f1Sm", scope: !1, file: !1, line: 8, type: !13, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: true, variables: !16) +!13 = !DISubroutineType(types: !14) +!14 = !{!8, !"_ZTS1S", !15} +!15 = !DIBasicType(name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned) +!16 = !{!17, !18} +!17 = !DILocalVariable(name: "zzz", arg: 1, scope: !12, file: !1, line: 8, type: !"_ZTS1S") +!18 = !DILocalVariable(name: "len", arg: 2, scope: !12, file: !1, line: 8, type: !15) +!19 = !{i32 2, !"Dwarf Version", i32 4} +!20 = !{i32 2, !"Debug Info Version", i32 3} +!21 = !{!"clang version 3.8.0 (trunk 254107) (llvm/trunk 254109)"} +!22 = !DILocation(line: 8, column: 9, scope: !12) +!23 = !DIExpression(DW_OP_deref, DW_OP_minus, 400) +!24 = !DILocation(line: 8, column: 28, scope: !12) +!25 = !DIExpression() +!26 = !DILocation(line: 9, column: 10, scope: !12) +!27 = !{!28, !28, i64 0} +!28 = !{!"int", !29, i64 0} +!29 = !{!"omnipotent char", !30, i64 0} +!30 = !{!"Simple C/C++ TBAA"} +!31 = !DILocation(line: 9, column: 3, scope: !12) diff --git a/test/DebugInfo/X86/sret.ll b/test/DebugInfo/X86/sret.ll index ef8f2e6d65e1..45af28217419 100644 --- a/test/DebugInfo/X86/sret.ll +++ b/test/DebugInfo/X86/sret.ll @@ -14,11 +14,11 @@ @_ZTS1A = linkonce_odr constant [3 x i8] c"1A\00" @_ZTI1A = linkonce_odr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i64 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1A, i32 0, i32 0) } -@_ZN1AC1Ei = alias void (%class.A*, i32)* @_ZN1AC2Ei -@_ZN1AC1ERKS_ = alias void (%class.A*, %class.A*)* @_ZN1AC2ERKS_ +@_ZN1AC1Ei = alias void (%class.A*, i32), void (%class.A*, i32)* @_ZN1AC2Ei +@_ZN1AC1ERKS_ = alias void (%class.A*, %class.A*), void (%class.A*, %class.A*)* @_ZN1AC2ERKS_ ; Function Attrs: nounwind uwtable -define void @_ZN1AC2Ei(%class.A* %this, i32 %i) unnamed_addr #0 align 2 { +define void @_ZN1AC2Ei(%class.A* %this, i32 %i) unnamed_addr #0 align 2 !dbg !49 { entry: %this.addr = alloca %class.A*, align 8 %i.addr = alloca i32, align 4 @@ -39,7 +39,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 ; Function Attrs: nounwind uwtable -define void @_ZN1AC2ERKS_(%class.A* %this, %class.A* %rhs) unnamed_addr #0 align 2 { +define void @_ZN1AC2ERKS_(%class.A* %this, %class.A* %rhs) unnamed_addr #0 align 2 !dbg !50 { entry: %this.addr = alloca %class.A*, align 8 %rhs.addr = alloca %class.A*, align 8 @@ -59,7 +59,7 @@ entry: } ; Function Attrs: nounwind uwtable -define %class.A* @_ZN1AaSERKS_(%class.A* %this, %class.A* %rhs) #0 align 2 { +define %class.A* @_ZN1AaSERKS_(%class.A* %this, %class.A* %rhs) #0 align 2 !dbg !51 { entry: %this.addr = alloca %class.A*, align 8 %rhs.addr = alloca %class.A*, align 8 @@ -77,7 +77,7 @@ entry: } ; Function Attrs: nounwind uwtable -define i32 @_ZN1A7get_intEv(%class.A* %this) #0 align 2 { +define i32 @_ZN1A7get_intEv(%class.A* %this) #0 align 2 !dbg !52 { entry: %this.addr = alloca %class.A*, align 8 store %class.A* %this, %class.A** %this.addr, align 8 @@ -89,7 +89,7 @@ entry: } ; Function Attrs: uwtable -define void @_ZN1B9AInstanceEv(%class.A* noalias sret %agg.result, %class.B* %this) #2 align 2 { +define void @_ZN1B9AInstanceEv(%class.A* noalias sret %agg.result, %class.B* %this) #2 align 2 !dbg !53 { entry: %this.addr = alloca %class.B*, align 8 %nrvo = alloca i1 @@ -114,7 +114,7 @@ nrvo.skipdtor: ; preds = %nrvo.unused, %entry } ; Function Attrs: nounwind uwtable -define linkonce_odr void @_ZN1AD2Ev(%class.A* %this) unnamed_addr #0 align 2 { +define linkonce_odr void @_ZN1AD2Ev(%class.A* %this) unnamed_addr #0 align 2 !dbg !63 { entry: %this.addr = alloca %class.A*, align 8 store %class.A* %this, %class.A** %this.addr, align 8 @@ -124,7 +124,7 @@ entry: } ; Function Attrs: uwtable -define i32 @main(i32 %argc, i8** %argv) #2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define i32 @main(i32 %argc, i8** %argv) #2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !54 { entry: %retval = alloca i32, align 4 %argc.addr = alloca i32, align 4 @@ -189,7 +189,7 @@ terminate.lpad: ; preds = %lpad } ; Function Attrs: nounwind uwtable -define linkonce_odr void @_ZN1BC2Ev(%class.B* %this) unnamed_addr #0 align 2 { +define linkonce_odr void @_ZN1BC2Ev(%class.B* %this) unnamed_addr #0 align 2 !dbg !62 { entry: %this.addr = alloca %class.B*, align 8 store %class.B* %this, %class.B** %this.addr, align 8 @@ -212,7 +212,7 @@ declare i8* @__cxa_begin_catch(i8*) declare void @_ZSt9terminatev() ; Function Attrs: uwtable -define linkonce_odr void @_ZN1AD0Ev(%class.A* %this) unnamed_addr #2 align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +define linkonce_odr void @_ZN1AD0Ev(%class.A* %this) unnamed_addr #2 align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !61 { entry: %this.addr = alloca %class.A*, align 8 %exn.slot = alloca i8* @@ -263,7 +263,7 @@ attributes #7 = { builtin nounwind } !llvm.module.flags = !{!64, !65} !llvm.ident = !{!66} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 203283) (llvm/trunk 203307)", isOptimized: false, splitDebugFilename: "sret.dwo", emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !48, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 203283) (llvm/trunk 203307)", isOptimized: false, splitDebugFilename: "sret.dwo", emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !48, globals: !2, imports: !2) !1 = !DIFile(filename: "sret.cpp", directory: "/usr/local/google/home/echristo/tmp") !2 = !{} !3 = !{!4, !37} @@ -305,51 +305,51 @@ attributes #7 = { builtin nounwind } !45 = !DISubroutineType(types: !46) !46 = !{!4, !42} !48 = !{!49, !50, !51, !52, !53, !54, !61, !62, !63} -!49 = !DISubprogram(name: "A", linkageName: "_ZN1AC2Ei", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 18, file: !1, scope: !"_ZTS1A", type: !15, function: void (%class.A*, i32)* @_ZN1AC2Ei, declaration: !14, variables: !2) -!50 = !DISubprogram(name: "A", linkageName: "_ZN1AC2ERKS_", line: 21, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 23, file: !1, scope: !"_ZTS1A", type: !20, function: void (%class.A*, %class.A*)* @_ZN1AC2ERKS_, declaration: !19, variables: !2) -!51 = !DISubprogram(name: "operator=", linkageName: "_ZN1AaSERKS_", line: 27, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 28, file: !1, scope: !"_ZTS1A", type: !26, function: %class.A* (%class.A*, %class.A*)* @_ZN1AaSERKS_, declaration: !25, variables: !2) -!52 = !DISubprogram(name: "get_int", linkageName: "_ZN1A7get_intEv", line: 33, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 34, file: !1, scope: !"_ZTS1A", type: !34, function: i32 (%class.A*)* @_ZN1A7get_intEv, declaration: !33, variables: !2) -!53 = !DISubprogram(name: "AInstance", linkageName: "_ZN1B9AInstanceEv", line: 47, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 48, file: !1, scope: !"_ZTS1B", type: !45, function: void (%class.A*, %class.B*)* @_ZN1B9AInstanceEv, declaration: !44, variables: !2) -!54 = !DISubprogram(name: "main", line: 53, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 54, file: !1, scope: !7, type: !55, function: i32 (i32, i8**)* @main, variables: !2) +!49 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2Ei", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 18, file: !1, scope: !"_ZTS1A", type: !15, declaration: !14, variables: !2) +!50 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2ERKS_", line: 21, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 23, file: !1, scope: !"_ZTS1A", type: !20, declaration: !19, variables: !2) +!51 = distinct !DISubprogram(name: "operator=", linkageName: "_ZN1AaSERKS_", line: 27, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 28, file: !1, scope: !"_ZTS1A", type: !26, declaration: !25, variables: !2) +!52 = distinct !DISubprogram(name: "get_int", linkageName: "_ZN1A7get_intEv", line: 33, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 34, file: !1, scope: !"_ZTS1A", type: !34, declaration: !33, variables: !2) +!53 = distinct !DISubprogram(name: "AInstance", linkageName: "_ZN1B9AInstanceEv", line: 47, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 48, file: !1, scope: !"_ZTS1B", type: !45, declaration: !44, variables: !2) +!54 = distinct !DISubprogram(name: "main", line: 53, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 54, file: !1, scope: !7, type: !55, variables: !2) !55 = !DISubroutineType(types: !56) !56 = !{!12, !12, !57} !57 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !58) !58 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !59) !59 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !60) !60 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) -!61 = !DISubprogram(name: "~A", linkageName: "_ZN1AD0Ev", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !"_ZTS1A", type: !30, function: void (%class.A*)* @_ZN1AD0Ev, declaration: !29, variables: !2) -!62 = !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", line: 41, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 41, file: !1, scope: !"_ZTS1B", type: !40, function: void (%class.B*)* @_ZN1BC2Ev, declaration: !39, variables: !2) -!63 = !DISubprogram(name: "~A", linkageName: "_ZN1AD2Ev", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !"_ZTS1A", type: !30, function: void (%class.A*)* @_ZN1AD2Ev, declaration: !29, variables: !2) +!61 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD0Ev", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !"_ZTS1A", type: !30, declaration: !29, variables: !2) +!62 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", line: 41, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 41, file: !1, scope: !"_ZTS1B", type: !40, declaration: !39, variables: !2) +!63 = distinct !DISubprogram(name: "~A", linkageName: "_ZN1AD2Ev", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 8, file: !1, scope: !"_ZTS1A", type: !30, declaration: !29, variables: !2) !64 = !{i32 2, !"Dwarf Version", i32 4} !65 = !{i32 1, !"Debug Info Version", i32 3} !66 = !{!"clang version 3.5.0 (trunk 203283) (llvm/trunk 203307)"} -!67 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !49, type: !68) +!67 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !49, type: !68) !68 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A") !69 = !DILocation(line: 0, scope: !49) -!70 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 16, arg: 2, scope: !49, file: !7, type: !12) +!70 = !DILocalVariable(name: "i", line: 16, arg: 2, scope: !49, file: !7, type: !12) !71 = !DILocation(line: 16, scope: !49) !72 = !DILocation(line: 18, scope: !49) !73 = !DILocation(line: 19, scope: !49) -!74 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !50, type: !68) +!74 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !50, type: !68) !75 = !DILocation(line: 0, scope: !50) -!76 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "rhs", line: 21, arg: 2, scope: !50, file: !7, type: !22) +!76 = !DILocalVariable(name: "rhs", line: 21, arg: 2, scope: !50, file: !7, type: !22) !77 = !DILocation(line: 21, scope: !50) !78 = !DILocation(line: 23, scope: !50) !79 = !DILocation(line: 24, scope: !50) -!80 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !51, type: !68) +!80 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !51, type: !68) !81 = !DILocation(line: 0, scope: !51) -!82 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "rhs", line: 27, arg: 2, scope: !51, file: !7, type: !22) +!82 = !DILocalVariable(name: "rhs", line: 27, arg: 2, scope: !51, file: !7, type: !22) !83 = !DILocation(line: 27, scope: !51) !84 = !DILocation(line: 29, scope: !51) !85 = !DILocation(line: 30, scope: !51) -!86 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !52, type: !68) +!86 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !52, type: !68) !87 = !DILocation(line: 0, scope: !52) !88 = !DILocation(line: 35, scope: !52) -!89 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !53, type: !90) +!89 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !53, type: !90) !90 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1B") !91 = !DILocation(line: 0, scope: !53) !92 = !DILocation(line: 49, scope: !53) -!93 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 49, scope: !53, file: !7, type: !4) +!93 = !DILocalVariable(name: "a", line: 49, scope: !53, file: !7, type: !4) !94 = !DILocation(line: 50, scope: !53) !95 = !DILocation(line: 51, scope: !53) !96 = !DILocation(line: 51, scope: !97) @@ -357,19 +357,19 @@ attributes #7 = { builtin nounwind } !98 = !DILocation(line: 51, scope: !99) !99 = distinct !DILexicalBlock(line: 51, column: 0, file: !1, scope: !100) !100 = distinct !DILexicalBlock(line: 51, column: 0, file: !1, scope: !53) -!101 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !63, type: !68) +!101 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !63, type: !68) !102 = !DILocation(line: 0, scope: !63) !103 = !DILocation(line: 8, scope: !63) -!104 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argc", line: 53, arg: 1, scope: !54, file: !7, type: !12) +!104 = !DILocalVariable(name: "argc", line: 53, arg: 1, scope: !54, file: !7, type: !12) !105 = !DILocation(line: 53, scope: !54) -!106 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argv", line: 53, arg: 2, scope: !54, file: !7, type: !57) -!107 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "b", line: 55, scope: !54, file: !7, type: !37) +!106 = !DILocalVariable(name: "argv", line: 53, arg: 2, scope: !54, file: !7, type: !57) +!107 = !DILocalVariable(name: "b", line: 55, scope: !54, file: !7, type: !37) !108 = !DILocation(line: 55, scope: !54) -!109 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "return_val", line: 56, scope: !54, file: !7, type: !12) +!109 = !DILocalVariable(name: "return_val", line: 56, scope: !54, file: !7, type: !12) !110 = !DILocation(line: 56, scope: !54) !111 = !DILocation(line: 56, scope: !112) !112 = distinct !DILexicalBlock(line: 56, column: 0, file: !1, scope: !54) -!113 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 58, scope: !54, file: !7, type: !4) +!113 = !DILocalVariable(name: "a", line: 58, scope: !54, file: !7, type: !4) !114 = !DILocation(line: 58, scope: !54) !115 = !DILocation(line: 59, scope: !54) !116 = !DILocation(line: 60, scope: !54) @@ -379,10 +379,10 @@ attributes #7 = { builtin nounwind } !120 = distinct !DILexicalBlock(line: 60, column: 0, file: !1, scope: !54) !121 = !DILocation(line: 60, scope: !122) !122 = distinct !DILexicalBlock(line: 60, column: 0, file: !1, scope: !54) -!123 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !62, type: !90) +!123 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !62, type: !90) !124 = !DILocation(line: 0, scope: !62) !125 = !DILocation(line: 41, scope: !62) -!126 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !61, type: !68) +!126 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !61, type: !68) !127 = !DILocation(line: 0, scope: !61) !128 = !DILocation(line: 8, scope: !61) !129 = !DILocation(line: 8, scope: !130) diff --git a/test/DebugInfo/X86/sroasplit-1.ll b/test/DebugInfo/X86/sroasplit-1.ll index 2179aa380953..11895a7f083e 100644 --- a/test/DebugInfo/X86/sroasplit-1.ll +++ b/test/DebugInfo/X86/sroasplit-1.ll @@ -25,7 +25,7 @@ ; CHECK: call void @llvm.dbg.value(metadata i32 %[[A:.*]], i64 0, metadata ![[VAR]], metadata ![[PIECE2:[0-9]+]]) ; CHECK: ret i32 %[[A]] ; Read Var and Piece: -; CHECK: ![[VAR]] = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i1",{{.*}} line: 11, +; CHECK: ![[VAR]] = !DILocalVariable(name: "i1",{{.*}} line: 11, ; CHECK: ![[PIECE1]] = !DIExpression(DW_OP_bit_piece, 32, 96) ; CHECK: ![[PIECE2]] = !DIExpression(DW_OP_bit_piece, 0, 32) @@ -36,7 +36,7 @@ target triple = "x86_64-apple-macosx10.9.0" %struct.Inner = type { i32, i64 } ; Function Attrs: nounwind ssp uwtable -define i32 @foo(%struct.Outer* byval align 8 %outer) #0 { +define i32 @foo(%struct.Outer* byval align 8 %outer) #0 !dbg !4 { entry: %i1 = alloca %struct.Inner, align 8 call void @llvm.dbg.declare(metadata %struct.Outer* %outer, metadata !25, metadata !2), !dbg !26 @@ -65,11 +65,11 @@ attributes #2 = { nounwind } !llvm.module.flags = !{!22, !23} !llvm.ident = !{!24} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !{}, retainedTypes: !{}, subprograms: !3, globals: !{}, imports: !{}) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !{}, retainedTypes: !{}, subprograms: !3, globals: !{}, imports: !{}) !1 = !DIFile(filename: "sroasplit-1.c", directory: "") !2 = !DIExpression() !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !5, type: !6, function: i32 (%struct.Outer*)* @foo, variables: !{}) +!4 = distinct !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !5, type: !6, variables: !{}) !5 = !DIFile(filename: "sroasplit-1.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{!8, !9} @@ -90,8 +90,8 @@ attributes #2 = { nounwind } !22 = !{i32 2, !"Dwarf Version", i32 2} !23 = !{i32 1, !"Debug Info Version", i32 3} !24 = !{!"clang version 3.5.0 "} -!25 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "outer", line: 10, arg: 1, scope: !4, file: !5, type: !9) +!25 = !DILocalVariable(name: "outer", line: 10, arg: 1, scope: !4, file: !5, type: !9) !26 = !DILocation(line: 10, scope: !4) -!27 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i1", line: 11, scope: !4, file: !5, type: !14) +!27 = !DILocalVariable(name: "i1", line: 11, scope: !4, file: !5, type: !14) !28 = !DILocation(line: 11, scope: !4) !29 = !DILocation(line: 12, scope: !4) diff --git a/test/DebugInfo/X86/sroasplit-2.ll b/test/DebugInfo/X86/sroasplit-2.ll index b209fafd4df1..bea1b26df285 100644 --- a/test/DebugInfo/X86/sroasplit-2.ll +++ b/test/DebugInfo/X86/sroasplit-2.ll @@ -23,10 +23,10 @@ ; CHECK: call void @llvm.dbg.value(metadata i64 %outer.coerce0, i64 0, metadata ![[O:[0-9]+]], metadata ![[PIECE1:[0-9]+]]), ; CHECK: call void @llvm.dbg.value(metadata i64 %outer.coerce1, i64 0, metadata ![[O]], metadata ![[PIECE2:[0-9]+]]), ; CHECK: call void @llvm.dbg.value({{.*}}, i64 0, metadata ![[I1:[0-9]+]], metadata ![[PIECE3:[0-9]+]]), -; CHECK-DAG: ![[O]] = !DILocalVariable(tag: DW_TAG_arg_variable, name: "outer",{{.*}} line: 10 +; CHECK-DAG: ![[O]] = !DILocalVariable(name: "outer",{{.*}} line: 10 ; CHECK-DAG: ![[PIECE1]] = !DIExpression(DW_OP_bit_piece, 0, 64) ; CHECK-DAG: ![[PIECE2]] = !DIExpression(DW_OP_bit_piece, 64, 64) -; CHECK-DAG: ![[I1]] = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i1",{{.*}} line: 11 +; CHECK-DAG: ![[I1]] = !DILocalVariable(name: "i1",{{.*}} line: 11 ; CHECK-DAG: ![[PIECE3]] = !DIExpression(DW_OP_bit_piece, 0, 32) ; ModuleID = 'sroasplit-2.c' @@ -37,7 +37,7 @@ target triple = "x86_64-apple-macosx10.9.0" %struct.Inner = type { i32, i32 } ; Function Attrs: nounwind ssp uwtable -define i32 @foo(i64 %outer.coerce0, i64 %outer.coerce1) #0 { +define i32 @foo(i64 %outer.coerce0, i64 %outer.coerce1) #0 !dbg !4 { %outer = alloca %struct.Outer, align 8 %i1 = alloca %struct.Inner, align 4 %1 = bitcast %struct.Outer* %outer to { i64, i64 }* @@ -71,11 +71,11 @@ attributes #2 = { nounwind } !llvm.module.flags = !{!21, !22} !llvm.ident = !{!23} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !{}, retainedTypes: !{}, subprograms: !3, globals: !{}, imports: !{}) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !{}, retainedTypes: !{}, subprograms: !3, globals: !{}, imports: !{}) !1 = !DIFile(filename: "sroasplit-2.c", directory: "") !2 = !DIExpression() !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !5, type: !6, function: i32 (i64, i64)* @foo, variables: !{}) +!4 = distinct !DISubprogram(name: "foo", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 10, file: !1, scope: !5, type: !6, variables: !{}) !5 = !DIFile(filename: "sroasplit-2.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{!8, !9} @@ -95,8 +95,8 @@ attributes #2 = { nounwind } !21 = !{i32 2, !"Dwarf Version", i32 2} !22 = !{i32 1, !"Debug Info Version", i32 3} !23 = !{!"clang version 3.5.0 "} -!24 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "outer", line: 10, arg: 1, scope: !4, file: !5, type: !9) +!24 = !DILocalVariable(name: "outer", line: 10, arg: 1, scope: !4, file: !5, type: !9) !25 = !DILocation(line: 10, scope: !4) -!26 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i1", line: 11, scope: !4, file: !5, type: !14) +!26 = !DILocalVariable(name: "i1", line: 11, scope: !4, file: !5, type: !14) !27 = !DILocation(line: 11, scope: !4) !28 = !DILocation(line: 12, scope: !4) diff --git a/test/DebugInfo/X86/sroasplit-3.ll b/test/DebugInfo/X86/sroasplit-3.ll index 50b701f781d8..7a39beb137d8 100644 --- a/test/DebugInfo/X86/sroasplit-3.ll +++ b/test/DebugInfo/X86/sroasplit-3.ll @@ -4,7 +4,7 @@ ; not partitioned into multiple allocas. ; ; CHECK: call void @llvm.dbg.value(metadata float %s.coerce, i64 0, metadata ![[VAR:[0-9]+]], metadata ![[EXPR:[0-9]+]]) -; CHECK: ![[VAR]] = !DILocalVariable(tag: DW_TAG_arg_variable, name: "s",{{.*}} line: 3, +; CHECK: ![[VAR]] = !DILocalVariable(name: "s",{{.*}} line: 3, ; CHECK: ![[EXPR]] = !DIExpression( ; CHECK-NOT: DW_OP_bit_piece @@ -20,7 +20,7 @@ target triple = "x86_64-apple-macosx10.10.0" %struct.S = type { float } ; Function Attrs: nounwind ssp uwtable -define float @foo(float %s.coerce) #0 { +define float @foo(float %s.coerce) #0 !dbg !4 { entry: %s = alloca %struct.S, align 4 %coerce.dive = getelementptr %struct.S, %struct.S* %s, i32 0, i32 0 @@ -41,11 +41,11 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!12, !13, !14} !llvm.ident = !{!15} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "test.c", directory: "/Volumes/Data/llvm/_build.ninja.debug") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: float (float)* @foo, variables: !2) +!4 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "test.c", directory: "/Volumes/Data/llvm/_build.ninja.debug") !6 = !DISubroutineType(types: !7) !7 = !{!8, !9} @@ -57,7 +57,7 @@ attributes #1 = { nounwind readnone } !13 = !{i32 2, !"Debug Info Version", i32 3} !14 = !{i32 1, !"PIC Level", i32 2} !15 = !{!"clang version 3.6.0 "} -!16 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9) +!16 = !DILocalVariable(name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9) !17 = !DIExpression() !18 = !DILocation(line: 3, column: 20, scope: !4) !19 = !DILocation(line: 4, column: 2, scope: !4) diff --git a/test/DebugInfo/X86/sroasplit-4.ll b/test/DebugInfo/X86/sroasplit-4.ll index e9fcdf8eac92..2abf6e1ec9b4 100644 --- a/test/DebugInfo/X86/sroasplit-4.ll +++ b/test/DebugInfo/X86/sroasplit-4.ll @@ -45,7 +45,7 @@ target triple = "x86_64-apple-darwin" @t = external global i64 ; Function Attrs: nounwind -define i32 @_Z4testv() #0 { +define i32 @_Z4testv() #0 !dbg !17 { entry: %retval = alloca i32, align 4 %y = alloca %struct.p, align 8 @@ -109,7 +109,7 @@ attributes #3 = { nounwind } !llvm.module.flags = !{!21, !22} !llvm.ident = !{!23} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !16, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !16, globals: !2, imports: !2) !1 = !DIFile(filename: "<stdin>", directory: "") !2 = !{} !3 = !{!4, !10} @@ -126,7 +126,7 @@ attributes #3 = { nounwind } !14 = !DIDerivedType(tag: DW_TAG_member, name: "x", line: 10, size: 128, align: 64, offset: 64, file: !5, scope: !"_ZTS1r", baseType: !"_ZTS1p") !15 = !DIDerivedType(tag: DW_TAG_member, name: "y", line: 11, size: 128, align: 64, offset: 192, file: !5, scope: !"_ZTS1r", baseType: !"_ZTS1p") !16 = !{!17} -!17 = !DISubprogram(name: "test", linkageName: "_Z4testv", line: 18, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 18, file: !5, scope: !18, type: !19, function: i32 ()* @_Z4testv, variables: !2) +!17 = distinct !DISubprogram(name: "test", linkageName: "_Z4testv", line: 18, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 18, file: !5, scope: !18, type: !19, variables: !2) !18 = !DIFile(filename: "pr22393.cc", directory: "") !19 = !DISubroutineType(types: !20) !20 = !{!13} @@ -137,10 +137,10 @@ attributes #3 = { nounwind } !25 = distinct !DILexicalBlock(line: 19, column: 0, file: !5, scope: !17) !26 = !DILocation(line: 19, scope: !17) !27 = !DILocation(line: 20, scope: !25) -!28 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "y", line: 21, scope: !17, file: !18, type: !"_ZTS1p") +!28 = !DILocalVariable(name: "y", line: 21, scope: !17, file: !18, type: !"_ZTS1p") !29 = !DIExpression() !30 = !DILocation(line: 21, scope: !17) -!31 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "r", line: 22, scope: !17, file: !18, type: !"_ZTS1r") +!31 = !DILocalVariable(name: "r", line: 22, scope: !17, file: !18, type: !"_ZTS1r") !32 = !DILocation(line: 22, scope: !17) !33 = !DILocation(line: 23, scope: !17) !34 = !DILocation(line: 24, scope: !17) diff --git a/test/DebugInfo/X86/sroasplit-5.ll b/test/DebugInfo/X86/sroasplit-5.ll index ce6b4544c56b..059cb19e92e2 100644 --- a/test/DebugInfo/X86/sroasplit-5.ll +++ b/test/DebugInfo/X86/sroasplit-5.ll @@ -27,7 +27,7 @@ target triple = "x86_64-unknown-linux-gnu" %struct.prog_src_register = type { i32, i24 } ; Function Attrs: nounwind -define i64 @src_reg_for_float() #0 { +define i64 @src_reg_for_float() #0 !dbg !4 { entry: %retval = alloca %struct.prog_src_register, align 4 %a = alloca %struct.prog_src_register, align 4 @@ -66,11 +66,11 @@ attributes #2 = { nounwind } !llvm.module.flags = !{!13, !14} !llvm.ident = !{!15} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "<stdin>", directory: "") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "src_reg_for_float", line: 7, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 7, file: !5, scope: !6, type: !7, function: i64 ()* @src_reg_for_float, variables: !2) +!4 = distinct !DISubprogram(name: "src_reg_for_float", line: 7, isLocal: false, isDefinition: true, isOptimized: false, scopeLine: 7, file: !5, scope: !6, type: !7, variables: !2) !5 = !DIFile(filename: "pr22495.c", directory: "") !6 = !DIFile(filename: "pr22495.c", directory: "") !7 = !DISubroutineType(types: !8) @@ -82,10 +82,10 @@ attributes #2 = { nounwind } !13 = !{i32 2, !"Dwarf Version", i32 4} !14 = !{i32 2, !"Debug Info Version", i32 3} !15 = !{!"clang version 3.7.0 "} -!16 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 8, scope: !4, file: !6, type: !9) +!16 = !DILocalVariable(name: "a", line: 8, scope: !4, file: !6, type: !9) !17 = !DIExpression() !18 = !DILocation(line: 8, scope: !4) !19 = !DILocation(line: 9, scope: !4) -!20 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "local", line: 10, scope: !4, file: !6, type: !12) +!20 = !DILocalVariable(name: "local", line: 10, scope: !4, file: !6, type: !12) !21 = !DILocation(line: 10, scope: !4) !22 = !DILocation(line: 11, scope: !4) diff --git a/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll b/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll index 86a1647d6fa4..a366853ad205 100644 --- a/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll +++ b/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll @@ -58,7 +58,7 @@ ; ASM-NOT: Lcu_begin ; ASM: Lset[[LT:[0-9]+]] = Lline_table_start0-Lsection_line ## DW_AT_stmt_list ; ASM-NEXT: .long Lset[[LT]] -define i32 @test(i32 %a) nounwind uwtable ssp { +define i32 @test(i32 %a) nounwind uwtable ssp !dbg !5 { entry: %a.addr = alloca i32, align 4 store i32 %a, i32* %a.addr, align 4 @@ -70,7 +70,7 @@ entry: declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone -define i32 @fn(i32 %a) nounwind uwtable ssp { +define i32 @fn(i32 %a) nounwind uwtable ssp !dbg !13 { entry: %a.addr = alloca i32, align 4 store i32 %a, i32* %a.addr, align 4 @@ -81,23 +81,23 @@ entry: !llvm.dbg.cu = !{!0, !10} !llvm.module.flags = !{!25} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3", isOptimized: false, emissionKind: 1, file: !23, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3", isOptimized: false, emissionKind: 1, file: !23, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "test", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !23, scope: !6, type: !7, function: i32 (i32)* @test, variables: !1) +!5 = distinct !DISubprogram(name: "test", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !23, scope: !6, type: !7, variables: !1) !6 = !DIFile(filename: "simple.c", directory: "/private/tmp") !7 = !DISubroutineType(types: !8) !8 = !{!9, !9} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 172862)", isOptimized: false, emissionKind: 1, file: !24, enums: !1, retainedTypes: !1, subprograms: !11, globals: !1, imports: !1) +!10 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 172862)", isOptimized: false, emissionKind: 1, file: !24, enums: !1, retainedTypes: !1, subprograms: !11, globals: !1, imports: !1) !11 = !{!13} -!13 = !DISubprogram(name: "fn", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !24, scope: !14, type: !7, function: i32 (i32)* @fn, variables: !1) +!13 = distinct !DISubprogram(name: "fn", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !24, scope: !14, type: !7, variables: !1) !14 = !DIFile(filename: "simple2.c", directory: "/private/tmp") -!15 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 2, arg: 1, scope: !5, file: !6, type: !9) +!15 = !DILocalVariable(name: "a", line: 2, arg: 1, scope: !5, file: !6, type: !9) !16 = !DILocation(line: 2, scope: !5) !17 = !DILocation(line: 4, scope: !18) !18 = distinct !DILexicalBlock(line: 3, column: 0, file: !23, scope: !5) -!19 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 1, arg: 1, scope: !13, file: !14, type: !9) +!19 = !DILocalVariable(name: "a", line: 1, arg: 1, scope: !13, file: !14, type: !9) !20 = !DILocation(line: 1, scope: !13) !21 = !DILocation(line: 2, scope: !22) !22 = distinct !DILexicalBlock(line: 1, column: 0, file: !24, scope: !13) diff --git a/test/DebugInfo/X86/stmt-list.ll b/test/DebugInfo/X86/stmt-list.ll index 1f5189e362a4..393e1b50ea8a 100644 --- a/test/DebugInfo/X86/stmt-list.ll +++ b/test/DebugInfo/X86/stmt-list.ll @@ -5,7 +5,7 @@ ; CHECK: .section .debug_line,"",@progbits ; CHECK-NEXT: .Lline_table_start0: -define void @f() { +define void @f() !dbg !0 { entry: ret void } @@ -14,9 +14,9 @@ entry: !llvm.module.flags = !{!7} !5 = !{!0} -!0 = !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !6, scope: !1, type: !3, function: void ()* @f) +!0 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !6, scope: !1, type: !3) !1 = !DIFile(filename: "test2.c", directory: "/home/espindola/llvm") -!2 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: true, emissionKind: 0, file: !6, enums: !{}, retainedTypes: !{}, subprograms: !5) +!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: true, emissionKind: 0, file: !6, enums: !{}, retainedTypes: !{}, subprograms: !5) !3 = !DISubroutineType(types: !4) !4 = !{null} !6 = !DIFile(filename: "test2.c", directory: "/home/espindola/llvm") diff --git a/test/DebugInfo/X86/stringpool.ll b/test/DebugInfo/X86/stringpool.ll index 62b2b1bb55c0..9030ae02e534 100644 --- a/test/DebugInfo/X86/stringpool.ll +++ b/test/DebugInfo/X86/stringpool.ll @@ -6,7 +6,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!9} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143009)", isOptimized: true, emissionKind: 0, file: !8, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 143009)", isOptimized: true, emissionKind: 0, file: !8, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) !1 = !{} !3 = !{!5} !5 = !DIGlobalVariable(name: "yyyy", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i32* @yyyy) diff --git a/test/DebugInfo/X86/struct-loc.ll b/test/DebugInfo/X86/struct-loc.ll index 2c133b9b66ee..2236cd087d54 100644 --- a/test/DebugInfo/X86/struct-loc.ll +++ b/test/DebugInfo/X86/struct-loc.ll @@ -14,7 +14,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!12} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 152837) (llvm/trunk 152845)", isOptimized: false, emissionKind: 0, file: !11, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 152837) (llvm/trunk 152845)", isOptimized: false, emissionKind: 0, file: !11, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) !1 = !{} !3 = !{!5} !5 = !DIGlobalVariable(name: "f", line: 5, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %struct.foo* @f) diff --git a/test/DebugInfo/X86/subrange-type.ll b/test/DebugInfo/X86/subrange-type.ll index d83cca6c8776..7a81bac56d0d 100644 --- a/test/DebugInfo/X86/subrange-type.ll +++ b/test/DebugInfo/X86/subrange-type.ll @@ -7,7 +7,7 @@ ; CHECK: [[SUBTYPE]]: DW_TAG_base_type ; CHECK-NEXT: DW_AT_name -define i32 @main() nounwind uwtable { +define i32 @main() nounwind uwtable !dbg !5 { entry: %retval = alloca i32, align 4 %i = alloca [2 x i32], align 4 @@ -21,15 +21,15 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!18} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 171472) (llvm/trunk 171487)", isOptimized: false, emissionKind: 0, file: !17, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 171472) (llvm/trunk 171487)", isOptimized: false, emissionKind: 0, file: !17, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1, imports: !1) !1 = !{} !3 = !{!5} -!5 = !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: !6, type: !7, function: i32 ()* @main, variables: !1) +!5 = distinct !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !6, scope: !6, type: !7, variables: !1) !6 = !DIFile(filename: "foo.c", directory: "/usr/local/google/home/echristo/tmp") !7 = !DISubroutineType(types: !8) !8 = !{!9} !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!10 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 4, scope: !11, file: !6, type: !12) +!10 = !DILocalVariable(name: "i", line: 4, scope: !11, file: !6, type: !12) !11 = distinct !DILexicalBlock(line: 3, column: 0, file: !6, scope: !5) !12 = !DICompositeType(tag: DW_TAG_array_type, size: 64, align: 32, baseType: !9, elements: !13) !13 = !{!14} diff --git a/test/DebugInfo/X86/subreg.ll b/test/DebugInfo/X86/subreg.ll index b850ce800e37..3b95532ff52c 100644 --- a/test/DebugInfo/X86/subreg.ll +++ b/test/DebugInfo/X86/subreg.ll @@ -7,7 +7,7 @@ ; CHECK-NEXT: .byte 147 # DW_OP_piece ; CHECK-NEXT: .byte 2 # 2 -define i16 @f(i16 signext %zzz) nounwind { +define i16 @f(i16 signext %zzz) nounwind !dbg !1 { entry: call void @llvm.dbg.value(metadata i16 %zzz, i64 0, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1) %conv = sext i16 %zzz to i32, !dbg !7 @@ -21,10 +21,10 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon !llvm.module.flags = !{!11} !9 = !{!1} -!0 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "zzz", line: 3, arg: 1, scope: !1, file: !2, type: !6) -!1 = !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !10, scope: !2, type: !4, function: i16 (i16)* @f) +!0 = !DILocalVariable(name: "zzz", line: 3, arg: 1, scope: !1, file: !2, type: !6) +!1 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !10, scope: !2, type: !4) !2 = !DIFile(filename: "/home/espindola/llvm/test.c", directory: "/home/espindola/tmpfs/build") -!3 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: false, emissionKind: 1, file: !10, enums: !{}, retainedTypes: !{}, subprograms: !9, imports: null) +!3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 ()", isOptimized: false, emissionKind: 1, file: !10, enums: !{}, retainedTypes: !{}, subprograms: !9, imports: null) !4 = !DISubroutineType(types: !5) !5 = !{null} !6 = !DIBasicType(tag: DW_TAG_base_type, name: "short", size: 16, align: 16, encoding: DW_ATE_signed) diff --git a/test/DebugInfo/X86/subregisters.ll b/test/DebugInfo/X86/subregisters.ll index a4722aa8cd58..9dcb09f0869d 100644 --- a/test/DebugInfo/X86/subregisters.ll +++ b/test/DebugInfo/X86/subregisters.ll @@ -38,7 +38,7 @@ target triple = "x86_64-apple-macosx10.9.0" @main.myBar = private unnamed_addr constant %struct.bar { i32 3, i32 4 }, align 4 ; Function Attrs: noinline nounwind ssp uwtable -define void @doSomething(%struct.bar* nocapture readonly %b) #0 { +define void @doSomething(%struct.bar* nocapture readonly %b) #0 !dbg !4 { entry: tail call void @llvm.dbg.value(metadata %struct.bar* %b, i64 0, metadata !15, metadata !DIExpression()), !dbg !25 %a1 = getelementptr inbounds %struct.bar, %struct.bar* %b, i64 0, i32 0, !dbg !26 @@ -55,7 +55,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 declare i32 @printf(i8* nocapture readonly, ...) #2 ; Function Attrs: nounwind ssp uwtable -define i32 @main() #3 { +define i32 @main() #3 !dbg !17 { entry: %myBar = alloca i64, align 8, !dbg !34 %tmpcast = bitcast i64* %myBar to %struct.bar*, !dbg !34 @@ -78,11 +78,11 @@ attributes #4 = { nounwind } !llvm.module.flags = !{!22, !23} !llvm.ident = !{!24} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "subregisters.c", directory: "") !2 = !{} !3 = !{!4, !17} -!4 = !DISubprogram(name: "doSomething", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !1, scope: !5, type: !6, function: void (%struct.bar*)* @doSomething, variables: !14) +!4 = distinct !DISubprogram(name: "doSomething", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !1, scope: !5, type: !6, variables: !14) !5 = !DIFile(filename: "subregisters.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{null, !8} @@ -93,13 +93,13 @@ attributes #4 = { nounwind } !12 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !13 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 5, size: 32, align: 32, offset: 32, file: !1, scope: !9, baseType: !12) !14 = !{!15, !16} -!15 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 10, arg: 1, scope: !4, file: !5, type: !8) -!16 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 12, scope: !4, file: !5, type: !12) -!17 = !DISubprogram(name: "main", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 17, file: !1, scope: !5, type: !18, function: i32 ()* @main, variables: !20) +!15 = !DILocalVariable(name: "b", line: 10, arg: 1, scope: !4, file: !5, type: !8) +!16 = !DILocalVariable(name: "a", line: 12, scope: !4, file: !5, type: !12) +!17 = distinct !DISubprogram(name: "main", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 17, file: !1, scope: !5, type: !18, variables: !20) !18 = !DISubroutineType(types: !19) !19 = !{!12} !20 = !{!21} -!21 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "myBar", line: 18, scope: !17, file: !5, type: !9) +!21 = !DILocalVariable(name: "myBar", line: 18, scope: !17, file: !5, type: !9) !22 = !{i32 2, !"Dwarf Version", i32 2} !23 = !{i32 1, !"Debug Info Version", i32 3} !24 = !{!"clang version 3.5 "} diff --git a/test/DebugInfo/X86/template.ll b/test/DebugInfo/X86/template.ll index f846b29f5768..d7ce08437ca6 100644 --- a/test/DebugInfo/X86/template.ll +++ b/test/DebugInfo/X86/template.ll @@ -64,7 +64,7 @@ @n = global %"struct.y_impl<int>::nested" zeroinitializer, align 1 @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_template.cpp, i8* null }] -define internal void @__cxx_global_var_init() section ".text.startup" { +define internal void @__cxx_global_var_init() section ".text.startup" !dbg !10 { entry: %call = call i32 @_Z4funcILi3EXadL_Z4glblEE6y_implLDn0EJLi1ELi2EEEiv(), !dbg !36 store i32 %call, i32* @glbl, align 4, !dbg !36 @@ -72,7 +72,7 @@ entry: } ; Function Attrs: nounwind uwtable -define linkonce_odr i32 @_Z4funcILi3EXadL_Z4glblEE6y_implLDn0EJLi1ELi2EEEiv() #0 { +define linkonce_odr i32 @_Z4funcILi3EXadL_Z4glblEE6y_implLDn0EJLi1ELi2EEEiv() #0 !dbg !14 { entry: ret i32 3, !dbg !37 } @@ -89,7 +89,7 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !llvm.module.flags = !{!33, !34} !llvm.ident = !{!35} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 224394) (llvm/trunk 224384)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !30, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 224394) (llvm/trunk 224384)", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !9, globals: !30, imports: !2) !1 = !DIFile(filename: "template.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4, !8} @@ -99,11 +99,11 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !8 = !DICompositeType(tag: DW_TAG_structure_type, name: "nested", line: 2, size: 8, align: 8, file: !1, scope: !"_ZTS6y_implIiE", elements: !2, identifier: "_ZTSN6y_implIiE6nestedE") !9 = !{!10, !14, !28} -!10 = !DISubprogram(name: "__cxx_global_var_init", line: 3, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !11, type: !12, function: void ()* @__cxx_global_var_init, variables: !2) +!10 = distinct !DISubprogram(name: "__cxx_global_var_init", line: 3, isLocal: true, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !11, type: !12, variables: !2) !11 = !DIFile(filename: "template.cpp", directory: "/tmp/dbginfo") !12 = !DISubroutineType(types: !13) !13 = !{null} -!14 = !DISubprogram(name: "func<3, &glbl, y_impl, nullptr, 1, 2>", linkageName: "_Z4funcILi3EXadL_Z4glblEE6y_implLDn0EJLi1ELi2EEEiv", line: 1, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !11, type: !15, function: i32 ()* @_Z4funcILi3EXadL_Z4glblEE6y_implLDn0EJLi1ELi2EEEiv, templateParams: !17, variables: !2) +!14 = distinct !DISubprogram(name: "func<3, &glbl, y_impl, nullptr, 1, 2>", linkageName: "_Z4funcILi3EXadL_Z4glblEE6y_implLDn0EJLi1ELi2EEEiv", line: 1, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !11, type: !15, templateParams: !17, variables: !2) !15 = !DISubroutineType(types: !16) !16 = !{!7} !17 = !{!18, !19, !21, !22, !24} @@ -117,7 +117,7 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !25 = !{!26, !27} !26 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, type: !7, value: i32 1) !27 = !DITemplateValueParameter(tag: DW_TAG_template_value_parameter, type: !7, value: i32 2) -!28 = !DISubprogram(name: "", linkageName: "_GLOBAL__sub_I_template.cpp", isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, file: !1, scope: !11, type: !29, function: void ()* @_GLOBAL__sub_I_template.cpp, variables: !2) +!28 = distinct !DISubprogram(name: "", linkageName: "_GLOBAL__sub_I_template.cpp", isLocal: true, isDefinition: true, flags: DIFlagArtificial, isOptimized: false, file: !1, scope: !11, type: !29, variables: !2) !29 = !DISubroutineType(types: !2) !30 = !{!31, !32} !31 = !DIGlobalVariable(name: "glbl", line: 3, isLocal: false, isDefinition: true, scope: null, file: !11, type: !7, variable: i32* @glbl) diff --git a/test/DebugInfo/X86/tls.ll b/test/DebugInfo/X86/tls.ll index 55930f0bacf2..754ed25debc6 100644 --- a/test/DebugInfo/X86/tls.ll +++ b/test/DebugInfo/X86/tls.ll @@ -1,20 +1,30 @@ ; RUN: llc %s -o - -filetype=asm -O0 -mtriple=x86_64-unknown-linux-gnu \ -; RUN: | FileCheck --check-prefix=SINGLE --check-prefix=SINGLE-64 --check-prefix=GNUOP %s +; RUN: | FileCheck --check-prefix=NOEMU --check-prefix=SINGLE --check-prefix=SINGLE-64 --check-prefix=GNUOP %s ; RUN: llc %s -o - -filetype=asm -O0 -mtriple=i386-linux-gnu \ -; RUN: | FileCheck --check-prefix=SINGLE --check-prefix=SINGLE-32 --check-prefix=GNUOP %s +; RUN: | FileCheck --check-prefix=NOEMU --check-prefix=SINGLE --check-prefix=SINGLE-32 --check-prefix=GNUOP %s ; RUN: llc %s -o - -filetype=asm -O0 -mtriple=x86_64-unknown-linux-gnu -split-dwarf=Enable \ -; RUN: | FileCheck --check-prefix=FISSION --check-prefix=GNUOP %s +; RUN: | FileCheck --check-prefix=NOEMU --check-prefix=FISSION --check-prefix=GNUOP %s ; RUN: llc %s -o - -filetype=asm -O0 -mtriple=x86_64-scei-ps4 \ -; RUN: | FileCheck --check-prefix=SINGLE --check-prefix=SINGLE-64 --check-prefix=STDOP %s +; RUN: | FileCheck --check-prefix=NOEMU --check-prefix=SINGLE --check-prefix=SINGLE-64 --check-prefix=STDOP %s ; RUN: llc %s -o - -filetype=asm -O0 -mtriple=x86_64-apple-darwin \ -; RUN: | FileCheck --check-prefix=DARWIN --check-prefix=STDOP %s +; RUN: | FileCheck --check-prefix=NOEMU --check-prefix=DARWIN --check-prefix=STDOP %s ; RUN: llc %s -o - -filetype=asm -O0 -mtriple=x86_64-unknown-freebsd \ -; RUN: | FileCheck --check-prefix=SINGLE --check-prefix=SINGLE-64 --check-prefix=GNUOP %s +; RUN: | FileCheck --check-prefix=NOEMU --check-prefix=SINGLE --check-prefix=SINGLE-64 --check-prefix=STDOP %s + +; RUN: llc %s -o - -filetype=asm -O0 -mtriple=x86_64-unknown-linux-gnu -emulated-tls \ +; RUN: | FileCheck --check-prefix=SINGLE --check-prefix=EMUSINGLE-64 \ +; RUN: --check-prefix=EMUGNUOP --check-prefix=EMU %s + +; RUN: llc %s -o - -filetype=asm -O0 -mtriple=i386-linux-gnu -emulated-tls \ +; RUN: | FileCheck --check-prefix=SINGLE --check-prefix=EMUSINGLE-32 \ +; RUN: --check-prefix=EMUGNUOP --check-prefix=EMU %s + +; TODO: Add expected output for -emulated-tls tests. ; FIXME: add relocation and DWARF expression support to llvm-dwarfdump & use ; that here instead of raw assembly printing @@ -90,7 +100,7 @@ @glbl = global i32 0, align 4 ; Function Attrs: nounwind uwtable -define weak_odr i32 @_Z4funcIXadL_Z4glblEEEiv() #0 { +define weak_odr i32 @_Z4funcIXadL_Z4glblEEEiv() #0 !dbg !4 { entry: ret i32 0, !dbg !18 } @@ -101,11 +111,11 @@ attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointe !llvm.module.flags = !{!15, !16} !llvm.ident = !{!17} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, splitDebugFilename: "-.dwo", emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !12, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, splitDebugFilename: "-.dwo", emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !12, imports: !2) !1 = !DIFile(filename: "tls.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "func<&glbl>", linkageName: "_Z4funcIXadL_Z4glblEEEiv", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, function: i32 ()* @_Z4funcIXadL_Z4glblEEEiv, templateParams: !9, variables: !2) +!4 = distinct !DISubprogram(name: "func<&glbl>", linkageName: "_Z4funcIXadL_Z4glblEEEiv", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !5, type: !6, templateParams: !9, variables: !2) !5 = !DIFile(filename: "tls.cpp", directory: "/tmp/dbginfo") !6 = !DISubroutineType(types: !7) !7 = !{!8} diff --git a/test/DebugInfo/X86/type_units_with_addresses.ll b/test/DebugInfo/X86/type_units_with_addresses.ll index 2a8d664e89b8..10a41972d9f2 100644 --- a/test/DebugInfo/X86/type_units_with_addresses.ll +++ b/test/DebugInfo/X86/type_units_with_addresses.ll @@ -112,7 +112,7 @@ !llvm.module.flags = !{!34, !35} !llvm.ident = !{!36} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, splitDebugFilename: "tu.dwo", emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !27, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, splitDebugFilename: "tu.dwo", emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !2, globals: !27, imports: !2) !1 = !DIFile(filename: "tu.cpp", directory: "/tmp/dbginfo") !2 = !{} !3 = !{!4, !9, !12, !13, !17, !18, !19, !23, !24} diff --git a/test/DebugInfo/X86/union-const.ll b/test/DebugInfo/X86/union-const.ll index e051c6297b70..1d3969aff52d 100644 --- a/test/DebugInfo/X86/union-const.ll +++ b/test/DebugInfo/X86/union-const.ll @@ -20,7 +20,7 @@ target triple = "x86_64-apple-macosx10.10.0" %struct.anon = type { i32 } ; Function Attrs: nounwind readnone ssp uwtable -define i32 @mfi_aen_setup() #0 { +define i32 @mfi_aen_setup() #0 !dbg !4 { entry: tail call void @llvm.dbg.declare(metadata %union.mfi_evt* undef, metadata !16, metadata !21), !dbg !22 tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !16, metadata !21), !dbg !22 @@ -40,11 +40,11 @@ attributes #1 = { nounwind readnone } !llvm.module.flags = !{!17, !18, !19} !llvm.ident = !{!20} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 (trunk 226915) (llvm/trunk 226905)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 (trunk 226915) (llvm/trunk 226905)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "union.c", directory: "") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "mfi_aen_setup", line: 5, isLocal: false, isDefinition: true, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !6, function: i32 ()* @mfi_aen_setup, variables: !15) +!4 = distinct !DISubprogram(name: "mfi_aen_setup", line: 5, isLocal: false, isDefinition: true, isOptimized: true, scopeLine: 5, file: !1, scope: !5, type: !6, variables: !15) !5 = !DIFile(filename: "union.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{!8} @@ -56,7 +56,7 @@ attributes #1 = { nounwind readnone } !13 = !DIDerivedType(tag: DW_TAG_member, name: "reserved", line: 3, size: 32, align: 32, file: !1, scope: !11, baseType: !14) !14 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !15 = !{!16} -!16 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 6, scope: !4, file: !5, type: !8) +!16 = !DILocalVariable(name: "a", line: 6, scope: !4, file: !5, type: !8) !17 = !{i32 2, !"Dwarf Version", i32 2} !18 = !{i32 2, !"Debug Info Version", i32 3} !19 = !{i32 1, !"PIC Level", i32 2} diff --git a/test/DebugInfo/X86/union-template.ll b/test/DebugInfo/X86/union-template.ll index 172dcdcbb9db..1f91f2a129fe 100644 --- a/test/DebugInfo/X86/union-template.ll +++ b/test/DebugInfo/X86/union-template.ll @@ -11,7 +11,7 @@ @_ZN7PR156371fE = global %"union.PR15637::Value" zeroinitializer, align 4 -define void @_ZN7PR156371gEf(float %value) #0 { +define void @_ZN7PR156371gEf(float %value) #0 !dbg !4 { entry: %value.addr = alloca float, align 4 %tempValue = alloca %"union.PR15637::Value", align 4 @@ -29,11 +29,11 @@ attributes #1 = { nounwind readnone } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!28} -!0 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 178499) (llvm/trunk 178472)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 178499) (llvm/trunk 178472)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports: !2) !1 = !DIFile(filename: "foo.cc", directory: "/usr/local/google/home/echristo/tmp") !2 = !{} !3 = !{!4} -!4 = !DISubprogram(name: "g", linkageName: "_ZN7PR156371gEf", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: void (float)* @_ZN7PR156371gEf, variables: !2) +!4 = distinct !DISubprogram(name: "g", linkageName: "_ZN7PR156371gEf", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) !5 = !DINamespace(name: "PR15637", line: 1, file: !1, scope: null) !6 = !DISubroutineType(types: !7) !7 = !{null, !8} @@ -51,9 +51,9 @@ attributes #1 = { nounwind readnone } !19 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !12) !21 = !{!22} !22 = !DITemplateTypeParameter(name: "T", type: !8) -!23 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "value", line: 3, arg: 1, scope: !4, file: !11, type: !8) +!23 = !DILocalVariable(name: "value", line: 3, arg: 1, scope: !4, file: !11, type: !8) !24 = !DILocation(line: 3, scope: !4) -!25 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "tempValue", line: 4, scope: !4, file: !11, type: !12) +!25 = !DILocalVariable(name: "tempValue", line: 4, scope: !4, file: !11, type: !12) !26 = !DILocation(line: 4, scope: !4) !27 = !DILocation(line: 5, scope: !4) !28 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/X86/vector.ll b/test/DebugInfo/X86/vector.ll index f95ad956dea6..3e2092bd806f 100644 --- a/test/DebugInfo/X86/vector.ll +++ b/test/DebugInfo/X86/vector.ll @@ -12,7 +12,7 @@ !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!13} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 171825) (llvm/trunk 171822)", isOptimized: false, emissionKind: 0, file: !12, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 171825) (llvm/trunk 171822)", isOptimized: false, emissionKind: 0, file: !12, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) !1 = !{} !3 = !{!5} !5 = !DIGlobalVariable(name: "a", line: 3, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: <4 x i32>* @a) diff --git a/test/DebugInfo/X86/vla.ll b/test/DebugInfo/X86/vla.ll index dfcc5f1cce2a..5a25f021894e 100644 --- a/test/DebugInfo/X86/vla.ll +++ b/test/DebugInfo/X86/vla.ll @@ -1,6 +1,6 @@ ; RUN: llc -O0 -mtriple=x86_64-apple-darwin -filetype=asm %s -o - | FileCheck %s ; Ensure that we generate an indirect location for the variable length array a. -; CHECK: ##DEBUG_VALUE: vla:a <- RDX +; CHECK: ##DEBUG_VALUE: vla:a <- [%RDX+0] ; CHECK: DW_OP_breg1 ; rdar://problem/13658587 ; @@ -21,7 +21,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 target triple = "x86_64-apple-macosx10.8.0" ; Function Attrs: nounwind ssp uwtable -define i32 @vla(i32 %n) nounwind ssp uwtable { +define i32 @vla(i32 %n) nounwind ssp uwtable !dbg !4 { entry: %n.addr = alloca i32, align 4 %saved_stack = alloca i8* @@ -57,7 +57,7 @@ declare i8* @llvm.stacksave() nounwind declare void @llvm.stackrestore(i8*) nounwind ; Function Attrs: nounwind ssp uwtable -define i32 @main(i32 %argc, i8** %argv) nounwind ssp uwtable { +define i32 @main(i32 %argc, i8** %argv) nounwind ssp uwtable !dbg !9 { entry: %retval = alloca i32, align 4 %argc.addr = alloca i32, align 4 @@ -75,33 +75,33 @@ entry: !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!29} -!0 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) !1 = !DIFile(filename: "vla.c", directory: "") !2 = !{} !3 = !{!4, !9} -!4 = !DISubprogram(name: "vla", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (i32)* @vla, variables: !2) +!4 = distinct !DISubprogram(name: "vla", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2) !5 = !DIFile(filename: "vla.c", directory: "") !6 = !DISubroutineType(types: !7) !7 = !{!8, !8} !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = !DISubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !5, type: !10, function: i32 (i32, i8**)* @main, variables: !2) +!9 = distinct !DISubprogram(name: "main", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !5, type: !10, variables: !2) !10 = !DISubroutineType(types: !11) !11 = !{!8, !8, !12} !12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !13) !13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !14) !14 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) -!15 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "n", line: 1, arg: 1, scope: !4, file: !5, type: !8) +!15 = !DILocalVariable(name: "n", line: 1, arg: 1, scope: !4, file: !5, type: !8) !16 = !DILocation(line: 1, scope: !4) !17 = !DILocation(line: 2, scope: !4) -!18 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 2, scope: !4, file: !5, type: !19) +!18 = !DILocalVariable(name: "a", line: 2, scope: !4, file: !5, type: !19) !19 = !DICompositeType(tag: DW_TAG_array_type, align: 32, baseType: !8, elements: !20) !20 = !{!21} !21 = !DISubrange(count: -1) !22 = !DILocation(line: 3, scope: !4) !23 = !DILocation(line: 4, scope: !4) !24 = !DILocation(line: 5, scope: !4) -!25 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argc", line: 7, arg: 1, scope: !9, file: !5, type: !8) +!25 = !DILocalVariable(name: "argc", line: 7, arg: 1, scope: !9, file: !5, type: !8) !26 = !DILocation(line: 7, scope: !9) -!27 = !DILocalVariable(tag: DW_TAG_arg_variable, name: "argv", line: 7, arg: 2, scope: !9, file: !5, type: !12) +!27 = !DILocalVariable(name: "argv", line: 7, arg: 2, scope: !9, file: !5, type: !12) !28 = !DILocation(line: 8, scope: !9) !29 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/debugmacinfo.test b/test/DebugInfo/debugmacinfo.test new file mode 100644 index 000000000000..3f95169a7a4e --- /dev/null +++ b/test/DebugInfo/debugmacinfo.test @@ -0,0 +1,27 @@ +RUN: llvm-dwarfdump -debug-dump=macro %p/Inputs/dwarfdump-macro.o \
+RUN: | FileCheck %s -check-prefix TEST_MACINFO
+RUN: llvm-dwarfdump -debug-dump=line %p/Inputs/dwarfdump-macro.o \
+RUN: | FileCheck %s -check-prefix TEST_LINE
+
+
+; This test verifies that llvm-dwarfdump tools know how to read .debug_macinfo
+; section. It also checks that the file numbers fits with those in the
+; .debug_line section.
+TEST_MACINFO: .debug_macinfo contents:
+TEST_MACINFO: DW_MACINFO_define - lineno: 0 macro: M3 Value3
+TEST_MACINFO: DW_MACINFO_start_file - lineno: 0 filenum: 1
+TEST_MACINFO: DW_MACINFO_start_file - lineno: 0 filenum: 2
+TEST_MACINFO: DW_MACINFO_define - lineno: 1 macro: M4 Value4
+TEST_MACINFO: DW_MACINFO_end_file
+TEST_MACINFO: DW_MACINFO_define - lineno: 1 macro: M1 Value1
+TEST_MACINFO: DW_MACINFO_start_file - lineno: 2 filenum: 3
+TEST_MACINFO: DW_MACINFO_undef - lineno: 4 macro: M1
+TEST_MACINFO: DW_MACINFO_define - lineno: 5 macro: M1 NewValue1
+TEST_MACINFO: DW_MACINFO_end_file
+TEST_MACINFO: DW_MACINFO_define - lineno: 3 macro: M2(x,y) ((x)+(y)* Value2)
+TEST_MACINFO: DW_MACINFO_end_file
+
+TEST_LINE: .debug_line contents:
+TEST_LINE: file_names[ 1] 0 0x00000000 0x00000000 dwarfdump-macro.cc
+TEST_LINE: file_names[ 2] 1 0x00000000 0x00000000 dwarfdump-macro-cmd.h
+TEST_LINE: file_names[ 3] 0 0x00000000 0x00000000 dwarfdump-macro.h
diff --git a/test/DebugInfo/dwarfdump-accel.test b/test/DebugInfo/dwarfdump-accel.test index c5c3b0154c11..7c1838829562 100644 --- a/test/DebugInfo/dwarfdump-accel.test +++ b/test/DebugInfo/dwarfdump-accel.test @@ -57,7 +57,7 @@ CHECK-NOT: Magic Check ObjC specific accelerators. CHECK: .apple_objc contents: CHECK: Name{{.*}}"TestInterface" -CHECK-NOT Name +CHECK-NOT: Name CHECK: {Atom[0]: [[READONLY]]} CHECK: {Atom[0]: [[ASSIGN]]} CHECK: {Atom[0]: [[SETASSIGN]]} diff --git a/test/DebugInfo/dwarfdump-dump-flags.test b/test/DebugInfo/dwarfdump-dump-flags.test index 92b2d50f393b..4c10bede6f83 100644 --- a/test/DebugInfo/dwarfdump-dump-flags.test +++ b/test/DebugInfo/dwarfdump-dump-flags.test @@ -1,6 +1,9 @@ ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.elf-x86-64 -debug-dump=all | FileCheck %s -check-prefix DUMP_ALL ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.elf-x86-64 -debug-dump=info | FileCheck %s -check-prefix DUMP_INFO ; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.elf-x86-64 -debug-dump=ranges | FileCheck %s -check-prefix DUMP_RANGES +; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.macho-i386.o -debug-dump=all | FileCheck %s -check-prefix DUMP_ALL +; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.macho-i386.o -debug-dump=info | FileCheck %s -check-prefix DUMP_INFO +; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.macho-i386.o -debug-dump=ranges | FileCheck %s -check-prefix DUMP_RANGES ; DUMP_ALL: .debug_info ; DUMP_ALL: .debug_ranges diff --git a/test/DebugInfo/dwarfdump-dwp.test b/test/DebugInfo/dwarfdump-dwp.test new file mode 100644 index 000000000000..8aef636d4d9a --- /dev/null +++ b/test/DebugInfo/dwarfdump-dwp.test @@ -0,0 +1,53 @@ +RUN: llvm-dwarfdump %p/Inputs/dwarfdump-dwp.x86_64.o | FileCheck %s + +; Testing the following simple dwp file: +; a.cpp: +; struct foo { }; +; foo a; +; b.cpp: +; struct bar { }; +; bar b() { +; } + +; CHECK-LABEL: .debug_info.dwo contents: +; CHECK: Compile Unit + +; Verify that the second CU uses the index for its abbrev offset +; CHECK: Compile Unit +; CHECK-SAME: abbr_offset = 0x0043 +; CHECK: DW_TAG_compile_unit +; CHECK-NOT: DW_TAG +; CHECK: DW_AT_name {{.*}} "b.cpp" + +; Verify that abbreviations are decoded using the abbrev offset in the index +; CHECK: DW_TAG_structure_type +; CHECK: DW_TAG_subprogram + +; CHECK-LABEL: .debug_types.dwo contents: +; CHECK: Type Unit +; CHECK: DW_TAG_type_unit +; CHECK: DW_AT_stmt_list {{.*}}(0x00000000) +; CHECK: DW_TAG_structure_type +; CHECK: DW_AT_decl_file {{.*}} ("a.cpp") +; CHECK: Type Unit +; CHECK: DW_TAG_type_unit +; CHECK: DW_AT_stmt_list {{.*}}(0x00000000) +; CHECK: DW_TAG_structure_type +; CHECK: DW_AT_decl_file {{.*}} ("b.cpp") + +; CHECK: .debug_cu_index contents: +; CHECK-NEXT: version = 2 slots = 16 +; CHECK: Index Signature INFO ABBREV LINE STR_OFFSETS +; CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------ +; CHECK-NEXT: 3 0xfef104c25502f092 [0x0000002d, 0x0000005f) [0x00000043, 0x0000008e) [0x0000001a, 0x00000034) [0x00000010, 0x00000024) +; CHECK-NEXT: 9 0x03c30756e2d45008 [0x00000000, 0x0000002d) [0x00000000, 0x00000043) [0x00000000, 0x0000001a) [0x00000000, 0x00000010) + +; CHECK: .debug_tu_index contents: +; CHECK-NEXT: version = 2 slots = 16 +; CHECK: Index Signature TYPES ABBREV LINE STR_OFFSETS +; CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------ +; CHECK-NEXT: 9 0x1d02f3be30cc5688 [0x00000024, 0x00000048) [0x00000043, 0x0000008e) [0x0000001a, 0x00000034) [0x00000010, 0x00000024) +; CHECK-NEXT: 13 0x3875c0e21cda63fc [0x00000000, 0x00000024) [0x00000000, 0x00000043) [0x00000000, 0x0000001a) [0x00000000, 0x00000010) + +; TODO: use the index section offset info to correctly dump strings in debug info +; TODO: use the index section offset info to correctly dump file names in debug info diff --git a/test/DebugInfo/dwarfdump-macho-relocs.test b/test/DebugInfo/dwarfdump-macho-relocs.test new file mode 100644 index 000000000000..95798a841caf --- /dev/null +++ b/test/DebugInfo/dwarfdump-macho-relocs.test @@ -0,0 +1,27 @@ +// RUN: llvm-dwarfdump -debug-dump=info %p/Inputs/dwarfdump-macho-relocs.macho.x86_64.o | FileCheck %s + +// The dumped file has 2 functions in different sections of the __TEXT segment. +// Check that the addresses are are dumped correctly + +// Compiled with: clang -x c -g -c -o dwarfdump-macho-relocs.macho.x86_64.o dwarfdump-macho-relocs.test + +__attribute__((section("__TEXT,__blah"))) +int foo() { + return 42; +} + +// CHECK: DW_TAG_subprogram +// CHECK-NEXT: DW_AT_low_pc{{.*}}0x0000000000000020 +// CHECK-NEXT: DW_AT_high_pc{{.*}}0x000000000000002b +// CHECK-NEXT: DW_AT_frame_base +// CHECK-NEXT: DW_AT_name{{.*}}"foo" + +int main() { + return foo(); +} + +// CHECK: DW_TAG_subprogram +// CHECK-NEXT: DW_AT_low_pc{{.*}}0x0000000000000000 +// CHECK-NEXT: DW_AT_high_pc{{.*}}0x000000000000001a +// CHECK-NEXT: DW_AT_frame_base +// CHECK-NEXT: DW_AT_name{{.*}}"main" diff --git a/test/DebugInfo/dwarfdump-macho-universal.test b/test/DebugInfo/dwarfdump-macho-universal.test new file mode 100644 index 000000000000..0b4777317d7a --- /dev/null +++ b/test/DebugInfo/dwarfdump-macho-universal.test @@ -0,0 +1,17 @@ +Reuse a test input from llvm-dsymutil, it's perfect for what we want to exercise +RUN: llvm-dwarfdump %S/Inputs/fat-test.o -debug-dump=info | FileCheck %s + +CHECK: fat-test.o (x86_64): file format Mach-O 64-bit x86-64 +CHECK: DW_TAG_variable +CHECK-NOT: {{NULL|DW_TAG}} +CHECK: DW_AT_name {{.*}} "x86_64_var" + +CHECK: fat-test.o (i386): file format Mach-O 32-bit i386 +CHECK: DW_TAG_variable +CHECK-NOT: {{NULL|DW_TAG}} +CHECK: DW_AT_name {{.*}} "i386_var" + +CHECK: fat-test.o (x86_64h): file format Mach-O 64-bit x86-64 +CHECK: DW_TAG_variable +CHECK-NOT: {{NULL|DW_TAG}} +CHECK: DW_AT_name {{.*}} "x86_64h_var" diff --git a/test/DebugInfo/dwo.ll b/test/DebugInfo/dwo.ll new file mode 100644 index 000000000000..fd9aa16484c9 --- /dev/null +++ b/test/DebugInfo/dwo.ll @@ -0,0 +1,15 @@ +; RUN: %llc_dwarf %s -filetype=obj -o %t +; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s +; CHECK: DW_TAG_compile_unit +; CHECK: DW_AT_GNU_dwo_id {{.*}}abcd +; CHECK-NOT: DW_AT_GNU_dwo_name +; REQUIRES: default_triple + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "LLVM", isOptimized: false, runtimeVersion: 2, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2, dwoId: 43981) +!1 = !DIFile(filename: "<stdin>", directory: "/") +!2 = !{} +!3 = !{i32 2, !"Dwarf Version", i32 4} +!4 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/test/DebugInfo/gvn.ll b/test/DebugInfo/gvn.ll deleted file mode 100644 index 3ca3663bd831..000000000000 --- a/test/DebugInfo/gvn.ll +++ /dev/null @@ -1,135 +0,0 @@ -; RUN: opt < %s -O2 -gvn -S | FileCheck %s -; -; Produced at -O2 from: -; struct context { -; int cur_pid -; }; -; int a, b, c, f, d; -; int pid_for_task(int); -; sample(struct context *p1) -; { -; if (c) -; b = a; -; if (a && p1->cur_pid) -; sample_internal(); -; } -; callback() { -; f = pid_for_task(d); -; sample(&f); -; } - -target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" -target triple = "arm64-apple-ios" - -%struct.context = type { i32 } - -@c = common global i32 0, align 4 -@a = common global i32 0, align 4 -@b = common global i32 0, align 4 -@d = common global i32 0, align 4 -@f = common global i32 0, align 4 - -; Function Attrs: nounwind -declare i32 @sample_internal(...) - -; Function Attrs: nounwind -define i32 @callback() #0 { -entry: - %0 = load i32, i32* @d, align 4, !dbg !37 - - ; Verify that the call still has a debug location after GVN. - ; CHECK: %call = tail call i32 @pid_for_task(i32 %0) #{{[0-9]}}, !dbg - %call = tail call i32 @pid_for_task(i32 %0) #3, !dbg !37 - - store i32 %call, i32* @f, align 4, !dbg !37 - tail call void @llvm.dbg.value(metadata %struct.context* bitcast (i32* @f to %struct.context*), i64 0, metadata !25, metadata !26) #3, !dbg !38 - %1 = load i32, i32* @c, align 4, !dbg !40 - %tobool.i = icmp eq i32 %1, 0, !dbg !40 - %.pr.i = load i32, i32* @a, align 4, !dbg !41 - br i1 %tobool.i, label %if.end.i, label %if.then.i, !dbg !42 - -if.then.i: ; preds = %entry - store i32 %.pr.i, i32* @b, align 4, !dbg !43 - br label %if.end.i, !dbg !43 - -if.end.i: ; preds = %if.then.i, %entry - %tobool1.i = icmp eq i32 %.pr.i, 0, !dbg !41 - - ; This instruction has no debug location -- in this - ; particular case it was removed by a bug in SimplifyCFG. - %2 = load i32, i32* @f, align 4 - - ; GVN is supposed to replace the load of @f with a direct reference to %call. - ; CHECK: %tobool2.i = icmp eq i32 %call, 0, !dbg - %tobool2.i = icmp eq i32 %2, 0, !dbg !41 - - %or.cond = or i1 %tobool1.i, %tobool2.i, !dbg !41 - br i1 %or.cond, label %sample.exit, label %if.then.3.i, !dbg !41 - -if.then.3.i: ; preds = %if.end.i - %call.i = tail call i32 bitcast (i32 (...)* @sample_internal to i32 ()*)() #3, !dbg !44 - br label %sample.exit, !dbg !44 - -sample.exit: ; preds = %if.end.i, %if.then.3.i - ret i32 undef, !dbg !45 -} - -declare i32 @pid_for_task(i32) #1 - -; Function Attrs: nounwind readnone -declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2 - -attributes #0 = { nounwind } -attributes #2 = { nounwind readnone } -attributes #3 = { nounwind } - -!llvm.dbg.cu = !{!0} -!llvm.module.flags = !{!22, !23} -!llvm.ident = !{!24} - -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (trunk 244473) (llvm/trunk 244644)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, subprograms: !3, globals: !16) -!1 = !DIFile(filename: "test.c", directory: "/") -!2 = !{} -!3 = !{!4, !13} -!4 = !DISubprogram(name: "sample", scope: !5, file: !5, line: 6, type: !6, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: false, variables: !2) -!5 = !DIFile(filename: "test.i", directory: "/") -!6 = !DISubroutineType(types: !7) -!7 = !{!8, !9} -!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64) -!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "context", file: !5, line: 1, size: 32, align: 32, elements: !11) -!11 = !{!12} -!12 = !DIDerivedType(tag: DW_TAG_member, name: "cur_pid", scope: !10, file: !5, line: 2, baseType: !8, size: 32, align: 32) -!13 = !DISubprogram(name: "callback", scope: !5, file: !5, line: 13, type: !14, isLocal: false, isDefinition: true, scopeLine: 13, isOptimized: false, function: i32 ()* @callback, variables: !2) -!14 = !DISubroutineType(types: !15) -!15 = !{!8} -!16 = !{!17, !18, !19, !20, !21} -!17 = !DIGlobalVariable(name: "a", scope: !0, file: !5, line: 4, type: !8, isLocal: false, isDefinition: true, variable: i32* @a) -!18 = !DIGlobalVariable(name: "b", scope: !0, file: !5, line: 4, type: !8, isLocal: false, isDefinition: true, variable: i32* @b) -!19 = !DIGlobalVariable(name: "c", scope: !0, file: !5, line: 4, type: !8, isLocal: false, isDefinition: true, variable: i32* @c) -!20 = !DIGlobalVariable(name: "f", scope: !0, file: !5, line: 4, type: !8, isLocal: false, isDefinition: true, variable: i32* @f) -!21 = !DIGlobalVariable(name: "d", scope: !0, file: !5, line: 4, type: !8, isLocal: false, isDefinition: true, variable: i32* @d) -!22 = !{i32 2, !"Dwarf Version", i32 2} -!23 = !{i32 2, !"Debug Info Version", i32 3} -!24 = !{!"clang version 3.8.0 (trunk 244473) (llvm/trunk 244644)"} -!25 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "p1", arg: 1, scope: !4, file: !5, line: 6, type: !9) -!26 = !DIExpression() -!27 = !DILocation(line: 6, scope: !4) -!28 = !DILocation(line: 8, scope: !29) -!29 = distinct !DILexicalBlock(scope: !4, file: !5, line: 8) -!30 = !DILocation(line: 10, scope: !31) -!31 = distinct !DILexicalBlock(scope: !4, file: !5, line: 10) -!32 = !DILocation(line: 8, scope: !4) -!33 = !DILocation(line: 9, scope: !29) -!34 = !DILocation(line: 10, scope: !4) -!35 = !DILocation(line: 11, scope: !31) -!36 = !DILocation(line: 12, scope: !4) -!37 = !DILocation(line: 14, scope: !13) -!38 = !DILocation(line: 6, scope: !4, inlinedAt: !39) -!39 = distinct !DILocation(line: 15, scope: !13) -!40 = !DILocation(line: 8, scope: !29, inlinedAt: !39) -!41 = !DILocation(line: 10, scope: !31, inlinedAt: !39) -!42 = !DILocation(line: 8, scope: !4, inlinedAt: !39) -!43 = !DILocation(line: 9, scope: !29, inlinedAt: !39) -!44 = !DILocation(line: 11, scope: !31, inlinedAt: !39) -!45 = !DILocation(line: 16, scope: !13) diff --git a/test/DebugInfo/llvm-symbolizer.test b/test/DebugInfo/llvm-symbolizer.test index 8a2aaaab3a3c..6b3c0494cdd5 100644 --- a/test/DebugInfo/llvm-symbolizer.test +++ b/test/DebugInfo/llvm-symbolizer.test @@ -118,7 +118,9 @@ CHECK-NEXT: main CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:11:0 RUN: echo "unexisting-file 0x1234" > %t.input2 -RUN: llvm-symbolizer < %t.input2 +RUN: llvm-symbolizer < %t.input2 2>&1 | FileCheck %s --check-prefix=MISSING-FILE + +MISSING-FILE: LLVMSymbolizer: error reading file: {{[Nn]}}o such file or directory RUN: echo "%p/Inputs/macho-universal 0x1f84" > %t.input3 RUN: llvm-symbolizer < %t.input3 | FileCheck %s --check-prefix=UNKNOWN-ARCH @@ -154,7 +156,7 @@ RUN: | FileCheck %s --check-prefix=STRIPPED STRIPPED: global_func RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" > %t.input7 -RUN: llvm-symbolizer --functions=short --use-symbol-table=false --demangle=false < %t.input7 \ +RUN: llvm-symbolizer --functions=short --demangle=false < %t.input7 \ RUN: | FileCheck %s --check-prefix=SHORT_FUNCTION_NAME SHORT_FUNCTION_NAME-NOT: _Z1cv diff --git a/test/DebugInfo/skeletoncu.ll b/test/DebugInfo/skeletoncu.ll new file mode 100644 index 000000000000..d70e9333336a --- /dev/null +++ b/test/DebugInfo/skeletoncu.ll @@ -0,0 +1,17 @@ +; RUN: %llc_dwarf %s -filetype=obj -o %t +; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s +; XFAIL: hexagon +; CHECK: DW_TAG_compile_unit +; CHECK: DW_AT_GNU_dwo_id {{.*}}abcd +; CHECK: DW_AT_GNU_dwo_name {{.*}}"my.dwo" +; REQUIRES: default_triple + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "LLVM", isOptimized: false, runtimeVersion: 2, splitDebugFilename: "my.dwo", emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2, dwoId: 43981) +!1 = !DIFile(filename: "<stdin>", directory: "/") +!2 = !{} +!3 = !{i32 2, !"Dwarf Version", i32 4} +!4 = !{i32 2, !"Debug Info Version", i32 3} + |
