2e3cea0e9d6902009d6d726a034b8ae44c287eb5
[IRC.git] / Robust / src / Tests / mlp / tinyTest / test.java
1 public class Foo {
2   int f;
3   public Foo() {}
4 }
5
6
7 public class Test {
8
9   public static void main( String args[] ) {
10     
11     int x = Integer.parseInt( args[0] );
12     //int y = Integer.parseInt( args[1] );
13
14     for( int i = 0; i < x; ++i ) {
15
16       sese calc {
17         int sum = 0;
18         for( int j = 0; j <= i; ++j ) {
19           sum = sum + j;
20         }
21       }
22
23       sese prnt {
24         mightPrint( x, i, sum );
25       }
26
27     }
28
29
30     // just for testing root's ability to
31     // realize a single exit after all returns
32     // DOESN'T WORK!
33     //if( false ) {
34     //  return;
35     //}
36
37     
38     //Foo foo = new Foo();
39     //foo.f = x;
40     //setTo3( foo );
41   }
42
43   public static void mightPrint( int x, int i, int sum ) {
44     if( i == x - 1 ) {
45       System.out.println( "sum of integers 0-"+i+" is "+sum );
46     }
47   }
48
49   /*
50   public static void setTo3( Foo foo ) {
51     sese func {
52       foo.f = 3;
53     }   
54   }
55   */
56 }