From bb35b4964da2d682716f636d0cba5c35609aa483 Mon Sep 17 00:00:00 2001 From: Stefan Ring Date: Mon, 22 Nov 2010 19:59:51 +0100 Subject: [PATCH] Added regression test for PR148. --- tests/regression/bugzilla/All.java | 3 ++- tests/regression/bugzilla/Makefile.am | 3 ++- tests/regression/bugzilla/PR148.java | 34 +++++++++++++++++++++++++++ tests/regression/bugzilla/testlcmp.j | 21 +++++++++++++++++ 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 tests/regression/bugzilla/PR148.java create mode 100644 tests/regression/bugzilla/testlcmp.j diff --git a/tests/regression/bugzilla/All.java b/tests/regression/bugzilla/All.java index 445414737..206d7c9b6 100644 --- a/tests/regression/bugzilla/All.java +++ b/tests/regression/bugzilla/All.java @@ -41,7 +41,8 @@ PR114.class, PR116.class, PR119.class, PR125.class, -PR131.class +PR131.class, +PR148.class }) public class All { diff --git a/tests/regression/bugzilla/Makefile.am b/tests/regression/bugzilla/Makefile.am index f56d5df03..146b74b94 100644 --- a/tests/regression/bugzilla/Makefile.am +++ b/tests/regression/bugzilla/Makefile.am @@ -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 index 000000000..e5fdc3c12 --- /dev/null +++ b/tests/regression/bugzilla/PR148.java @@ -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 index 000000000..1c2fd80d4 --- /dev/null +++ b/tests/regression/bugzilla/testlcmp.j @@ -0,0 +1,21 @@ +.class public testlcmp +.super java/lang/Object + +; ====================================================================== + +.method public ()V + aload_0 + invokenonvirtual java/lang/Object/()V + return +.end method + +; ====================================================================== + +.method public static compare(JJ)I + .limit locals 4 + .limit stack 4 + lload_0 + lload_2 + lcmp + ireturn +.end method -- 2.25.1