[llvm] [libsycl] Add UT build and min test set (PR #199915)

Kseniya Tikhomirova via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 05:04:42 PDT 2026


================
@@ -0,0 +1,150 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file contains declarations and utilities for liboffload mocking in
+/// libsycl unit tests.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBSYCL_UNITTESTS_MOCK_HELPERS_HPP
+#define _LIBSYCL_UNITTESTS_MOCK_HELPERS_HPP
+
+#include <OffloadAPI.h>
+
+#include <gmock/gmock.h>
+
+#include <atomic>
+#include <cassert>
+#include <cstddef>
+#include <cstring>
+#include <unordered_map>
+#include <vector>
+
+namespace mock {
+
+struct ol_dummy_handle_t {
+  ol_dummy_handle_t(size_t DataSize = 0)
+      : MStorage(DataSize), MSize(DataSize) {}
+  ol_dummy_handle_t(unsigned char *Data, size_t Size)
+      : MStorage(Size), MSize(Size) {
+    std::memcpy(MStorage.data(), Data, Size);
+  }
+  std::atomic<size_t> MRefCounter = 1;
+  std::vector<unsigned char> MStorage;
+  size_t MSize;
----------------
KseniyaTikhomirova wrote:

yes, removed

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


More information about the llvm-commits mailing list