1e101b07aSJonas Devlieghere; RUN: llc %s -stop-after=livedebugvars -o %t 2e101b07aSJonas Devlieghere; RUN: cat %t | FileCheck %s 3e101b07aSJonas Devlieghere; 4e101b07aSJonas Devlieghere; Test that we can emit debug info for large values that are split 5e101b07aSJonas Devlieghere; up across multiple registers by the SelectionDAG type legalizer. 6e101b07aSJonas Devlieghere; 7e101b07aSJonas Devlieghere; // Compile with -O1 -m32. 8e101b07aSJonas Devlieghere; long long foo (long long a, long long b) 9e101b07aSJonas Devlieghere; { 10e101b07aSJonas Devlieghere; long long res = b+1; 11e101b07aSJonas Devlieghere; if ( a == b ) 12e101b07aSJonas Devlieghere; return res; 13e101b07aSJonas Devlieghere; return 0; 14e101b07aSJonas Devlieghere; } 15e101b07aSJonas Devlieghere; 16*a8340389SMatthias Braun; CHECK-DAG: DBG_VALUE $r{{[0-9]+}}, $noreg, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 32, 16), debug-location !{{[0-9]+}} 17*a8340389SMatthias Braun; CHECK-DAG: DBG_VALUE $r{{[0-9]+}}, $noreg, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 48, 16), debug-location !{{[0-9]+}} 18*a8340389SMatthias Braun; CHECK-DAG: DBG_VALUE $r{{[0-9]+}}, $noreg, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 0, 16), debug-location !{{[0-9]+}} 19*a8340389SMatthias Braun; CHECK-DAG: DBG_VALUE $r{{[0-9]+}}, $noreg, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 16, 16), debug-location !{{[0-9]+}} 20e101b07aSJonas Devlieghere 21e101b07aSJonas Devlieghere; ModuleID = 'sdagsplit-1.c' 22e101b07aSJonas Devliegheretarget datalayout = "e-m:e-p:16:16-i32:16-i64:16-f32:16-f64:16-a:8-n8:16-S16" 23e101b07aSJonas Devliegheretarget triple = "msp430" 24e101b07aSJonas Devlieghere 25e101b07aSJonas Devlieghere; Function Attrs: nounwind readnone 26e101b07aSJonas Devliegheredefine i64 @foo(i64 %a, i64 %b) local_unnamed_addr #0 !dbg !7 { 27e101b07aSJonas Devlieghereentry: 28a459b9f7SVedant Kumar call void @llvm.dbg.value(metadata i64 %a, metadata !12, metadata !15), !dbg !16 29a459b9f7SVedant Kumar call void @llvm.dbg.value(metadata i64 %b, metadata !13, metadata !15), !dbg !17 30e101b07aSJonas Devlieghere %cmp = icmp eq i64 %a, %b, !dbg !19 31e101b07aSJonas Devlieghere %add = add nsw i64 %b, 1, !dbg !21 32a459b9f7SVedant Kumar call void @llvm.dbg.value(metadata i64 %add, metadata !14, metadata !15), !dbg !18 33e101b07aSJonas Devlieghere %retval.0 = select i1 %cmp, i64 %add, i64 0, !dbg !22 34e101b07aSJonas Devlieghere ret i64 %retval.0, !dbg !23 35e101b07aSJonas Devlieghere} 36e101b07aSJonas Devlieghere 37e101b07aSJonas Devlieghere; Function Attrs: nounwind readnone speculatable 38e101b07aSJonas Devliegheredeclare void @llvm.dbg.value(metadata, metadata, metadata) #1 39e101b07aSJonas Devlieghere 40e101b07aSJonas Devlieghereattributes #0 = { nounwind readnone } 41e101b07aSJonas Devlieghereattributes #1 = { nounwind readnone speculatable } 42e101b07aSJonas Devlieghere 43e101b07aSJonas Devlieghere!llvm.dbg.cu = !{!0} 44e101b07aSJonas Devlieghere!llvm.module.flags = !{!3, !4, !5} 45e101b07aSJonas Devlieghere!llvm.ident = !{!6} 46e101b07aSJonas Devlieghere 47e101b07aSJonas Devlieghere!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) 48e101b07aSJonas Devlieghere!1 = !DIFile(filename: "sdagsplit-1.c", directory: "/MSP430") 49e101b07aSJonas Devlieghere!2 = !{} 50e101b07aSJonas Devlieghere!3 = !{i32 2, !"Dwarf Version", i32 2} 51e101b07aSJonas Devlieghere!4 = !{i32 2, !"Debug Info Version", i32 3} 52e101b07aSJonas Devlieghere!5 = !{i32 1, !"wchar_size", i32 2} 53e101b07aSJonas Devlieghere!6 = !{!"clang version 6.0.0 "} 542c864551SShiva Chen!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !11) 55e101b07aSJonas Devlieghere!8 = !DISubroutineType(types: !9) 56e101b07aSJonas Devlieghere!9 = !{!10, !10, !10} 57e101b07aSJonas Devlieghere!10 = !DIBasicType(name: "long long int", size: 64, encoding: DW_ATE_signed) 58e101b07aSJonas Devlieghere!11 = !{!12, !13, !14} 59e101b07aSJonas Devlieghere!12 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 2, type: !10) 60e101b07aSJonas Devlieghere!13 = !DILocalVariable(name: "b", arg: 2, scope: !7, file: !1, line: 2, type: !10) 61e101b07aSJonas Devlieghere!14 = !DILocalVariable(name: "res", scope: !7, file: !1, line: 4, type: !10) 62e101b07aSJonas Devlieghere!15 = !DIExpression() 63e101b07aSJonas Devlieghere!16 = !DILocation(line: 2, column: 26, scope: !7) 64e101b07aSJonas Devlieghere!17 = !DILocation(line: 2, column: 39, scope: !7) 65e101b07aSJonas Devlieghere!18 = !DILocation(line: 4, column: 12, scope: !7) 66e101b07aSJonas Devlieghere!19 = !DILocation(line: 5, column: 9, scope: !20) 67e101b07aSJonas Devlieghere!20 = distinct !DILexicalBlock(scope: !7, file: !1, line: 5, column: 7) 68e101b07aSJonas Devlieghere!21 = !DILocation(line: 4, column: 19, scope: !7) 69e101b07aSJonas Devlieghere!22 = !DILocation(line: 5, column: 7, scope: !7) 70e101b07aSJonas Devlieghere!23 = !DILocation(line: 8, column: 1, scope: !7) 71