brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · f5bde71 Raw
69 lines · plain
1; RUN: llc -start-after=codegenprepare -stop-before finalize-isel -o - %s \2; RUN:    -experimental-debug-variable-locations=false \3; RUN: | FileCheck %s --check-prefixes=CHECK,DBGVALUE4; RUN: llc -start-after=codegenprepare -stop-before finalize-isel -o - %s \5; RUN:    -experimental-debug-variable-locations=true \6; RUN: | FileCheck %s --check-prefixes=CHECK,INSTRREF7 8; Test that dbg.values of an SSA variable that's not used in a basic block,9; is converted to a DBG_VALUE in that same basic block. We know that %1 is10; live from the entry bb to the exit bb, is allocated a vreg because it's11; used across basic blocks. We should be able to produce a DBG_VALUE that12; refers to it in the nextbb block.13 14source_filename = "debug.c"15target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"16target triple = "x86_64-unknown-linux-gnu"17 18; Function Attrs: nounwind uwtable19define dso_local i32 @main(i32 %arg0, i32 %arg1) local_unnamed_addr !dbg !11 {20entry:21; CHECK-LABEL: bb.0.entry:22; INSTRREF: ADD32ri {{.*}} debug-instr-number 123  %0 = add i32 %arg0, 42, !dbg !2624  %1 = add i32 %arg1, 101, !dbg !2625  %cmp = icmp eq i32 %1, 026  br i1 %cmp, label %nextbb, label %exit, !dbg !2627 28nextbb:29; CHECK-LABEL: bb.{{.*}}.nextbb30  %2 = mul i32 %0, %arg1, !dbg !2631; CHECK: IMUL32rr32  call void @llvm.dbg.value(metadata i32 %1, metadata !16, metadata !DIExpression()), !dbg !2733; INSTRREF-NEXT: DBG_INSTR_REF {{.+}}, dbg-instr-ref(1, 0)34; DBGVALUE-NEXT: DBG_VALUE35  br label %exit, !dbg !2636 37; CHECK-LABEL: bb.{{.*}}.exit38exit:39  %3 = phi i32 [ 12, %entry ], [ %2, %nextbb ], !dbg !2640  %4 = add i32 %1, %3, !dbg !2641  ret i32 %4, !dbg !2642}43 44declare void @llvm.dbg.value(metadata, metadata, metadata)45 46!llvm.dbg.cu = !{!2}47!llvm.module.flags = !{!7, !8, !9}48!llvm.ident = !{!10}49 50!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 7.0.0 (x)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4)51!3 = !DIFile(filename: "debug.c", directory: "")52!4 = !{}53!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)54!7 = !{i32 2, !"Dwarf Version", i32 4}55!8 = !{i32 2, !"Debug Info Version", i32 3}56!9 = !{i32 1, !"wchar_size", i32 4}57!10 = !{!"clang version 7.0.0 (x)"}58!11 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 3, type: !12, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !2, retainedNodes: !14)59!12 = !DISubroutineType(types: !13)60!13 = !{!6}61!14 = !{!16}62!16 = !DILocalVariable(name: "y", scope: !11, file: !3, line: 5, type: !6)63!26 = !DILocation(line: 4, column: 7, scope: !11)64!27 = !DILocation(line: 5, column: 7, scope: !11)65!31 = !{!32, !32, i64 0}66!32 = !{!"int", !33, i64 0}67!33 = !{!"omnipotent char", !34, i64 0}68!34 = !{!"Simple C/C++ TBAA"}69