diff --git a/testsuite/seed2/tests/java_ir/seed2.java b/testsuite/seed2/tests/java_ir/seed2.java new file mode 100644 index 000000000..e28018a50 --- /dev/null +++ b/testsuite/seed2/tests/java_ir/seed2.java @@ -0,0 +1,6 @@ +public class Seed2 { + public static void main(String[] args) { + int[] arr = new int[1]; + arr[1] = 1; + } +} diff --git a/testsuite/seed2/tests/java_ir/test.yml b/testsuite/seed2/tests/java_ir/test.yml new file mode 100644 index 000000000..b470dc4b4 --- /dev/null +++ b/testsuite/seed2/tests/java_ir/test.yml @@ -0,0 +1,6 @@ +language: JAVA8 +time: 2 +memory: 65536 +source: seed2.java +expect: IR +feedback: java.lang.ArrayIndexOutOfBoundsException diff --git a/testsuite/seed2/tests/java_mle/seed2.java b/testsuite/seed2/tests/java_mle/seed2.java new file mode 100644 index 000000000..555685fc9 --- /dev/null +++ b/testsuite/seed2/tests/java_mle/seed2.java @@ -0,0 +1,23 @@ +import java.util.*; + +public class Seed2 { + public static void main(String[] args) { + int[] arr = new int[1000000000]; + Scanner sc = new Scanner(System.in); + String result; + long lo = 1; + long hi = 2000000000; + long num; + while (lo < hi) { + num = (lo + hi) / 2; + System.out.println(num); + result = sc.nextLine(); + if (result.equals("FLOATS")) + hi = num; + else if (result.equals("SINKS")) + lo = num + 1; + else + break; + } + } +} diff --git a/testsuite/seed2/tests/java_mle/test.yml b/testsuite/seed2/tests/java_mle/test.yml new file mode 100644 index 000000000..97175c1f1 --- /dev/null +++ b/testsuite/seed2/tests/java_mle/test.yml @@ -0,0 +1,5 @@ +language: JAVA8 +time: 2 +memory: 65536 +source: seed2.java +expect: MLE