Some more boolopt tests.
[libfirm] / ir / be / test / fehler71.c
index f4f8f00..18e8d4e 100644 (file)
@@ -1,19 +1,30 @@
-/*$ -fno-if-conv $*/
+/*$ -fno-if-conv -fno-inline $*/
 
 #include <stdio.h>
 #include <stdlib.h>
 
 int a = 42;
 
-void changea(void) {
+int changea(void) {
        a = 13;
+       return 1;
+}
+
+int f2(void) {
+       int t = a;
+       int t2 = changea();
+       changea();
+       changea();
+       int t3 = t + t2;
+       changea();
+       return t3;
 }
 
 int f(int f) {
        int t = a;
        changea();
 
-       /* must not use source address mode (loading from a) for t+1 and t+2 */
+       /* must not use source address mode (loading from a) for t+1 */
        if(f > 10000) {
                return t + 1;
        }
@@ -22,6 +33,8 @@ int f(int f) {
 
 int main(void) {
        srand(0);
-       printf("Res: %d\n", f(rand()));
+       printf("Res: %d (should be 43)\n", f(1000000));
+       a = 42;
+       printf("Res2: %d (should be 43)\n", f2());
        return 0;
 }