/* basic test for various kinds of constructs that might cause non-termination of the inliner or incorrect results */ public class foo { public static boolean FALSE = false; public static inline int A() { int x = 5; int y = 12+x; C(y,17); B(); int z = B() + B() * B(); x = 6; C(z+x,512); return x; } public static inline int B() { while (FALSE) { bar.X(); } int x = 22; return x; } public static inline void C(int myarg, int corr) { int x = myarg; System.out.println(corr + " : " + x); if (x != corr) System.out.println("Wrong answer!!!"); } public static inline void D() { D(); } public static void main(String [] args) { C(A(),6); bar poop = new bar(); if (false) poop.ABC(); int f = poop.DEF(); C(f,22); if (false) D(); System.out.println("done."); } } class bar { public inline bar() { if (false) { X(); ABC(); } } public inline void finalize() { Z(); } public inline void ABC() { X(); } public inline int DEF() { return 22; } public static inline void X() { Y(); } public static inline void Y() { Z(); } public static inline void Z() { Y(); } }