68 lines · plain
1# RUN: llc -O1 -start-after register-coalescer -o - %s -experimental-debug-variable-locations=false | FileCheck %s2 3--- |4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"5 target triple = "x86_64-pc-linux-gnu"6 7 define i16 @foo(i8 %zzz) !dbg !4 {8 entry:9 ret i16 110 }11 12 ; Function Attrs: nounwind readnone speculatable13 declare void @llvm.dbg.value(metadata, metadata, metadata)14 15 !llvm.dbg.cu = !{!0}16 !llvm.module.flags = !{!3}17 18 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2)19 !1 = !DIFile(filename: "test.c", directory: "")20 !2 = !{}21 !3 = !{i32 1, !"Debug Info Version", i32 3}22 !4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0)23 !5 = !DISubroutineType(types: !6)24 !6 = !{null}25 !7 = !DILocalVariable(name: "zzz", arg: 1, scope: !4, file: !1, line: 3, type: !8)26 !8 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed)27 !9 = !DILocation(line: 0, scope: !4)28 !10 = !DILocation(line: 4, column: 22, scope: !11)29 !11 = distinct !DILexicalBlock(scope: !4, file: !1, line: 3, column: 19)30 31...32---33name: foo34tracksRegLiveness: true35body: |36 bb.0:37 %0:gr16_abcd = MOV16ri 138 39 bb.1:40 DBG_VALUE %0.sub_8bit_hi, $noreg, !7, !DIExpression(), debug-location !941 %1:gr16 = COPY %042 %2:gr16 = COPY %043 44 bb.2:45 $ax = COPY %146 $dx = COPY %247 RET64 killed $ax, killed $dx48...49 50# This test case was created as a reproducer for a bug when we got incorrect51# DBG_VALUE instructions after regalloc like this:52#53# movw $1, %cx54# #DEBUG_VALUE: foo:zzz <- $ch55# movl %ecx, %eax56# #DEBUG_VALUE: foo:zzz <- $ax57#58# The above is incorrect since the DBG_VALUE in the input is refering to the59# hi subreg, so after the COPY/movl the value is in $ah and not $ax (nor $al).60#61# We currently only get one DEBUG_VALUE here. In the future we could allow a62# second DEBUG_VALUE, as long as it is mapped to the hi subreg of the movl63# dst.64#65# CHECK-NOT: #DEBUG_VALUE:66# CHECK: #DEBUG_VALUE: foo:zzz <- ${{[abcd]+}}h67# CHECK-NOT: #DEBUG_VALUE:68