[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / test / DebugInfo / MIR / X86 / dbginfo-entryvals.mir
blob57cb19734e5ef7c1b0100c21941443fc1434ce26
1 # RUN: llc -run-pass=livedebugvalues -verify-machineinstrs -march=x86-64 -o - %s | FileCheck %s
2 # RUN: llc -force-instr-ref-livedebugvalues=1 -run-pass=livedebugvalues -verify-machineinstrs -march=x86-64 -o - %s | FileCheck %s
4 #extern void fn2(int);
6 #__attribute__((noinline))
7 #void
8 #fn1 (int x, int y) {
9 #  int u = x + y;
10 #  if (x > 1)
11 #    u += 1;
12 #  else
13 #    u += 2;
14 #  int a = 7;
15 #  fn2 (a);
16 #  u --;
18 # CHECK: DBG_VALUE $edi, $noreg, !14, !DIExpression(DW_OP_LLVM_entry_value, 1), debug-location {{.*}}
19 # CHECK-NOT: DBG_VALUE $esi, $noreg, !15, !DIExpression(DW_OP_LLVM_entry_value, 1)
21 --- |
22   ; ModuleID = 'test.c'
23   source_filename = "test.c"
24   target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
25   
26   ; Function Attrs: noinline nounwind uwtable
27   define dso_local void @fn1(i32 %x, i32 %y) local_unnamed_addr !dbg !9 {
28   entry:
29     call void @llvm.dbg.value(metadata i32 %x, metadata !14, metadata !DIExpression()), !dbg !18
30     call void @llvm.dbg.value(metadata i32 %y, metadata !15, metadata !DIExpression()), !dbg !18
31     call void @llvm.dbg.value(metadata i32 7, metadata !17, metadata !DIExpression()), !dbg !18
32     tail call void @fn2(i32 7), !dbg !18
33     ret void, !dbg !18
34   }
35   
36   declare !dbg !4 dso_local void @fn2(i32) local_unnamed_addr
37   
38   ; Function Attrs: nounwind readnone speculatable
39   declare void @llvm.dbg.value(metadata, metadata, metadata)
40   
41   
42   !llvm.dbg.cu = !{!0}
43   !llvm.module.flags = !{!5, !6, !7}
44   !llvm.ident = !{!8}
45   
46   !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 9.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, nameTableKind: None)
47   !1 = !DIFile(filename: "test.c", directory: "/dir")
48   !2 = !{}
49   !3 = !{!4}
50   !4 = !DISubprogram(name: "fn2", scope: !1, file: !1, line: 11, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
51   !5 = !{i32 2, !"Dwarf Version", i32 4}
52   !6 = !{i32 2, !"Debug Info Version", i32 3}
53   !7 = !{i32 1, !"wchar_size", i32 4}
54   !8 = !{!"clang version 9.0.0"}
55   !9 = distinct !DISubprogram(name: "fn1", scope: !1, file: !1, line: 15, type: !10, scopeLine: 15, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !13)
56   !10 = !DISubroutineType(types: !11)
57   !11 = !{null, !12, !12}
58   !12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
59   !13 = !{!14, !15, !16, !17}
60   !14 = !DILocalVariable(name: "x", arg: 1, scope: !9, file: !1, line: 15, type: !12)
61   !15 = !DILocalVariable(name: "y", arg: 2, scope: !9, file: !1, line: 15, type: !12)
62   !16 = !DILocalVariable(name: "u", scope: !9, file: !1, line: 16, type: !12)
63   !17 = !DILocalVariable(name: "a", scope: !9, file: !1, line: 21, type: !12)
64   !18 = !DILocation(line: 15, column: 10, scope: !9)
66 ...
67 ---
68 name:            fn1
69 alignment:       16
70 tracksRegLiveness: true
71 liveins:         []
72 body:             |
73   bb.0.entry:
74     DBG_VALUE $edi, $noreg, !14, !DIExpression(), debug-location !18
75     DBG_VALUE $esi, $noreg, !15, !DIExpression(), debug-location !18
76     DBG_VALUE 7, $noreg, !17, !DIExpression(), debug-location !18
77     $edi = MOV32ri 7, debug-location !18
78     TAILJMPd64 @fn2, csr_64, implicit $rsp, implicit $ssp, implicit $rsp, implicit $ssp, implicit killed $edi, debug-location !18
80 ...