brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 5363957 Raw
29 lines · cpp
1//===------- Offload API tests - olCreateProgram --------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "../common/Fixtures.hpp"10#include <OffloadAPI.h>11#include <gtest/gtest.h>12 13using olCreateProgramTest = OffloadDeviceTest;14OFFLOAD_TESTS_INSTANTIATE_DEVICE_FIXTURE(olCreateProgramTest);15 16TEST_P(olCreateProgramTest, Success) {17 18  std::unique_ptr<llvm::MemoryBuffer> DeviceBin;19  ASSERT_TRUE(TestEnvironment::loadDeviceBinary("foo", Device, DeviceBin));20  ASSERT_GE(DeviceBin->getBufferSize(), 0lu);21 22  ol_program_handle_t Program;23  ASSERT_SUCCESS(olCreateProgram(Device, DeviceBin->getBufferStart(),24                                 DeviceBin->getBufferSize(), &Program));25  ASSERT_NE(Program, nullptr);26 27  ASSERT_SUCCESS(olDestroyProgram(Program));28}29