X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Ftest%2Fcondeval.c;h=acec5753fb4de4f023f24953526bb9022b6b5792;hb=3c6b9f272fd0d2b2c48a1e34084411c179d08105;hp=ee559dae446cd43122f03c382da1cc53d2391ac7;hpb=f7ce798e5b4e15aac29e64750acbb77ef6dba662;p=libfirm diff --git a/ir/be/test/condeval.c b/ir/be/test/condeval.c index ee559dae4..acec5753f 100644 --- a/ir/be/test/condeval.c +++ b/ir/be/test/condeval.c @@ -9,27 +9,24 @@ int f(int x) #if 1 -static int g(int x) +static __inline int g(int x) { return x == 42; } -extern void y(void); -extern void z(void); - void h(int x) { if (g(x)) { - y(); + puts("1"); } else { - z(); + puts("2"); } } #endif #if 1 -int a(void); +int rand(void); void i(void) { @@ -41,7 +38,7 @@ void i(void) for (x = 0; x < 10 && !finish; x++) { for (y = 0; y < 10 && !finish; y++) { for (z = 0; z < 10 && !finish; z++) { - if (a()) + if (rand()) finish = 1; //a(); } @@ -52,7 +49,7 @@ void i(void) #if 1 -int a(void); +int rand(void); void j(void) { @@ -64,13 +61,28 @@ void j(void) for (x = 0; !finish; x++) { for (y = 0; !finish; y++) { for (z = 0; !finish; z++) { - if (a()) finish = 1; + if (rand()) finish = 1; } } } } #endif + +#if 1 +static __inline int k(int x) +{ + if (x < 23) x = 23; + if (x > 42) x = 42; + return x; +} + +int l(int x) +{ + return k(x) == 23; +} +#endif + int main() { return 0; }