xref: /llvm-project/llvm/test/DebugInfo/assignment-tracking/X86/hotcoldsplit.ll (revision 094572701dce4aaf36f4521d6cf750420d39f206)
1; RUN: opt %s -passes=hotcoldsplit -S | FileCheck %s
2
3;; Check the extracted DIAssignID gets remapped.
4
5; CHECK-LABEL: define void @_foo()
6; CHECK: common.ret:
7; CHECK-NEXT: #dbg_assign(i64 0, ![[#]], !DIExpression(DW_OP_LLVM_fragment, 0, 64), ![[ID1:[0-9]+]], {{.*}}, !DIExpression(),
8
9; CHECK-LABEL: define internal void @_foo.cold.1()
10; CHECK: store i64 0, ptr null, align 8, !DIAssignID ![[ID2:[0-9]+]]
11
12; CHECK-DAG: ![[ID1]] = distinct !DIAssignID()
13; CHECK-DAG: ![[ID2]] = distinct !DIAssignID()
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 void @_foo() !dbg !4 {
19entry:
20  br i1 false, label %if.then7, label %common.ret
21
22common.ret:                                       ; preds = %entry
23  call void @llvm.dbg.assign(metadata i64 0, metadata !7, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 64), metadata !12, metadata ptr null, metadata !DIExpression()), !dbg !13
24  ret void
25
26if.then7:                                         ; preds = %entry
27  %call21 = load i1, ptr null, align 4294967296
28  store i64 0, ptr null, align 8, !DIAssignID !12
29  unreachable
30}
31
32declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata, metadata)
33
34!llvm.dbg.cu = !{!0}
35!llvm.module.flags = !{!3}
36
37!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
38!1 = !DIFile(filename: "file.cpp", directory: "foo")
39!2 = !{}
40!3 = !{i32 2, !"Debug Info Version", i32 3}
41!4 = distinct !DISubprogram(name: "foo", linkageName: "_foo", scope: !5, file: !1, line: 425, type: !6, scopeLine: 425, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
42!5 = !DINamespace(name: "llvm", scope: null)
43!6 = distinct !DISubroutineType(types: !2)
44!7 = !DILocalVariable(name: "Path", scope: !4, file: !1, line: 436, type: !8)
45!8 = !DIDerivedType(tag: DW_TAG_typedef, name: "string", scope: !9, file: !1, line: 79, baseType: !10)
46!9 = !DINamespace(name: "std", scope: null)
47!10 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "basic_string<char, std::char_traits<char>, std::allocator<char> >", scope: !11, file: !1, line: 85, size: 256, flags: DIFlagTypePassByReference | DIFlagNonTrivial, elements: !2, templateParams: !2, identifier: "_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE")
48!11 = !DINamespace(name: "__cxx11", scope: !9, exportSymbols: true)
49!12 = distinct !DIAssignID()
50!13 = !DILocation(line: 0, scope: !4)
51