Commit 2e427571 authored by Michael Beck's avatar Michael Beck
Browse files

more cases added

[r15786]
parent 6d04f992
......@@ -43,6 +43,38 @@ int sub3(int x, int y)
return -x - y;
}
int cmp1(int x, int y) {
return -x == -y;
}
int cmp2(int x, int y) {
return -x != -y;
}
int cmp3(int x, int y) {
return ~x == ~y;
}
int cmp4(int x, int y) {
return ~x != ~y;
}
int cmp5(int x, int y, int z) {
return x + z == z + y;
}
int cmp6(int x, int y, int z) {
return x + z != y + z;
}
int cmp7(int x, int y, int z) {
return x - z == y - z;
}
int cmp8(int x, int y, int z) {
return z -x != z - y;
}
int main(void)
{
#define TU(func,x,expect) \
......@@ -60,4 +92,12 @@ int main(void)
TB(sub1, 23, 17, -691);
TB(sub2, 42, 17, 59);
TB(sub3, 42, 17, -59);
TB(cmp1, 42, 17, 0);
TB(cmp2, 42, 17, 1);
TB(cmp3, 42, 17, 0);
TB(cmp4, 42, 17, 1);
TT(cmp5, 42, 17, -4, 0);
TT(cmp6, 42, 17, -4, 1);
TT(cmp7, 42, 17, -4, 0);
TT(cmp8, 42, 17, -4, 1);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment