Skip to content

Commit 9812333

Browse files
committed
Fix missing tablegen, tidy Offload tests
1 parent 770f56e commit 9812333

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

offload/liboffload/API/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ if (CLANG_FORMAT)
77
set(LLVM_TARGET_DEFINITIONS ${CMAKE_CURRENT_SOURCE_DIR}/OffloadAPI.td)
88

99
tablegen(OFFLOAD OffloadAPI.h -gen-api)
10+
tablegen(OFFLOAD OffloadEntryPoints.inc -gen-entry-points)
1011
tablegen(OFFLOAD OffloadFuncs.inc -gen-func-names)
1112
tablegen(OFFLOAD OffloadImplFuncDecls.inc -gen-impl-func-decls)
1213
tablegen(OFFLOAD OffloadPrint.hpp -gen-print-header)
13-
tablegen(OFFLOAD OffloadExports -gen-exports)
1414

1515
set(OFFLOAD_GENERATED_FILES ${TABLEGEN_OUTPUT})
1616
add_public_tablegen_target(OffloadGenerate)

offload/unittests/OffloadAPI/common/Fixtures.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ struct offloadDeviceTest : offloadPlatformTest {
5555

5656
uint32_t NumDevices;
5757
ASSERT_SUCCESS(olGetDeviceCount(Platform, &NumDevices));
58-
if (NumDevices == 0) {
58+
if (NumDevices == 0)
5959
GTEST_SKIP() << "No available devices on this platform.";
60-
}
6160
ASSERT_SUCCESS(olGetDevice(Platform, 1, &Device));
6261
}
6362

offload/unittests/OffloadAPI/device/olGetDevice.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ using olGetDeviceTest = offloadPlatformTest;
1515
TEST_F(olGetDeviceTest, Success) {
1616
uint32_t Count = 0;
1717
ASSERT_SUCCESS(olGetDeviceCount(Platform, &Count));
18-
ASSERT_NE(Count, 0lu);
18+
if (Count == 0)
19+
GTEST_SKIP() << "No available devices on this platform.";
20+
1921
std::vector<ol_device_handle_t> Devices(Count);
2022
ASSERT_SUCCESS(olGetDevice(Platform, Count, Devices.data()));
2123
for (auto Device : Devices) {
@@ -26,9 +28,9 @@ TEST_F(olGetDeviceTest, Success) {
2628
TEST_F(olGetDeviceTest, SuccessSubsetOfDevices) {
2729
uint32_t Count;
2830
ASSERT_SUCCESS(olGetDeviceCount(Platform, &Count));
29-
if (Count < 2) {
31+
if (Count < 2)
3032
GTEST_SKIP() << "Only one device is available on this platform.";
31-
}
33+
3234
std::vector<ol_device_handle_t> Devices(Count - 1);
3335
ASSERT_SUCCESS(olGetDevice(Platform, Count - 1, Devices.data()));
3436
for (auto Device : Devices) {

offload/unittests/OffloadAPI/device/olGetDeviceCount.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ using olGetDeviceCountTest = offloadPlatformTest;
1515
TEST_F(olGetDeviceCountTest, Success) {
1616
uint32_t Count = 0;
1717
ASSERT_SUCCESS(olGetDeviceCount(Platform, &Count));
18-
ASSERT_NE(Count, 0lu);
1918
}
2019

2120
TEST_F(olGetDeviceCountTest, InvalidNullPlatform) {

0 commit comments

Comments
 (0)