more cases added
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 13 Sep 2007 13:41:47 +0000 (13:41 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 13 Sep 2007 13:41:47 +0000 (13:41 +0000)
[r15786]

ir/be/test/localopts.c

index f9e4bf4..3d8ca0c 100644 (file)
@@ -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);
 }