[llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/VirtualCall.java Makefile
Alkis Evlogimenos
alkis at cs.uiuc.edu
Sun Dec 5 15:32:44 PST 2004
Changes in directory llvm-java/test/Programs/SingleSource/UnitTests:
VirtualCall.java added (r1.1)
Makefile updated: 1.11 -> 1.12
---
Log message:
Remove bogus tests and add another for virtual function calls.
---
Diffs of the changes: (+29 -2)
Index: llvm-java/test/Programs/SingleSource/UnitTests/VirtualCall.java
diff -c /dev/null llvm-java/test/Programs/SingleSource/UnitTests/VirtualCall.java:1.1
*** /dev/null Sun Dec 5 17:32:43 2004
--- llvm-java/test/Programs/SingleSource/UnitTests/VirtualCall.java Sun Dec 5 17:32:33 2004
***************
*** 0 ****
--- 1,28 ----
+ class VirtualCallBase
+ {
+ public int foo() { return 1; }
+ public int bar() { return 2; }
+ }
+
+ class VirtualCallDerived extends VirtualCallBase
+ {
+ public int foo() { return 100; }
+ public int bar() { return super.bar() + super.foo(); }
+ }
+
+ public class VirtualCall
+ {
+ public static void main(String[] args) {
+ VirtualCallBase a = new VirtualCallBase();
+ Test.print_int_ln(a.foo());
+ Test.print_int_ln(a.bar());
+
+ a = new VirtualCallDerived();
+ Test.print_int_ln(a.foo());
+ Test.print_int_ln(a.bar());
+
+ VirtualCallDerived b = new VirtualCallDerived();
+ Test.print_int_ln(b.foo());
+ Test.print_int_ln(b.bar());
+ }
+ }
Index: llvm-java/test/Programs/SingleSource/UnitTests/Makefile
diff -u llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.11 llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.12
--- llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.11 Sun Dec 5 17:03:31 2004
+++ llvm-java/test/Programs/SingleSource/UnitTests/Makefile Sun Dec 5 17:32:33 2004
@@ -10,7 +10,6 @@
JAVA_TESTS := Arithm \
BigConstants \
- ClassTest \
FieldAccess \
FloatCompare \
ForLoop \
@@ -18,9 +17,9 @@
InstanceOf \
LongCompare \
LookupSwitch \
- Return \
StaticInitializers \
TableSwitch \
+ VirtualCall \
VTable
CPPFLAGS+=-I$(BUILD_SRC_ROOT)/include/llvm/Java
More information about the llvm-commits
mailing list