changeset 22210:36fff39fa39f

Add VarArgs_Unroll test.
author Josef Eisl <josef.eisl@jku.at>
date Tue, 07 Jul 2015 17:08:44 +0200
parents cd19e0cf7387
children a634b6f23af6
files graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_Unroll.java
diffstat 1 files changed, 59 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/micro/VarArgs_Unroll.java	Tue Jul 07 17:08:44 2015 +0200
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.jtt.micro;
+
+import org.junit.*;
+
+import com.oracle.graal.jtt.*;
+
+/*
+ */
+public class VarArgs_Unroll extends JTTTest {
+
+    public static boolean test(String a, String b) {
+        return check(a, b);
+    }
+
+    private static boolean check(String... args) {
+        if (args.length == 0) {
+            return true;
+        }
+        String s = args[0];
+        for (String t : args) {
+            if (!t.equals(s)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    @Test
+    public void run0() throws Throwable {
+        runTest("test", "ab", "ab");
+    }
+
+    @Test
+    public void run1() throws Throwable {
+        runTest("test", "ab", "abc");
+    }
+}