ClickHouse/dbms/IO/tests/write_int.cpp

29 lines
544 B
C++
Raw Normal View History

#include <IO/WriteHelpers.h>
#include <IO/WriteBufferFromFileDescriptor.h>
2019-02-26 10:53:35 +00:00
/** gcc-7 generates wrong code with -O1 -finline-small-functions -ftree-vrp
* This is compiler bug. The issue does not exist in gcc-8 or clang-8.
*/
using namespace DB;
2019-12-15 06:34:43 +00:00
static void NO_INLINE write(WriteBuffer & out, size_t size)
{
for (size_t i = 0; i < size; ++i)
{
writeIntText(i, out);
2019-02-25 20:21:05 +00:00
writeChar(' ', out);
}
}
int main(int, char **)
{
WriteBufferFromFileDescriptor out(STDOUT_FILENO);
2019-02-25 20:29:56 +00:00
write(out, 80);
return 0;
}