--- /dev/null
+#!/bin/sh
+
+VERBOSE=0
+EXITCODE=0
+
+if [ "$1" = "--verbose" ] ; then
+ shift
+ VERBOSE=1
+fi
+
+while [ -n "$1" ]
+do
+ TEST="$1"
+ TESTBASENAME=$(basename "$TEST" .j)
+
+ TESTOUT="TESTOUT"
+ TESTEXPECT="TESTEXPECT"
+ TESTLOG="TESTLOG"
+
+ jasmin "$TEST" || exit 2
+ cacao "$TESTBASENAME" >"$TESTOUT" || exit 2
+
+ grep 'OUTPUT:' "$TEST" | sed 's,.*OUTPUT:\s*,,' >"$TESTEXPECT"
+
+ if diff -u "$TESTEXPECT" "$TESTOUT" ; then
+ echo "PASS: $TEST"
+ else
+ echo "FAIL: $TEST"
+ EXITCODE=1
+ fi
+
+ if [ "$VERBOSE" -eq "1" ] ; then
+ cacao -sia "$TESTBASENAME" >"$TESTLOG" || exit 2
+ ./show "$TESTLOG"
+ fi
+
+ shift
+done
+
+#rm -f "$TESTOUT" "$TESTEXPECT" "$TESTLOG"
+
+exit $EXITCODE
--- /dev/null
+#!/bin/sh
+
+LOG="$1"
+
+cat "$LOG" | sed -n '/^test_.*\.main/,$p' | sed -n '/=== L002 ===/,$d ; /=== L001 ===/,$p' | sed '/^===/d'
+
--- /dev/null
+.class public test
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 2
+ .limit locals 2
+
+ ldc 35
+ istore 1
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ iload 1
+ invokestatic test/checkI(I)V
+ ; OUTPUT: 35
+
+ return
+.end method
--- /dev/null
+.class public test_coalesce_simple_store
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 2
+ .limit locals 2
+
+ ldc 35
+ istore 1
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ ldc 42
+ istore 1
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ iload 1
+ invokestatic test_coalesce_simple_store/checkI(I)V
+ ; OUTPUT: 42
+
+ return
+.end method
--- /dev/null
+.class public test_dup
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static check(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+.method public static check(J)V
+ .limit locals 2
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ lload_0
+ invokevirtual java/io/PrintStream/println(J)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 3
+ .limit locals 2
+
+ ldc 35
+ istore 1
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ ldc 32
+ ldc 91
+ dup
+ isub
+ invokestatic test_dup/check(I)V
+ ; OUTPUT: 0
+ invokestatic test_dup/check(I)V
+ ; OUTPUT: 32
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ return
+.end method
--- /dev/null
+.class public test_dup2
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static check(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+.method public static check(J)V
+ .limit locals 2
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ lload_0
+ invokevirtual java/io/PrintStream/println(J)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 4
+ .limit locals 2
+
+ ldc 35
+ istore 1
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ ldc 32
+ ldc 91
+ dup2 ; 32 91 32 91 (top)
+ isub ; 32 91 -59 (top)
+ invokestatic test_dup2/check(I)V
+ ; OUTPUT: -59
+ invokestatic test_dup2/check(I)V
+ ; OUTPUT: 91
+ invokestatic test_dup2/check(I)V
+ ; OUTPUT: 32
+
+ ldc 32
+ ldc2_w 91
+ dup2 ; 32 91 91 (top)
+ lsub ; 32 91 0 (top)
+ invokestatic test_dup2/check(J)V
+ ; OUTPUT: 0
+ invokestatic test_dup2/check(I)V
+ ; OUTPUT: 32
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ return
+.end method
--- /dev/null
+.class public test_dup2_x1
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 5
+ .limit locals 2
+
+ ldc 35
+ istore 1
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ ldc 32
+ ldc 91
+ ldc 47
+ dup2_x1 ; 91 47 32 91 47
+ isub
+ invokestatic test_dup2_x1/checkI(I)V
+ ; OUTPUT: 44
+ isub
+ invokestatic test_dup2_x1/checkI(I)V
+ ; OUTPUT: 15
+ invokestatic test_dup2_x1/checkI(I)V
+ ; OUTPUT: 91
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ return
+.end method
--- /dev/null
+.class public test_dup2_x2
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static check(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+.method public static check(J)V
+ .limit locals 2
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ lload_0
+ invokevirtual java/io/PrintStream/println(J)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 6
+ .limit locals 2
+
+ ldc 35
+ istore 1
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ ldc 11
+ ldc 12
+ ldc 32
+ ldc 91
+ dup2_x2
+ isub
+ invokestatic test_dup2_x2/check(I)V
+ ; OUTPUT: -59
+ invokestatic test_dup2_x2/check(I)V
+ ; OUTPUT: 12
+ isub
+ invokestatic test_dup2_x2/check(I)V
+ ; OUTPUT: 80
+ invokestatic test_dup2_x2/check(I)V
+ ; OUTPUT: 32
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ return
+.end method
--- /dev/null
+.class public test_dup_x1
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 3
+ .limit locals 2
+
+ ldc 35
+ istore 1
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ ldc 32
+ ldc 91
+ dup_x1 ; 91 32 91
+ isub
+ invokestatic test_dup_x1/checkI(I)V
+ ; OUTPUT: -59
+ invokestatic test_dup_x1/checkI(I)V
+ ; OUTPUT: 91
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ return
+.end method
--- /dev/null
+.class public test_dup_x2
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static check(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+.method public static check(J)V
+ .limit locals 2
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ lload_0
+ invokevirtual java/io/PrintStream/println(J)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 4
+ .limit locals 2
+
+ ldc 35
+ istore 1
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ ldc 17
+ ldc 32
+ ldc 91
+ dup_x2 ; 91 17 32 91
+ isub
+ invokestatic test_dup_x2/check(I)V
+ ; OUTPUT: -59
+ isub
+ invokestatic test_dup_x2/check(I)V
+ ; OUTPUT: 74
+
+ ldc 17
+ ldc2_w 32
+ ldc 91
+ dup_x2 ; 17 91 32 91
+ i2l
+ lsub
+ invokestatic test_dup_x2/check(J)V
+ ; OUTPUT: -59
+ isub
+ invokestatic test_dup_x2/check(I)V
+ ; OUTPUT: -74
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ return
+.end method
--- /dev/null
+.class public test_load_store_conflict
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 2
+ .limit locals 3
+
+ ldc 35
+ istore 1
+ ldc 777
+ istore 2
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ ldc 42
+ iload 1 ; loads 35
+ ldc 100
+ iadd ; result = 135
+ istore 2
+ istore 1
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ iload 1
+ invokestatic test_load_store_conflict/checkI(I)V
+ ; OUTPUT: 42
+
+ iload 2
+ invokestatic test_load_store_conflict/checkI(I)V
+ ; OUTPUT: 135
+
+ return
+.end method
--- /dev/null
+.class public test_load_store_conflict_by_exception
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 3
+ .limit locals 3
+
+ .catch java/lang/Exception from test_start to test_end using handler
+
+ ldc 35
+ istore 1
+ ldc 777
+ istore 2
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+test_start:
+ ldc 42
+ aload 0
+ ldc 1
+ aaload ; may throw
+ pop
+ istore 1
+test_end:
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ iload 1
+ invokestatic test_load_store_conflict_by_exception/checkI(I)V
+
+ iload 2
+ invokestatic test_load_store_conflict_by_exception/checkI(I)V
+
+ return
+
+handler:
+ pop
+
+ ; output magic number to show we reached the handler
+ ldc 88888
+ invokestatic test_load_store_conflict_by_exception/checkI(I)V
+ ; OUTPUT: 88888
+
+ iload 1
+ invokestatic test_load_store_conflict_by_exception/checkI(I)V
+ ; OUTPUT: 35
+
+ iload 2
+ invokestatic test_load_store_conflict_by_exception/checkI(I)V
+ ; OUTPUT: 777
+
+ return
+.end method
+
--- /dev/null
+.class public test_load_store_conflict_by_exception_not_thrown
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 3
+ .limit locals 3
+
+ .catch java/lang/Exception from test_start to test_end using handler
+
+ ldc 35
+ istore 1
+ ldc 777
+ istore 2
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+test_start:
+ ldc 42
+ aload 0
+ arraylength ; may throw, but does not in this case
+ pop
+ istore 1
+test_end:
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ iload 1
+ invokestatic test_load_store_conflict_by_exception_not_thrown/checkI(I)V
+ ; OUTPUT: 42
+
+ iload 2
+ invokestatic test_load_store_conflict_by_exception_not_thrown/checkI(I)V
+ ; OUTPUT: 777
+
+ return
+
+handler:
+ pop
+
+ ; output magic number to show we reached the handler
+ ldc 88888
+ invokestatic test_load_store_conflict_by_exception_not_thrown/checkI(I)V
+
+ iload 1
+ invokestatic test_load_store_conflict_by_exception_not_thrown/checkI(I)V
+
+ iload 2
+ invokestatic test_load_store_conflict_by_exception_not_thrown/checkI(I)V
+
+ return
+.end method
+
--- /dev/null
+.class public test_load_store_conflict_via_dup
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 4
+ .limit locals 3
+
+ ldc 35
+ istore 1
+ ldc 777
+ istore 2
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ iload 1 ; loads 35
+ ldc 42
+ dup2 ; stack is now 35 42 35 42 (top)
+ iadd ; stack is now 35 42 77
+ istore 2
+ istore 1
+ pop
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ iload 1
+ invokestatic test_load_store_conflict_via_dup/checkI(I)V
+ ; OUTPUT: 42
+
+ iload 2
+ invokestatic test_load_store_conflict_via_dup/checkI(I)V
+ ; OUTPUT: 77
+
+ return
+.end method
--- /dev/null
+.class public test_load_store_conflict_via_swap
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 4
+ .limit locals 3
+
+ ldc 35
+ istore 1
+ ldc 777
+ istore 2
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ iload 1 ; loads 35
+ ldc 42
+ swap ; stack is now 42 35 (top)
+ istore 2 ; stores 35 to L2
+ istore 1 ; stores 42 to L2
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ iload 1
+ invokestatic test_load_store_conflict_via_swap/checkI(I)V
+ ; OUTPUT: 42
+
+ iload 2
+ invokestatic test_load_store_conflict_via_swap/checkI(I)V
+ ; OUTPUT: 35
+
+ return
+.end method
--- /dev/null
+.class public test_no_store_load_conflict
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 2
+ .limit locals 3
+
+ ldc 35
+ istore 1
+ ldc 777
+ istore 2
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ iload 1 ; loads 35
+ ldc 42
+ istore 2 ; stores 42
+ ldc 100
+ iadd ; 35 + 100 = 135
+ istore 1
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ iload 1
+ invokestatic test_no_store_load_conflict/checkI(I)V
+ ; OUTPUT: 135
+
+ iload 2
+ invokestatic test_no_store_load_conflict/checkI(I)V
+ ; OUTPUT: 42
+
+ return
+.end method
--- /dev/null
+.class public test_no_store_store_conflict
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 2
+ .limit locals 3
+
+ ldc 35
+ istore 1
+ ldc 36
+ istore 2
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ ldc 42
+ ldc 7
+ istore 2
+ istore 1
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ iload 1
+ invokestatic test_no_store_store_conflict/checkI(I)V
+ ; OUTPUT: 42
+
+ iload 2
+ invokestatic test_no_store_store_conflict/checkI(I)V
+ ; OUTPUT: 7
+
+ return
+.end method
--- /dev/null
+.class public test_store_load_conflict
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 2
+ .limit locals 3
+
+ ldc 35
+ istore 1
+ ldc 777
+ istore 2
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ iload 1 ; loads 35
+ ldc 42
+ istore 1 ; stores 42
+ ldc 100
+ iadd ; 35 + 100 = 135
+ istore 2
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ iload 1
+ invokestatic test_store_load_conflict/checkI(I)V
+ ; OUTPUT: 42
+
+ iload 2
+ invokestatic test_store_load_conflict/checkI(I)V
+ ; OUTPUT: 135
+
+ return
+.end method
--- /dev/null
+.class public test_store_store_conflict
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 2
+ .limit locals 2
+
+ ldc 35
+ istore 1
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ ldc 42
+ ldc 7
+ istore 1 ; stores 7
+ istore 1 ; stores 42
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ iload 1
+ invokestatic test_store_store_conflict/checkI(I)V
+ ; OUTPUT: 42
+
+ return
+.end method
--- /dev/null
+.class public test_store_store_conflict_2
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 3
+ .limit locals 2
+
+ ldc 35
+ istore 1
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ ldc 11
+ ldc 42
+ ldc 7
+ istore 1
+ istore 1
+ istore 1
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ iload 1
+ invokestatic test_store_store_conflict_2/checkI(I)V
+ ; OUTPUT: 11
+
+ return
+.end method
--- /dev/null
+.class public test_swap
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+ aload_0
+ invokenonvirtual java/lang/Object/<init>()V
+ return
+.end method
+
+; ======================================================================
+
+.method public static check(I)V
+ .limit locals 1
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ iload_0
+ invokevirtual java/io/PrintStream/println(I)V
+ return
+.end method
+
+.method public static check(J)V
+ .limit locals 2
+ .limit stack 10
+ getstatic java/lang/System/out Ljava/io/PrintStream;
+ lload_0
+ invokevirtual java/io/PrintStream/println(J)V
+ return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+ .limit stack 2
+ .limit locals 2
+
+ ldc 35
+ istore 1
+
+ aload 0
+ ifnull force_basic_block_boundary
+
+ ; --------------------------------------------------
+
+ ldc 32
+ ldc 91
+ swap
+ isub
+ invokestatic test_swap/check(I)V
+ ; OUTPUT: 59
+
+ ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+ return
+.end method