diff --git a/projects/hip-tests/catch/unit/memory/hipHostMalloc.cc b/projects/hip-tests/catch/unit/memory/hipHostMalloc.cc index 94f943c6bf..39a2bb6719 100644 --- a/projects/hip-tests/catch/unit/memory/hipHostMalloc.cc +++ b/projects/hip-tests/catch/unit/memory/hipHostMalloc.cc @@ -231,4 +231,16 @@ TEST_CASE("Unit_hipHostMalloc_Default") { CheckHostPointer(numElements, A, 0, SYNC_DEVICE, ptrType); CheckHostPointer(numElements, A, 0, SYNC_STREAM, ptrType); CheckHostPointer(numElements, A, 0, SYNC_EVENT, ptrType); + } + +TEST_CASE("Unit_hipHostGetDevicePointer_NullCheck") { + int* d_a; + HIP_CHECK(hipHostMalloc(reinterpret_cast(&d_a), sizeof(int))); + + auto res = hipHostGetDevicePointer(nullptr,d_a,0); + REQUIRE(res == hipErrorInvalidValue); + + HIP_CHECK(hipHostFree(d_a)); +} +