diff options
Diffstat (limited to 'llvm/test/Assembler')
| -rw-r--r-- | llvm/test/Assembler/debug-label-bitcode.ll | 55 | ||||
| -rw-r--r-- | llvm/test/Assembler/disubprogram.ll | 8 | ||||
| -rw-r--r-- | llvm/test/Assembler/drop-debug-info.ll | 2 |
3 files changed, 60 insertions, 5 deletions
diff --git a/llvm/test/Assembler/debug-label-bitcode.ll b/llvm/test/Assembler/debug-label-bitcode.ll new file mode 100644 index 00000000000..9eb56e424b0 --- /dev/null +++ b/llvm/test/Assembler/debug-label-bitcode.ll @@ -0,0 +1,55 @@ +; Test bitcode writer/reader for DILabel metadata. +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s +; RUN: verify-uselistorder %s +; +; CHECK: top: +; CHECK: call void @llvm.dbg.label(metadata [[LABEL_METADATA:![0-9]+]]) +; CHECK: distinct !DISubprogram(name: "foo", {{.*}}, retainedNodes: [[ELEMENTS:![0-9]+]]) +; CHECK: [[ELEMENTS]] = !{[[LABEL_METADATA]]} +; CHECK: [[LABEL_METADATA]] = !DILabel({{.*}}, name: "top", {{.*}}, line: 4) + +source_filename = "debug-label-bitcode.c" + +; Function Attrs: noinline nounwind optnone +define i32 @foo(i32 signext %a, i32 signext %b) !dbg !4 { +entry: + %a.addr = alloca i32, align 4 + %b.addr = alloca i32, align 4 + %sum = alloca i32, align 4 + store i32 %a, i32* %a.addr, align 4 + store i32 %b, i32* %b.addr, align 4 + br label %top + +top: ; preds = %entry + call void @llvm.dbg.label(metadata !9), !dbg !10 + %0 = load i32, i32* %a.addr, align 4 + %1 = load i32, i32* %b.addr, align 4 + %add = add nsw i32 %0, %1 + store i32 %add, i32* %sum, align 4 + br label %done + +done: ; preds = %top + call void @llvm.dbg.label(metadata !11), !dbg !12 + %2 = load i32, i32* %sum, align 4 + ret i32 %2 +} + +; Function Attrs: nounwind readnone speculatable +declare void @llvm.dbg.label(metadata) + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang 6.0.0", isOptimized: false, emissionKind: FullDebug, enums: !2) +!1 = !DIFile(filename: "debug-label-bitcode.c", directory: "./") +!2 = !{} +!3 = !{i32 2, !"Debug Info Version", i32 3} +!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, retainedNodes: !5) +!5 = !{!9} +!6 = !DISubroutineType(types: !7) +!7 = !{!8, !8, !8} +!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +!9 = !DILabel(scope: !4, name: "top", file: !1, line: 4) +!10 = !DILocation(line: 4, column: 1, scope: !4) +!11 = !DILabel(scope: !4, name: "done", file: !1, line: 7) +!12 = !DILocation(line: 7, column: 1, scope: !4) diff --git a/llvm/test/Assembler/disubprogram.ll b/llvm/test/Assembler/disubprogram.ll index 8a3a60aa079..a407f3da8bd 100644 --- a/llvm/test/Assembler/disubprogram.ll +++ b/llvm/test/Assembler/disubprogram.ll @@ -28,7 +28,7 @@ define void @_Z3foov() !dbg !9 { ; CHECK: !9 = !DISubprogram(scope: null, isLocal: false, isDefinition: false, isOptimized: false) !9 = !DISubprogram(isDefinition: false) -; CHECK: !10 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, isLocal: true, isDefinition: true, scopeLine: 8, containingType: !4, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10, thisAdjustment: 3, flags: DIFlagPrototyped | DIFlagNoReturn, isOptimized: true, unit: !8, templateParams: !5, declaration: !9, variables: !6) +; CHECK: !10 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, isLocal: true, isDefinition: true, scopeLine: 8, containingType: !4, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10, thisAdjustment: 3, flags: DIFlagPrototyped | DIFlagNoReturn, isOptimized: true, unit: !8, templateParams: !5, declaration: !9, retainedNodes: !6) !10 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, isLocal: true, isDefinition: true, scopeLine: 8, @@ -36,7 +36,7 @@ define void @_Z3foov() !dbg !9 { virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10, thisAdjustment: 3, flags: DIFlagPrototyped | DIFlagNoReturn, isOptimized: true, unit: !8, templateParams: !5, - declaration: !9, variables: !6) + declaration: !9, retainedNodes: !6) ; CHECK: !11 = distinct !DISubprogram ; CHECK-SAME: virtualIndex: 0, @@ -48,7 +48,7 @@ define void @_Z3foov() !dbg !9 { virtualIndex: 0, flags: DIFlagPrototyped, isOptimized: true, unit: !8, templateParams: !5, declaration: !9, - variables: !6) + retainedNodes: !6) ; CHECK: !12 = distinct !DISubprogram ; CHECK-NOT: virtualIndex @@ -59,7 +59,7 @@ define void @_Z3foov() !dbg !9 { virtuality: DW_VIRTUALITY_none, flags: DIFlagPrototyped, isOptimized: true, unit: !8, - templateParams: !5, declaration: !9, variables: !6) + templateParams: !5, declaration: !9, retainedNodes: !6) !13 = !{!4} ; CHECK: !13 = !{!4} diff --git a/llvm/test/Assembler/drop-debug-info.ll b/llvm/test/Assembler/drop-debug-info.ll index 770ee5fe988..0bec8f0679e 100644 --- a/llvm/test/Assembler/drop-debug-info.ll +++ b/llvm/test/Assembler/drop-debug-info.ll @@ -15,7 +15,7 @@ entry: !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 (trunk 195495) (llvm/trunk 195495:195504M)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2) !1 = !DIFile(filename: "../llvm/tools/clang/test/CodeGen/debug-info-version.c", directory: "/Users/manmanren/llvm_gmail/release") !2 = !{i32 0} -!4 = distinct !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) +!4 = distinct !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, retainedNodes: !2) !5 = !DIFile(filename: "../llvm/tools/clang/test/CodeGen/debug-info-version.c", directory: "/Users/manmanren/llvm_gmail/release") !6 = !DISubroutineType(types: !7) !7 = !{!8} |

