mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Add missing files
This commit is contained in:
parent
d1b3258ae7
commit
aecdadd02e
2
base/glibc-compatibility/tests/CMakeLists.txt
Normal file
2
base/glibc-compatibility/tests/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
||||
add_executable(memcpy_test memcpy_test.cpp)
|
||||
target_link_libraries(memcpy_test common memcpy)
|
26
base/glibc-compatibility/tests/memcpy_test.cpp
Normal file
26
base/glibc-compatibility/tests/memcpy_test.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include <string.h>
|
||||
#include <iostream>
|
||||
#include <memcpy.h>
|
||||
|
||||
__attribute__((__noinline__)) void memcpy_noinline(void * __restrict dst, const void * __restrict src, size_t size)
|
||||
{
|
||||
memcpy(dst, src, size);
|
||||
}
|
||||
|
||||
|
||||
int main(int, char **)
|
||||
{
|
||||
constexpr size_t buf_size = 100;
|
||||
char buf[buf_size]{};
|
||||
memcpy_noinline(buf, "abc", 3);
|
||||
|
||||
size_t bytes_to_copy = 3;
|
||||
while (bytes_to_copy * 2 < buf_size)
|
||||
{
|
||||
memcpy_noinline(&buf[bytes_to_copy], buf, bytes_to_copy);
|
||||
bytes_to_copy *= 2;
|
||||
}
|
||||
|
||||
std::cerr << buf << "\n";
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user