summaryrefslogtreecommitdiffstats
path: root/tests/bugs/InstanceAsClassRefToConstant.java
diff options
context:
space:
mode:
authorwisberg <wisberg>2002-12-20 04:54:45 +0000
committerwisberg <wisberg>2002-12-20 04:54:45 +0000
commit8312dfbc60b4589559f6943973cec819d28c68d6 (patch)
treec923c4f05b3049e9f18ab63c4ca50c42d2199b6c /tests/bugs/InstanceAsClassRefToConstant.java
parentbc0c559654cb471c8392ded0f25d12b527e1f115 (diff)
downloadaspectj-8312dfbc60b4589559f6943973cec819d28c68d6.tar.gz
aspectj-8312dfbc60b4589559f6943973cec819d28c68d6.zip
added test cases for old jitterbugs
moved passing tests from ajcTestsFailing to ajcTests
Diffstat (limited to 'tests/bugs/InstanceAsClassRefToConstant.java')
-rw-r--r--tests/bugs/InstanceAsClassRefToConstant.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/bugs/InstanceAsClassRefToConstant.java b/tests/bugs/InstanceAsClassRefToConstant.java
new file mode 100644
index 000000000..6e615ae97
--- /dev/null
+++ b/tests/bugs/InstanceAsClassRefToConstant.java
@@ -0,0 +1,40 @@
+
+import org.aspectj.testing.Tester;
+import java.util.*;
+
+/** @testcase PR#909 instance as class reference to constant */
+public class InstanceAsClassRefToConstant {
+ public static void main(String[] args) {
+ throw new Error("XXX not set up to run");
+ }
+}
+
+abstract class CWithLongConst {
+ public static final long MAX = 1000000;
+}
+
+class A extends CWithLongConst {
+}
+
+class TestCase {
+ public final static void main(String[] argv) {
+ A aL = new A();
+
+ // bad error
+ // a) Sanity check:
+ // stack size is -1 after stmt BreakStmt(label: null) (warning)
+ for (long l=0; l<2000000; l+=100000) {
+ if (l > aL.MAX) {
+ break;
+ }
+ }
+
+ // b) Sanity check: stack size is -1 after stmt ExprStmt() (warning)
+ String[] stringsL = null;
+ for (long k=0; (k<2000000) && (stringsL == null); k+=100000) {
+ if (k > aL.MAX) {
+ stringsL = new String[1];
+ }
+ }
+ }
+}