RVBTCC/test/overflow.c
2024-12-08 15:41:38 +08:00

42 lines
924 B
C

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);
}
int main() {
char placeholder[4096];
int a = 1;
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);
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);
}