[llvm] 6d48e26 - [NFC] Update test case to be flexible
Chris Bieneman via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 22 12:56:37 PDT 2022
Author: Chris Bieneman
Date: 2022-09-22T14:56:23-05:00
New Revision: 6d48e2612608b83903b753029b503406683d7f14
URL: https://github.com/llvm/llvm-project/commit/6d48e2612608b83903b753029b503406683d7f14
DIFF: https://github.com/llvm/llvm-project/commit/6d48e2612608b83903b753029b503406683d7f14.diff
LOG: [NFC] Update test case to be flexible
As we add more DXIL metadata, these numbers will shift. Using regex
matches and variables will ensure the code still works as expected while
making the test less fragile.
Added:
Modified:
llvm/test/tools/dxil-dis/debug-info.ll
Removed:
################################################################################
diff --git a/llvm/test/tools/dxil-dis/debug-info.ll b/llvm/test/tools/dxil-dis/debug-info.ll
index 067279a006efa..d700537ccf10e 100644
--- a/llvm/test/tools/dxil-dis/debug-info.ll
+++ b/llvm/test/tools/dxil-dis/debug-info.ll
@@ -2,17 +2,17 @@
target triple = "dxil-unknown-unknown"
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
-; CHECK: define float @fma(float, float, float) unnamed_addr #0 !dbg !7
+; CHECK: define float @fma(float, float, float) unnamed_addr #0 !dbg [[Fn:[!][0-9]+]]
; Function Attrs: norecurse nounwind readnone willreturn
define dso_local float @fma(float %0, float %1, float %2) local_unnamed_addr #0 !dbg !6 {
-; CHECK-NEXT: call void @llvm.dbg.value(metadata float %0, metadata !12, metadata !15), !dbg !16
-; CHECK-NEXT: call void @llvm.dbg.value(metadata float %1, metadata !13, metadata !15), !dbg !16
-; CHECK-NEXT: call void @llvm.dbg.value(metadata float %2, metadata !14, metadata !15), !dbg !16
+; CHECK-NEXT: call void @llvm.dbg.value(metadata float %0, metadata [[VarX:[!][0-9]+]], metadata [[Expr:[!][0-9]+]]), !dbg [[Line1:[!][0-9]+]]
+; CHECK-NEXT: call void @llvm.dbg.value(metadata float %1, metadata [[VarY:[!][0-9]+]], metadata [[Expr]]), !dbg [[Line1]]
+; CHECK-NEXT: call void @llvm.dbg.value(metadata float %2, metadata [[VarZ:[!][0-9]+]], metadata [[Expr]]), !dbg [[Line1]]
call void @llvm.dbg.value(metadata float %0, metadata !11, metadata !DIExpression()), !dbg !14
call void @llvm.dbg.value(metadata float %1, metadata !12, metadata !DIExpression()), !dbg !14
call void @llvm.dbg.value(metadata float %2, metadata !13, metadata !DIExpression()), !dbg !14
-; CHECK-NEXT: %4 = fmul float %0, %1, !dbg !17
-; CHECK-NEXT: %5 = fadd float %4, %2, !dbg !18
+; CHECK-NEXT: %4 = fmul float %0, %1, !dbg [[Line2:[!][0-9]+]]
+; CHECK-NEXT: %5 = fadd float %4, %2, !dbg [[Line3:[!][0-9]+]]
%4 = fmul float %0, %1, !dbg !15
%5 = fadd float %4, %2, !dbg !16
ret float %5, !dbg !17
@@ -36,15 +36,15 @@ attributes #1 = { nofree nosync nounwind readnone speculatable willreturn }
; CHECK: !0 = distinct !DICompileUnit
; CHECK-NEXT: !1 = !DIFile(filename:
-; CHECK: !7 = distinct !DISubprogram(name: "fma",
-; CHECK: !12 = !DILocalVariable(tag:
-; CHECK-NEXT: !13 = !DILocalVariable(tag:
-; CHECK-NEXT: !14 = !DILocalVariable(tag:
-; CHECK-NEXT: !15 = !DIExpression()
-; CHECK-NEXT: !16 = !DILocation(line:
-; CHECK-NEXT: !17 = !DILocation(line:
-; CHECK-NEXT: !18 = !DILocation(line:
-; CHECK-NEXT: !19 = !DILocation(line:
+; CHECK: [[Fn]] = distinct !DISubprogram(name: "fma",
+; CHECK: [[VarX]] = !DILocalVariable(tag:
+; CHECK: [[VarY]] = !DILocalVariable(tag:
+; CHECK: [[VarZ]] = !DILocalVariable(tag:
+; CHECK-NEXT: [[Expr]] = !DIExpression()
+; CHECK-NEXT: [[Line1]] = !DILocation(line:
+; CHECK-NEXT: [[Line2]] = !DILocation(line:
+; CHECK-NEXT: [[Line3]] = !DILocation(line:
+; CHECK-NEXT: {{[!][0-9]+}} = !DILocation(line:
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
!1 = !DIFile(filename: "in.c", directory: "dir")
More information about the llvm-commits
mailing list