From: Matthias Braun Date: Wed, 22 Aug 2007 11:02:09 +0000 (+0000) Subject: improved version of fehler71 X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=daadfb7889515b3f60b68f1d7d9f785ac1d0990c;p=libfirm improved version of fehler71 [r15580] --- diff --git a/ir/be/test/fehler71.c b/ir/be/test/fehler71.c index f4f8f00bc..18e8d4edc 100644 --- a/ir/be/test/fehler71.c +++ b/ir/be/test/fehler71.c @@ -1,19 +1,30 @@ -/*$ -fno-if-conv $*/ +/*$ -fno-if-conv -fno-inline $*/ #include #include 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; }