RVBTCC/test/overflow.c

42 lines
925 B
C
Raw Normal View History

2024-12-08 07:41:38 +00:00
int printf(char* format, ...);
enum {
a = 1
};
int get_20() {
return (a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(- -0)))))))))))))))))))));
}
void dummy(int a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7) {
a0 += a1;
printf("%d\n", a0);
a0 -= a1;
printf("%d\n", a0);
a0 *= a1;
printf("%d\n", a0);
a0 /= a1;
printf("%d\n", a0);
a0 %= a1;
printf("%d\n", a0);
a0 &= a1;
printf("%d\n", a0);
a0 |= a1;
printf("%d\n", a0);
a0 ^= a2;
printf("%d\n", a0);
a0 <<= a1;
printf("%d\n", a0);
a0 >>= a1;
printf("%d\n", a0);
}
2024-12-08 03:40:47 +00:00
int main() {
2024-12-08 07:41:38 +00:00
char placeholder[4096];
2024-12-08 03:40:47 +00:00
int a = 1;
2024-12-08 07:41:38 +00:00
dummy((a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(! !0))))))))))))))))))))), 3, a, a, a, a, a, a);
2024-12-12 15:21:34 +00:00
return (a=(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(a+(~ ~0)))))))))))))))))))))), (a = +a);
2024-12-08 03:40:47 +00:00
}