tinycc/tests/tests2/111_conversion.c
herman ten brugge 199e135142
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86_64-win32 (push) Has been cancelled
build and test / test-i386-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled
arm double to (unsigned) long long conversion
Bug found with openssl test suite.
2025-08-17 08:49:29 +02:00

25 lines
321 B
C

#include <stdio.h>
union u {
unsigned long ul;
long double ld;
};
void
conv (union u *p)
{
p->ul = (unsigned int) p->ld;
}
int main (void)
{
union u v;
double d = 1234567890.0;
v.ld = 42;
conv (&v);
printf ("%lu\n", v.ul);
printf ("%llu\n", (unsigned long long)d);
return 0;
}