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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Oct 20 13:53:46 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Walter Lee (googlewalt)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/164319.diff


2 Files Affected:

- (added) mlir/test/Target/SPIRV/function-decorations-asserts.mlir (+20) 
- (modified) mlir/test/Target/SPIRV/function-decorations.mlir (-1) 


``````````diff
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 {}  {

``````````

</details>


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


More information about the Mlir-commits mailing list