Пример #1
0
 /** Here the read should float to the end. */
 public static int testSplit2Snippet(int a) {
   try {
     return container.a;
   } finally {
     if (a < 0) {
       container.c = 15;
     } else {
       container.b = 15;
     }
     container.obj = null;
   }
 }
Пример #2
0
 /** Here the read should float to the end. */
 public static int testLoop2Snippet(int a, int b) {
   try {
     return container.a;
   } finally {
     for (int i = 0; i < a; i++) {
       if (b < 0) {
         container.b = 10;
       } else {
         container.c = 15;
       }
     }
   }
 }
Пример #3
0
  public static int testAntiDependencySnippet(int a) {
    /*
     * This read must not be scheduled after the following write.
     */
    int res = container.a;
    container.a = 10;

    /*
     * Add some more basic blocks.
     */
    if (a < 0) {
      container.b = 20;
    }
    container.c = 30;
    return res;
  }