1 # RUN: llc -mtriple i386 -start-before=greedy -stop-after=livedebugvars %s -o - | FileCheck %s
3 # There should be multiple debug values for this variable after regalloc. The
4 # value has been spilled, but we shouldn't lose track of the location because
7 # CHECK-COUNT-4: DBG_VALUE $ebp, 0, !6, !DIExpression(DW_OP_constu, 16, DW_OP_minus), debug-location !10
11 define void @main() #0 !dbg !4 {
13 #dbg_value(i32 undef, !6, !DIExpression(), !10)
17 attributes #0 = { "frame-pointer"="all" }
20 !llvm.module.flags = !{!3}
22 !0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang version 20.0.0git.prerel", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, globals: !2, splitDebugInlining: false, nameTableKind: None)
23 !1 = !DIFile(filename: "xx.c", directory: "/path", checksumkind: CSK_MD5, checksum: "c4b2fc62bca9171ad484c91fb78b8842")
25 !3 = !{i32 2, !"Debug Info Version", i32 3}
26 !4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 20, type: !5, scopeLine: 20, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
27 !5 = !DISubroutineType(types: !2)
28 !6 = !DILocalVariable(name: "flag", arg: 2, scope: !7, file: !1, line: 8, type: !9)
29 !7 = distinct !DISubprogram(name: "transparent_crc", scope: !1, file: !1, line: 8, type: !8, scopeLine: 8, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
30 !8 = distinct !DISubroutineType(types: !2)
31 !9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
32 !10 = !DILocation(line: 0, scope: !7, inlinedAt: !11)
33 !11 = distinct !DILocation(line: 28, column: 3, scope: !4)
39 tracksRegLiveness: true
43 - { id: 0, type: default, offset: 0, size: 4, alignment: 4, stack-id: default,
44 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
45 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
46 - { id: 1, type: default, offset: 4, size: 4, alignment: 4, stack-id: default,
47 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
48 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
49 - { id: 2, type: default, offset: 8, size: 1, alignment: 4, stack-id: default,
50 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
51 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
52 - { id: 3, type: default, offset: 12, size: 4, alignment: 4, stack-id: default,
53 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
54 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
57 successors: %bb.2(0x80000000)
59 %0:gr32 = MOV32rm %fixed-stack.3, 1, $noreg, 0, $noreg :: (load (s32) from %fixed-stack.3)
60 %1:gr8 = MOV8rm %fixed-stack.2, 1, $noreg, 0, $noreg :: (load (s8) from %fixed-stack.2, align 4)
61 %2:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (load (s32) from %fixed-stack.0)
62 %3:gr32_abcd = MOV32r0 implicit-def dead $eflags
63 TEST32rr %2, %2, implicit-def $eflags
64 %3.sub_8bit:gr32_abcd = SETCCr 5, implicit $eflags
66 %4:gr32 = SAR32ri %4, 1, implicit-def dead $eflags
67 %5:gr32 = MOV32rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (load (s32) from %fixed-stack.1)
68 %6:gr32 = MOV32r0 implicit-def dead $eflags
72 successors: %bb.4(0x30000000), %bb.3(0x50000000)
74 DBG_VALUE %3, $noreg, !6, !DIExpression(), debug-location !10
75 TEST32rr %3, %3, implicit-def $eflags
76 JCC_1 %bb.4, 4, implicit $eflags
80 successors: %bb.1(0x04000000), %bb.2(0x7c000000)
82 %6:gr32 = XOR32rr %6, %0, implicit-def dead $eflags
83 %6:gr32 = SAR32ri %6, 2, implicit-def dead $eflags
84 %6:gr32 = XOR32rr %6, %4, implicit-def dead $eflags
85 %6:gr32 = XOR32rr %6, %5, implicit-def dead $eflags
86 %6:gr32 = XOR32rr %6, %2, implicit-def dead $eflags
87 TEST8ri %1, 1, implicit-def $eflags
88 JCC_1 %bb.1, 5, implicit $eflags
92 successors: %bb.4(0x80000000)
94 MOV32mi $noreg, 1, $noreg, 4, $noreg, 0 :: (store (s32) into `ptr null` + 4)
95 MOV32mi $noreg, 1, $noreg, 0, $noreg, 0 :: (store (s32) into `ptr null`)