[llvm] [offload] add KNOWN_FAILURE_ON unittest macro (PR #196275)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 04:31:57 PDT 2026


================
@@ -61,6 +61,23 @@
   } while (0)
 #endif
 
+inline bool
+isKnownFailureOnBackend(ol_platform_backend_t CurBackend,
+                        std::initializer_list<ol_platform_backend_t> Backends) {
+  for (ol_platform_backend_t B : Backends) {
+    if (CurBackend == B)
+      return true;
+  }
+  return false;
+}
+
+#define KNOWN_FAILURE_ON(...)                                                  \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_                                                \
+  if (!isKnownFailureOnBackend(this->getPlatformBackend(), {__VA_ARGS__}))     \
+    ;                                                                          \
+  else                                                                         \
+    GTEST_SKIP() << "Skipping known failure. "
----------------
EuphoricThinking wrote:

You could add a more detailed error message, similarly to [UR tests](https://github.com/intel/llvm/blob/c4ab100aab35d97703652081052a23bcc8c6f430/unified-runtime/test/conformance/testing/include/uur/known_failure.h#L235-L247)

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


More information about the llvm-commits mailing list