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