eccp optimized the assert away!?!, anyway I wanna fix the real error first...
[libfirm] / ir / be / test / confirm.c
1 #include <stdio.h>
2
3 int looptest(int x) {
4         while (x) {
5                 printf("%d\n", x);
6         }
7         if (x) {
8                 printf("%d\n", x);
9         }
10         return x;
11 }
12
13
14 int xtest(int x) {
15         if (x) {
16                 printf("%d\n", x);
17         }
18         if (x) {
19                 printf("%d\n", x);
20         }
21         return x;
22 }
23
24 int test(int a, int b) {
25         int x = a * b;
26         if (a == 0)
27                 return x;
28         else
29                 return x - 1;
30 }
31
32 static int abs(int x) {
33         if (x < 0)
34                 return -x;
35         return x;
36 }
37
38 int test2(int a, int b) {
39         if (a > 0) {
40                 return abs(a);
41         }
42         return b;
43 }
44
45 int test3(int a, int b) {
46         if (a != 0) {
47                 b = b / -a;
48         }
49         return b;
50 }
51
52 int main(void) {
53         looptest(0);
54         printf("xtest() = %d\n", xtest(1));
55         printf("test() = %d\n", test(0, 1));
56         printf("test2() = %d\n", test2(1, 3));
57         printf("test3() = %d\n", test3(-3, 3));
58         return 0;
59 }