brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 8a49256 Raw
52 lines · plain
1; RUN: llc -mtriple=x86_64-unknown-linux-gnu -start-after=codegenprepare -stop-before=finalize-isel -o - %s -experimental-debug-variable-locations=true | FileCheck %s --implicit-check-not=DBG_PHI2 3; Test that for multiple dbg.values referring to the same argument, we emit a4; single DBG_PHI and refer to it twice. (Using more than one DBG_PHI is fine,5; but inefficient).6 7; CHECK-DAG: ![[LOCAL:.*]] = !DILocalVariable(name: "local"8; CHECK-DAG: ![[LOCAL2:.*]] = !DILocalVariable(name: "local2"9 10; CHECK: DBG_PHI $edi, 111 12; CHECK: DBG_INSTR_REF ![[LOCAL]], !DIExpression(DW_OP_LLVM_arg, 0), dbg-instr-ref(1, 0)13; CHECK: DBG_INSTR_REF ![[LOCAL2]], !DIExpression(DW_OP_LLVM_arg, 0), dbg-instr-ref(1, 0)14 15declare void @bar(i32)16declare void @llvm.dbg.value(metadata, metadata, metadata)17 18define dso_local void @foo_local(i32 %t1a) local_unnamed_addr !dbg !7 {19entry:20  tail call void @bar(i32 %t1a) #3, !dbg !1721  %bees = add i32 %t1a, 322  call void @llvm.dbg.value(metadata i32 %t1a, metadata !13, metadata !DIExpression()), !dbg !1423  call void @llvm.dbg.value(metadata i32 %t1a, metadata !19, metadata !DIExpression()), !dbg !1424  tail call void @bar(i32 %bees) #3, !dbg !1725  ret void, !dbg !1826}27 28!llvm.dbg.cu = !{!0}29!llvm.module.flags = !{!3, !4, !5}30!llvm.ident = !{!6}31 32!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)33!1 = !DIFile(filename: "foo.c", directory: "")34!2 = !{}35!3 = !{i32 2, !"Dwarf Version", i32 4}36!4 = !{i32 2, !"Debug Info Version", i32 3}37!5 = !{i32 1, !"wchar_size", i32 4}38!6 = !{!"clang"}39!7 = distinct !DISubprogram(name: "foo_local", scope: !1, file: !1, line: 3, type: !8, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11)40!8 = !DISubroutineType(types: !9)41!9 = !{null, !10}42!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)43!11 = !{!12, !13}44!12 = !DILocalVariable(name: "t1a", arg: 1, scope: !7, file: !1, line: 3, type: !10)45!13 = !DILocalVariable(name: "local", scope: !7, file: !1, line: 4, type: !10)46!14 = !DILocation(line: 3, column: 20, scope: !7)47!15 = !DILocation(line: 4, column: 7, scope: !7)48!16 = !DILocation(line: 5, column: 3, scope: !7)49!17 = !DILocation(line: 7, column: 3, scope: !7)50!18 = !DILocation(line: 8, column: 1, scope: !7)51!19 = !DILocalVariable(name: "local2", scope: !7, file: !1, line: 4, type: !10)52