[Mlir-commits] [mlir] [mlir][UB] Add `ub.unreachable` operation (PR #169872)

Matthias Springer llvmlistbot at llvm.org
Mon Dec 1 00:08:06 PST 2025


================
@@ -19,3 +19,18 @@ func.func @check_poison() {
 }
 
 }
+
+// -----
+
+// No successful test because the dialect conversion framework does not convert
+// unreachable blocks.
+
+module attributes {
+  spirv.target_env = #spirv.target_env<
+    #spirv.vce<v1.0, [Int8, Int16, Int64, Float16, Float64, Shader], []>, #spirv.resource_limits<>>
+} {
+func.func @check_unrechable() {
+// expected-error at +1{{cannot be used in reachable block}}
+  spirv.Unreachable
----------------
matthias-springer wrote:

Improving test case here: https://github.com/llvm/llvm-project/pull/169872#discussion_r2573670611

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


More information about the Mlir-commits mailing list