[llvm-commits] CVS: llvm-java/test/Compiler/TableSwitch.java LookupSwitch.java If.java Arithm.java
Alkis Evlogimenos
alkis at cs.uiuc.edu
Tue May 25 16:49:05 PDT 2004
Changes in directory llvm-java/test/Compiler:
TableSwitch.java added (r1.1)
LookupSwitch.java added (r1.1)
If.java added (r1.1)
Arithm.java added (r1.1)
---
Log message:
Add some compiler test cases.
---
Diffs of the changes: (+50 -0)
Index: llvm-java/test/Compiler/TableSwitch.java
diff -c /dev/null llvm-java/test/Compiler/TableSwitch.java:1.1
*** /dev/null Tue May 25 16:46:28 2004
--- llvm-java/test/Compiler/TableSwitch.java Tue May 25 16:46:18 2004
***************
*** 0 ****
--- 1,15 ----
+ package edu.uiuc.cs.llvm;
+
+ public class TableSwitch
+ {
+ public static int main(String[] args) {
+ switch (4) {
+ case 0: return 4;
+ case 1: return 3;
+ case 2: return 2;
+ case 3: return 1;
+ case 4: return 0;
+ default: return -1;
+ }
+ }
+ }
Index: llvm-java/test/Compiler/LookupSwitch.java
diff -c /dev/null llvm-java/test/Compiler/LookupSwitch.java:1.1
*** /dev/null Tue May 25 16:46:28 2004
--- llvm-java/test/Compiler/LookupSwitch.java Tue May 25 16:46:18 2004
***************
*** 0 ****
--- 1,13 ----
+ package edu.uiuc.cs.llvm;
+
+ public class LookupSwitch
+ {
+ public static int main(String[] args) {
+ switch (128) {
+ case 0: return 255;
+ case 128: return 128;
+ case 255: return 0;
+ default: return -1;
+ }
+ }
+ }
Index: llvm-java/test/Compiler/If.java
diff -c /dev/null llvm-java/test/Compiler/If.java:1.1
*** /dev/null Tue May 25 16:46:28 2004
--- llvm-java/test/Compiler/If.java Tue May 25 16:46:18 2004
***************
*** 0 ****
--- 1,11 ----
+ package edu.uiuc.cs.llvm;
+
+ public class If
+ {
+ public static int main(String[] args) {
+ int i = 0;
+ if (i == 0)
+ return 0;
+ return 1;
+ }
+ }
Index: llvm-java/test/Compiler/Arithm.java
diff -c /dev/null llvm-java/test/Compiler/Arithm.java:1.1
*** /dev/null Tue May 25 16:46:28 2004
--- llvm-java/test/Compiler/Arithm.java Tue May 25 16:46:18 2004
***************
*** 0 ****
--- 1,11 ----
+ package edu.uiuc.cs.llvm;
+
+ public class Arithm
+ {
+ public static int main(String[] args) {
+ int one = 1;
+ int two = 2;
+
+ return (one + two) - (two * two) + (two / one) + (two % one) + (two << one) - (two >> 1); // = 4
+ }
+ }
More information about the llvm-commits
mailing list