xref: /llvm-project/llvm/test/DebugInfo/assignment-tracking/X86/no-redundant-def-after-alloca.ll (revision 30845e8ab46c416a2e333eb84239e9ec71e92617)
1; RUN: llc %s -o - -stop-after=finalize-isel \
2; RUN: | FileCheck %s --implicit-check-not=DBG_
3
4
5; RUN: llc --try-experimental-debuginfo-iterators %s -o - -stop-after=finalize-isel \
6; RUN: | FileCheck %s --implicit-check-not=DBG_
7
8;; Hand written. Check that no unnecessary undef is inserted after an alloca
9;; that has a linked dbg.assign that doesn't immediately follow it.
10
11; CHECK: CALL64pcrel32 @a
12; CHECK-NEXT: ADJCALLSTACKUP64
13; CHECK-NEXT: DBG_VALUE %stack.0.c, $noreg, !{{.+}}, !DIExpression(DW_OP_deref), debug-location
14
15target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
16target triple = "x86_64-unknown-linux-gnu"
17
18define dso_local void @b() #0 !dbg !7 {
19entry:
20  %c = alloca i8, align 1, !DIAssignID !10
21  call void (...) @a(), !dbg !16
22  call void @llvm.dbg.assign(metadata i1 undef, metadata !11, metadata !DIExpression(), metadata !10, metadata ptr %c, metadata !DIExpression()), !dbg !13
23  ret void, !dbg !17
24}
25
26declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
27declare dso_local void @a(...)
28declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata, metadata)
29
30!llvm.dbg.cu = !{!0}
31!llvm.module.flags = !{!3, !4, !5, !1000}
32!llvm.ident = !{!6}
33
34!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 12.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
35!1 = !DIFile(filename: "test.c", directory: "/")
36!2 = !{}
37!3 = !{i32 7, !"Dwarf Version", i32 4}
38!4 = !{i32 2, !"Debug Info Version", i32 3}
39!5 = !{i32 1, !"wchar_size", i32 4}
40!6 = !{!"clang version 12.0.0)"}
41!7 = distinct !DISubprogram(name: "b", scope: !1, file: !1, line: 2, type: !8, scopeLine: 2, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
42!8 = !DISubroutineType(types: !9)
43!9 = !{null}
44!10 = distinct !DIAssignID()
45!11 = !DILocalVariable(name: "c", scope: !7, file: !1, line: 3, type: !12)
46!12 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
47!13 = !DILocation(line: 0, scope: !7)
48!14 = !DILocation(line: 3, column: 8, scope: !7)
49!15 = distinct !DIAssignID()
50!16 = !DILocation(line: 4, column: 3, scope: !7)
51!17 = !DILocation(line: 5, column: 1, scope: !7)
52!1000 = !{i32 7, !"debug-info-assignment-tracking", i1 true}
53