[DebugInfo] Fix tests so that each subprogram belongs to a CU.

llvm-svn: 265490
This commit is contained in:
Davide Italiano 2016-04-05 23:37:08 +00:00
parent 5300950f3a
commit ea04026c13
14 changed files with 89 additions and 11 deletions

View File

@ -22,6 +22,8 @@ define i32 @main() nounwind readonly !dbg !1 {
ret i32 4, !dbg !DILocation(scope: !1)
}
!llvm.dbg.cu = !{!6}
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
!7 = !{!1}
@ -33,7 +35,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
!4 = !{!5}
!5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!8 = !DIFile(filename: "/d/j/debug-test.c", directory: "/Volumes/Data/b")
!9 = !{i32 0}
!9 = !{}
!llvm.module.flags = !{!10}
!10 = !{i32 1, !"Debug Info Version", i32 3}

View File

@ -2,7 +2,7 @@
; RUN: verify-uselistorder %s
; CHECK-LABEL: @test
; CHECK: ret void, !bar !1, !foo !0
; CHECK: ret void, !bar !4, !foo !5
define void @test() {
add i32 2, 1, !bar !0
add i32 1, 2, !foo !1
@ -11,29 +11,38 @@ define void @test() {
ret void, !foo !0, !bar !1
}
; CHECK-LABEL: define void @test2() !foo !2 !baz !3
; CHECK-LABEL: define void @test2() !foo !6 !baz !7
define void @test2() !foo !2 !baz !3 {
unreachable
}
; CHECK-LABEL: define void @test3() !bar !3
; CHECK: unreachable, !bar !4
; CHECK-LABEL: define void @test3() !bar !7
; CHECK: unreachable, !bar !8
define void @test3() !bar !3 {
unreachable, !bar !4
}
; CHECK-LABEL: define void @test_attachment_name() {
; CHECK: unreachable, !\342abc !4
; CHECK: unreachable, !\342abc !8
define void @test_attachment_name() {
;; Escape the first character when printing text IR, since it's a digit
unreachable, !\34\32abc !4
}
!llvm.module.flags = !{!7}
!llvm.dbg.cu = !{!5}
!0 = !DILocation(line: 662302, column: 26, scope: !1)
!1 = distinct !DISubprogram(name: "foo")
!2 = distinct !{}
!3 = distinct !{}
!4 = distinct !{}
!5 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !6,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2,
subprograms: !{!1})
!6 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
!7 = !{i32 2, !"Debug Info Version", i32 3}
declare void @llvm.dbg.func.start(metadata) nounwind readnone

View File

@ -31,7 +31,8 @@
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3}
!0 = distinct !DICompileUnit(language: DW_LANG_C89, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2)
!0 = distinct !DICompileUnit(language: DW_LANG_C89, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2,
subprograms: !{!5})
!1 = !DIFile(filename: "t.c", directory: "")
!2 = !{}
!3 = !{i32 1, !"Debug Info Version", i32 3}
@ -52,8 +53,8 @@ frameInfo:
maxAlignment: 16
# CHECK-LABEL: foo
# CHECK: stack:
# CHECK: - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, di-variable: '!4',
# CHECK-NEXT: di-expression: '!10', di-location: '!11' }
# CHECK: - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, di-variable: '!6',
# CHECK-NEXT: di-expression: '!11', di-location: '!12' }
stack:
- { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, di-variable: '!4',
di-expression: '!7', di-location: '!8' }

View File

@ -53,7 +53,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon
!2 = distinct !DILexicalBlock(line: 44, column: 0, file: !101, scope: !3)
!3 = distinct !DISubprogram(name: "getClosestDiagonal3", linkageName: "_Z19getClosestDiagonal3ii", line: 44, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !101, scope: null, type: !6)
!4 = !DIFile(filename: "ggEdgeDiscrepancy.cc", directory: "/Volumes/Home/grosbaj/sources/llvm-externals/speccpu2000/benchspec/CINT2000/252.eon/src")
!5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 00)", isOptimized: true, emissionKind: FullDebug, file: !101, enums: !102, retainedTypes: !102, subprograms: !103)
!5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 00)", isOptimized: true, emissionKind: FullDebug, file: !101, enums: !102, retainedTypes: !102, subprograms: !{!3, !37, !41, !42, !77})
!6 = !DISubroutineType(types: !7)
!7 = !{!8, !22, !22}
!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "ggVector3", line: 66, size: 192, align: 32, file: !99, elements: !10)

View File

@ -2022,6 +2022,7 @@ entry:
; CHECK: call void @__tsan_atomic_thread_fence(i32 5), !dbg
!llvm.module.flags = !{!0, !1, !2}
!llvm.dbg.cu = !{!8}
!0 = !{i32 2, !"Dwarf Version", i32 4}
!1 = !{i32 2, !"Debug Info Version", i32 3}
!2 = !{i32 1, !"PIC Level", i32 2}
@ -2031,3 +2032,9 @@ entry:
!5 = !DIFile(filename: "atomic.cpp", directory: "/tmp")
!6 = distinct !DISubprogram(name: "test", scope: !5, file: !5, line: 99, type: !4, isLocal: false, isDefinition: true, scopeLine: 100, flags: DIFlagPrototyped, isOptimized: false, variables: !3)
!7 = !DILocation(line: 100, column: 1, scope: !6)
!8 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !5,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2,
subprograms: !{!6})

View File

@ -92,6 +92,7 @@ if.end:
!6 = !{!"int", !3, i64 0}
!llvm.module.flags = !{!7, !8, !9}
!llvm.dbg.cu = !{!18}
!7 = !{i32 2, !"Dwarf Version", i32 4}
!8 = !{i32 2, !"Debug Info Version", i32 3}
!9 = !{i32 1, !"PIC Level", i32 2}
@ -104,4 +105,8 @@ if.end:
!15 = !DILocation(line: 101, column: 1, scope: !13)
!16 = !DILocation(line: 102, column: 1, scope: !13)
!17 = !DILocation(line: 103, column: 1, scope: !13)
!18 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !12,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2,
subprograms: !{!13})

View File

@ -37,6 +37,7 @@ end:
}
!llvm.module.flags = !{!0, !1, !2}
!llvm.dbg.cu = !{!12}
!0 = !{i32 2, !"Dwarf Version", i32 4}
!1 = !{i32 2, !"Debug Info Version", i32 3}
!2 = !{i32 1, !"PIC Level", i32 2}
@ -50,3 +51,8 @@ end:
!9 = !DILocation(line: 45, column: 1, scope: !6)
!10 = !DILocation(line: 46, column: 1, scope: !6)
!11 = !DILocation(line: 47, column: 1, scope: !6)
!12 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !5,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2,
subprograms: !{!6})

View File

@ -31,7 +31,15 @@ lpad:
}
!llvm.module.flags = !{!1}
!llvm.dbg.cu = !{!5}
!1 = !{i32 2, !"Debug Info Version", i32 3}
!2 = distinct !DISubprogram()
!3 = !DILocation(line: 1, scope: !2)
!4 = !DILocation(line: 2, scope: !2)
!5 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !6,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2,
subprograms: !{!2})
!6 = !DIFile(filename: "path/davidino", directory: "/path/to/dir")

View File

@ -73,6 +73,7 @@ eh.resume: ; preds = %catch
; CHECK-DAG: [[LPAD_PREHEADER_LOC]] = !DILocation(line: 85, column: 1, scope: !{{[0-9]+}})
!llvm.module.flags = !{!0, !1, !2}
!llvm.dbg.cu = !{!14}
!0 = !{i32 2, !"Dwarf Version", i32 4}
!1 = !{i32 2, !"Debug Info Version", i32 3}
!2 = !{i32 1, !"PIC Level", i32 2}
@ -88,3 +89,8 @@ eh.resume: ; preds = %catch
!11 = !DILocation(line: 73, column: 46, scope: !6)
!12 = !DILocation(line: 75, column: 9, scope: !6)
!13 = !DILocation(line: 85, column: 1, scope: !6)
!14 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !5,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2,
subprograms: !{!6})

View File

@ -24,6 +24,7 @@ BE2: ; preds = %n br label %Loop
}
!llvm.module.flags = !{!0, !1}
!llvm.dbg.cu = !{!12}
!0 = !{i32 2, !"Dwarf Version", i32 4}
!1 = !{i32 2, !"Debug Info Version", i32 3}
@ -37,3 +38,8 @@ BE2: ; preds = %n br label %Loop
!9 = !DILocation(line: 103, column: 1, scope: !5)
!10 = !DILocation(line: 104, column: 1, scope: !5)
!11 = !DILocation(line: 105, column: 1, scope: !5)
!12 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !4,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2,
subprograms: !{!5})

View File

@ -53,6 +53,7 @@ for.end: ; preds = %for.body, %entry
}
!llvm.module.flags = !{!0, !1, !2}
!llvm.dbg.cu = !{!11}
!0 = !{i32 2, !"Dwarf Version", i32 4}
!1 = !{i32 2, !"Debug Info Version", i32 3}
!2 = !{i32 1, !"PIC Level", i32 2}
@ -65,3 +66,8 @@ for.end: ; preds = %for.body, %entry
!8 = !DILocation(line: 101, column: 1, scope: !6)
!9 = !DILocation(line: 102, column: 1, scope: !6)
!10 = !DILocation(line: 103, column: 1, scope: !6)
!11 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !5,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2,
subprograms: !{!6})

View File

@ -71,6 +71,7 @@ for.body: ; preds = %for.body.preheader,
attributes #0 = { nounwind }
!llvm.dbg.cu = !{!28}
!llvm.module.flags = !{!0, !1}
!llvm.ident = !{!2}
@ -102,3 +103,8 @@ attributes #0 = { nounwind }
!25 = !DILocation(line: 17, column: 11, scope: !20)
!26 = distinct !{!26, !27, !18}
!27 = !{!"llvm.loop.vectorize.enable", i1 true}
!28 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !5,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2,
subprograms: !{!4, !20})

View File

@ -67,6 +67,7 @@ loopexit:
; CHECK: [[BODY_LOC]] = !DILocation(line: 101, column: 1, scope: !{{.*}})
!llvm.module.flags = !{!0, !1}
!llvm.dbg.cu = !{!9}
!0 = !{i32 2, !"Dwarf Version", i32 4}
!1 = !{i32 2, !"Debug Info Version", i32 3}
@ -77,3 +78,10 @@ loopexit:
!6 = !DILocation(line: 100, column: 1, scope: !5)
!7 = !DILocation(line: 101, column: 1, scope: !5)
!8 = !DILocation(line: 102, column: 1, scope: !5)
!9 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !10,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2,
subprograms: !{!5})
!10 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
!11 = !{i32 2, !"Debug Info Version", i32 3}

View File

@ -3037,10 +3037,18 @@ define void @test67(i8* %x) {
}
!llvm.module.flags = !{!1}
!llvm.dbg.cu = !{!3}
!0 = !{}
!1 = !{i32 1, !"Debug Info Version", i32 3}
!2 = distinct !DISubprogram()
!3 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
file: !4,
isOptimized: true, flags: "-O2",
splitDebugFilename: "abc.debug", emissionKind: 2,
subprograms: !{!2})
!4 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
!5 = !{i32 2, !"Debug Info Version", i32 3}
; CHECK: attributes #0 = { nounwind readnone }
; CHECK: attributes [[NUW]] = { nounwind }