Added regression test for PR148.
authorStefan Ring <stefan@complang.tuwien.ac.at>
Mon, 22 Nov 2010 18:59:51 +0000 (19:59 +0100)
committerStefan Ring <stefan@complang.tuwien.ac.at>
Mon, 22 Nov 2010 18:59:51 +0000 (19:59 +0100)
tests/regression/bugzilla/All.java
tests/regression/bugzilla/Makefile.am
tests/regression/bugzilla/PR148.java [new file with mode: 0644]
tests/regression/bugzilla/testlcmp.j [new file with mode: 0644]

index 4454147378fee5cd95d1678356503c2459f82cf7..206d7c9b6046cf18629632abe8d0a255d7a21afd 100644 (file)
@@ -41,7 +41,8 @@ PR114.class,
 PR116.class,
 PR119.class,
 PR125.class,
-PR131.class
+PR131.class,
+PR148.class
 })
 
 public class All {
index f56d5df0370bb7673e7e6152f0c1f7c4d66501f8..146b74b94cb06b61ec9155ecb04de9bbc17b0546 100644 (file)
@@ -34,7 +34,8 @@ CLEANFILES = \
 check: build run
 
 build:
-       $(JAVACCMD) -classpath $(JUNIT_JAR) -d . $(srcdir)/*.java
+       $(JAVACMD) -cp $(JASMIN_JAR) jasmin.Main $(srcdir)/*.j
+       $(JAVACCMD) -classpath $(JUNIT_JAR):$(srcdir) -d . $(srcdir)/*.java
 
 run:
        $(JAVACMD) -classpath $(JUNIT_JAR):. org.junit.runner.JUnitCore All
diff --git a/tests/regression/bugzilla/PR148.java b/tests/regression/bugzilla/PR148.java
new file mode 100644 (file)
index 0000000..e5fdc3c
--- /dev/null
@@ -0,0 +1,34 @@
+/* tests/regression/bugzilla/PR148.java
+
+   Copyright (C) 2010
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+*/
+
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+public class PR148 {
+    @Test
+    public void test() {
+        assertEquals(-1L, (long) testlcmp.compare(5, 7));
+    }
+}
diff --git a/tests/regression/bugzilla/testlcmp.j b/tests/regression/bugzilla/testlcmp.j
new file mode 100644 (file)
index 0000000..1c2fd80
--- /dev/null
@@ -0,0 +1,21 @@
+.class public testlcmp
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+   aload_0
+   invokenonvirtual java/lang/Object/<init>()V
+   return
+.end method
+
+; ======================================================================
+
+.method public static compare(JJ)I
+       .limit locals 4
+       .limit stack 4
+       lload_0
+       lload_2
+       lcmp
+       ireturn
+.end method