brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · a2df81a Raw
80 lines · plain
1; RUN: llc -start-after=codegenprepare -stop-before=finalize-isel < %s -o - | FileCheck %s2 3; Test that stack frame dbg.values are lowered to DBG_VALUEs, in blocks that4; are local to the alloca, and elsewhere. Differs from dbg-value-frame-index.ll5; because this test does not result in the frame-index being in a vreg,6; instead it's exclusively referred to by memory operands of instructions.7;8; Additionally test that we don't re-order with constant values -- both are9; independent of the order the instructions get lowered, but should not10; interleave.11 12target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"13target triple = "x86_64-unknown-unknown"14 15declare void @dud()16 17; CHECK: [[BARVAR:![0-9]+]] = !DILocalVariable(name: "bar",18 19define i32 @foo() !dbg !6 {20; CHECK-LABEL: body21 22; CHECK:      DBG_VALUE 0, $noreg, [[BARVAR]]23; CHECK-NEXT: MOV32mi %[[STACKLOC:[a-zA-Z0-9\.]+]], 1, $noreg24; CHECK-NEXT: DBG_VALUE %[[STACKLOC]], $noreg, [[BARVAR]]25 26  %p1 = alloca i3227  call void @llvm.dbg.value(metadata ptr null, metadata !17, metadata !DIExpression()), !dbg !1828  store i32 0, ptr %p129  call void @llvm.dbg.value(metadata ptr %p1, metadata !17, metadata !DIExpression()), !dbg !1830  br label %foo31 32foo:33 34; CHECK-LABEL: bb.1.foo35; CHECK:      DBG_VALUE %[[STACKLOC]], $noreg, [[BARVAR]]36 37  call void @dud()38  call void @llvm.dbg.value(metadata ptr %p1, metadata !17, metadata !DIExpression()), !dbg !1839  br label %bar40 41bar:42 43; CHECK-LABEL: bb.2.bar44; CHECK:      DBG_VALUE %[[STACKLOC]], $noreg, [[BARVAR]]45; CHECK-NEXT: ADJCALLSTACKDOWN46; CHECK-NEXT: CALL47; CHECK-NEXT: ADJCALLSTACKUP48; CHECK-NEXT: DBG_VALUE 0, $noreg, [[BARVAR]]49  call void @llvm.dbg.value(metadata ptr %p1, metadata !17, metadata !DIExpression()), !dbg !1850  call void @dud()51  call void @llvm.dbg.value(metadata ptr null, metadata !17, metadata !DIExpression()), !dbg !1852  %loaded = load i32, ptr %p153  ret i32 %loaded, !dbg !1954}55 56; Function Attrs: nounwind readnone speculatable57declare void @llvm.dbg.value(metadata, metadata, metadata) #658 59!llvm.dbg.cu = !{!0}60!llvm.module.flags = !{!3, !4}61!llvm.ident = !{!5}62 63!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2)64!1 = !DIFile(filename: "a.c", directory: "b")65!2 = !{}66!3 = !{i32 2, !"Dwarf Version", i32 4}67!4 = !{i32 2, !"Debug Info Version", i32 3}68!5 = !{!""}69!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 13, type: !7, isLocal: false, isDefinition: true, scopeLine: 14, isOptimized: false, unit: !0, retainedNodes: !2)70!7 = !DISubroutineType(types: !8)71!8 = !{!140}72!140 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)73!15 = !{!16}74!16 = !DISubrange(count: 5)75!17 = !DILocalVariable(name: "bar", scope: !6, line: 13, type: !140)76!18 = !DILocation(line: 13, column: 23, scope: !6)77!19 = !DILocation(line: 15, column: 5, scope: !6)78!20 = !DILocation(line: 16, column: 1, scope: !6)79!21 = !DILocalVariable(name: "baz", scope: !6, line: 13, type: !140)80