[Mlir-commits] [mlir] Fork test to allow testing with assertions enabled (PR #164319)

Walter Lee llvmlistbot at llvm.org
Mon Oct 20 13:53:12 PDT 2025


https://github.com/googlewalt created https://github.com/llvm/llvm-project/pull/164319

This way, testing with --debug flag can correctly specify that it requires assertions.

>From d9dc8c73f7ae8cd00fa884282316a626fcd4be10 Mon Sep 17 00:00:00 2001
From: Walter Lee <waltl at google.com>
Date: Mon, 20 Oct 2025 16:37:39 -0400
Subject: [PATCH] Fork test so that testing with --debug flag can correctly
 specify that it requires assertions

---
 .../SPIRV/function-decorations-asserts.mlir   | 20 +++++++++++++++++++
 .../Target/SPIRV/function-decorations.mlir    |  1 -
 2 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 mlir/test/Target/SPIRV/function-decorations-asserts.mlir

diff --git a/mlir/test/Target/SPIRV/function-decorations-asserts.mlir b/mlir/test/Target/SPIRV/function-decorations-asserts.mlir
new file mode 100644
index 0000000000000..ebdb9fb1e75e3
--- /dev/null
+++ b/mlir/test/Target/SPIRV/function-decorations-asserts.mlir
@@ -0,0 +1,20 @@
+// REQUIRES: asserts
+// RUN: mlir-translate --no-implicit-module --test-spirv-roundtrip --split-input-file --debug %s | FileCheck %s
+
+spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [Shader, Linkage], []> {
+    spirv.func @linkage_attr_test_kernel()  "DontInline"  attributes {}  {
+        %uchar_0 = spirv.Constant 0 : i8
+        %ushort_1 = spirv.Constant 1 : i16
+        %uint_0 = spirv.Constant 0 : i32
+        spirv.FunctionCall @outside.func.with.linkage(%uchar_0):(i8) -> ()
+        spirv.Return
+    }
+    // CHECK: linkage_attributes = #spirv.linkage_attributes<linkage_name = "outside.func", linkage_type = <Import>>
+    spirv.func @outside.func.with.linkage(%arg0 : i8) -> () "Pure" attributes {
+      linkage_attributes=#spirv.linkage_attributes<
+        linkage_name="outside.func",
+        linkage_type=<Import>
+      >
+    }
+    spirv.func @inside.func() -> () "Pure" attributes {} {spirv.Return}
+}
diff --git a/mlir/test/Target/SPIRV/function-decorations.mlir b/mlir/test/Target/SPIRV/function-decorations.mlir
index 6098e42f063a2..cf6edaa0a3d5b 100644
--- a/mlir/test/Target/SPIRV/function-decorations.mlir
+++ b/mlir/test/Target/SPIRV/function-decorations.mlir
@@ -1,5 +1,4 @@
 // RUN: mlir-translate --no-implicit-module --test-spirv-roundtrip --split-input-file %s | FileCheck %s
-// RUN: mlir-translate --no-implicit-module --test-spirv-roundtrip --split-input-file --debug %s | FileCheck %s
 
 spirv.module Logical GLSL450 requires #spirv.vce<v1.0, [Shader, Linkage], []> {
     spirv.func @linkage_attr_test_kernel()  "DontInline"  attributes {}  {



More information about the Mlir-commits mailing list