mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 21:53:12 +08:00
[libc++] Add some tests for std::bit_cast using pointers
Differential Revision: https://reviews.llvm.org/D154728
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user