58 lines · plain
1; RUN: llc -mtriple=i386-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL2 3; This file is the output of clang -g -O24; int test_dbg_trunc(unsigned long long a) { return a; }5;6; The intent of this check is to ensure the DBG_VALUE use of G_MERGE_VALUES is undef'd when the legalizer erases it.7 8; ModuleID = 'x86-calllowering-dbg-trunc.c'9source_filename = "x86-calllowering-dbg-trunc.c"10target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128"11target triple = "i386"12 13; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone uwtable willreturn14define dso_local i32 @test_dbg_trunc(i64 %a) local_unnamed_addr #0 !dbg !9 {15; ALL-LABEL: test_dbg_trunc:16; ALL: # %bb.0: # %entry17; ALL: pushl %ebp18; ALL: movl %esp, %ebp19; ALL: movl 8(%ebp), %eax20; ALL: #DEBUG_VALUE: test_dbg_trunc:a <- undef21; ALL: popl %ebp22; ALL: retl23entry:24 call void @llvm.dbg.value(metadata i64 %a, metadata !15, metadata !DIExpression()), !dbg !1625 %conv = trunc i64 %a to i32, !dbg !1726 ret i32 %conv, !dbg !1827}28 29; Function Attrs: nofree nosync nounwind readnone speculatable willreturn30declare void @llvm.dbg.value(metadata, metadata, metadata) #131 32attributes #0 = { mustprogress nofree norecurse nosync nounwind readnone uwtable willreturn "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }33attributes #1 = { nofree nosync nounwind readnone speculatable willreturn }34 35!llvm.dbg.cu = !{!0}36!llvm.module.flags = !{!2, !3, !4, !5, !6, !7}37!llvm.ident = !{!8}38 39!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 14.0.0 (https://github.com/llvm/llvm-project ...)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)40!1 = !DIFile(filename: "x86-calllowering-dbg-trunc.c", directory: "/tmp")41!2 = !{i32 1, !"NumRegisterParameters", i32 0}42!3 = !{i32 7, !"Dwarf Version", i32 4}43!4 = !{i32 2, !"Debug Info Version", i32 3}44!5 = !{i32 1, !"wchar_size", i32 4}45!6 = !{i32 7, !"uwtable", i32 1}46!7 = !{i32 7, !"frame-pointer", i32 2}47!8 = !{!"clang version 14.0.0 (https://github.com/llvm/llvm-project ...)"}48!9 = distinct !DISubprogram(name: "test_dbg_trunc", scope: !1, file: !1, line: 1, type: !10, scopeLine: 1, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !14)49!10 = !DISubroutineType(types: !11)50!11 = !{!12, !13}51!12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)52!13 = !DIBasicType(name: "unsigned long long", size: 64, encoding: DW_ATE_unsigned)53!14 = !{!15}54!15 = !DILocalVariable(name: "a", arg: 1, scope: !9, file: !1, line: 1, type: !13)55!16 = !DILocation(line: 0, scope: !9)56!17 = !DILocation(line: 1, column: 51, scope: !9)57!18 = !DILocation(line: 1, column: 44, scope: !9)58