[libc++] Add some tests for std::bit_cast using pointers

Differential Revision: https://reviews.llvm.org/D154728
This commit is contained in:
Louis Dionne
2023-07-07 13:37:27 -04:00
parent 67b37af4cd
commit 1c834112f2

View File

@@ -239,6 +239,28 @@ bool tests() {
#endif
}
// Test pointers
{
{
int obj = 3;
void* p = &obj;
test_roundtrip_through_nested_T(p);
test_roundtrip_through_buffer(p);
test_roundtrip_through<void*>(p);
test_roundtrip_through<char*>(p);
test_roundtrip_through<int*>(p);
}
{
int obj = 3;
int* p = &obj;
test_roundtrip_through_nested_T(p);
test_roundtrip_through_buffer(p);
test_roundtrip_through<int*>(p);
test_roundtrip_through<char*>(p);
test_roundtrip_through<void*>(p);
}
}
return true;
}