Hi list,
Here is a simple C program that does not compile and execute correclty
with TCC (on i386, both with TCC 0.9.25 and with the latest sources; it
works on AMD64):
#include <stdio.h>
long long int ll[] = { 1LL, 2LL };
unsigned long long int ull[] = { 1ULL, 2ULL };
int main ()
{
long long int lli;
unsigned long long int ulli;
lli = 1LL;
printf ("%lld ", ll[lli]); printf ("%lld ", ll[1LL]); printf ("%lld\n",
ll[1]);
printf ("%lld %lld %lld\n", ll[lli], ll[1LL], ll[1]);
if (ll[lli] == 2LL) printf ("OK "); else printf ("KO ");
if (ll[1LL] == 2LL) printf ("OK "); else printf ("KO ");
if (ll[1] == 2LL) printf ("OK\n"); else printf ("KO\n");
ulli = 1ULL;
printf ("%llu ", ull[ulli]); printf ("%llu ", ull[1ULL]); printf ("%llu\n",
ull[1]);
printf ("%llu %llu %llu\n", ull[ulli], ull[1ULL], ull[1]);
if (ull[ulli] == 2ULL) printf ("OK "); else printf ("KO ");
if (ull[1ULL] == 2ULL) printf ("OK "); else printf ("KO ");
if (ull[1] == 2ULL) printf ("OK\n"); else printf ("KO\n");
return 0;
}
It should obviously print:
2 2 2
2 2 2
OK OK OK
2 2 2
2 2 2
OK OK OK
but it prints:
0 2 2
2 2 2
KO OK OK
0 2 2
2 2 2
KO OK OK
--ghe
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel