1; RUN: llc --filetype=obj %s -o - | dxil-dis -o - | FileCheck %s 2target triple = "dxil-unknown-unknown" 3target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" 4 5; CHECK: define float @fma(float, float, float) unnamed_addr #0 !dbg !7 6; Function Attrs: norecurse nounwind readnone willreturn 7define dso_local float @fma(float %0, float %1, float %2) local_unnamed_addr #0 !dbg !6 { 8; CHECK-NEXT: call void @llvm.dbg.value(metadata float %0, metadata !12, metadata !15), !dbg !16 9; CHECK-NEXT: call void @llvm.dbg.value(metadata float %1, metadata !13, metadata !15), !dbg !16 10; CHECK-NEXT: call void @llvm.dbg.value(metadata float %2, metadata !14, metadata !15), !dbg !16 11 call void @llvm.dbg.value(metadata float %0, metadata !11, metadata !DIExpression()), !dbg !14 12 call void @llvm.dbg.value(metadata float %1, metadata !12, metadata !DIExpression()), !dbg !14 13 call void @llvm.dbg.value(metadata float %2, metadata !13, metadata !DIExpression()), !dbg !14 14; CHECK-NEXT: %4 = fmul float %0, %1, !dbg !17 15; CHECK-NEXT: %5 = fadd float %4, %2, !dbg !18 16 %4 = fmul float %0, %1, !dbg !15 17 %5 = fadd float %4, %2, !dbg !16 18 ret float %5, !dbg !17 19} 20 21; Function Attrs: nofree nosync nounwind readnone speculatable willreturn 22declare void @llvm.dbg.value(metadata, metadata, metadata) #1 23 24attributes #0 = { norecurse nounwind readnone willreturn } 25attributes #1 = { nofree nosync nounwind readnone speculatable willreturn } 26 27!llvm.dbg.cu = !{!0} 28!llvm.module.flags = !{!3, !4} 29!llvm.ident = !{!5} 30 31; Other tests verify that we come back with reasonable structure for the debug 32; info types, this test just needs to ensure they are there. 33; The patch this is paired with fixes a bug where function debug info wasn't 34; being emitted correctly even though other tests verified the MD would be 35; emitted if it was referenced as module metadata. 36 37; CHECK: !0 = distinct !DICompileUnit 38; CHECK-NEXT: !1 = !DIFile(filename: 39; CHECK: !7 = distinct !DISubprogram(name: "fma", 40; CHECK: !12 = !DILocalVariable(tag: 41; CHECK-NEXT: !13 = !DILocalVariable(tag: 42; CHECK-NEXT: !14 = !DILocalVariable(tag: 43; CHECK-NEXT: !15 = !DIExpression() 44; CHECK-NEXT: !16 = !DILocation(line: 45; CHECK-NEXT: !17 = !DILocation(line: 46; CHECK-NEXT: !18 = !DILocation(line: 47; CHECK-NEXT: !19 = !DILocation(line: 48 49!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) 50!1 = !DIFile(filename: "in.c", directory: "dir") 51!2 = !{} 52!3 = !{i32 7, !"Dwarf Version", i32 2} 53!4 = !{i32 2, !"Debug Info Version", i32 3} 54!5 = !{!"Some Compiler"} 55!6 = distinct !DISubprogram(name: "fma", scope: !1, file: !1, line: 1, type: !7, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !10) 56!7 = !DISubroutineType(types: !8) 57!8 = !{!9, !9, !9, !9} 58!9 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float) 59!10 = !{!11, !12, !13} 60!11 = !DILocalVariable(name: "x", arg: 1, scope: !6, file: !1, line: 1, type: !9) 61!12 = !DILocalVariable(name: "y", arg: 2, scope: !6, file: !1, line: 1, type: !9) 62!13 = !DILocalVariable(name: "z", arg: 3, scope: !6, file: !1, line: 1, type: !9) 63!14 = !DILocation(line: 0, scope: !6) 64!15 = !DILocation(line: 2, column: 12, scope: !6) 65!16 = !DILocation(line: 2, column: 16, scope: !6) 66!17 = !DILocation(line: 2, column: 3, scope: !6) 67