We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 52a83d8 commit 87604c2Copy full SHA for 87604c2
optvm/src/test/java/com/compilerprogramming/ezlang/compiler/TestSSATransform.java
@@ -814,4 +814,30 @@ func foo(x: Int) {
814
System.out.println(result);
815
}
816
817
+ // http://users.csc.calpoly.edu/~akeen/courses/csc431/handouts/references/ssa_example.pdf
818
+ @Test
819
+ public void testSSAExample() {
820
+ // TODO
821
+ String src = """
822
+func foo(x: Int, y: Int)->Int {
823
+ var sum: Int
824
+
825
+ if (x >= y)
826
+ return 0
827
828
+ sum = 0;
829
+ while (x < y) {
830
+ if (x / 2 * 2 == x) {
831
+ sum = sum + 1
832
+ }
833
+ x = x + 1
834
835
+ return sum
836
+}
837
+ """;
838
+ String result = compileSrc(src);
839
+ System.out.println(result);
840
841
842
843
0 commit comments