summaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorBryce McKinlay <bryce@waitaki.otago.ac.nz>2002-02-20 04:14:15 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2002-02-20 04:14:15 +0000
commita2139e0c4890674db9c87c427f52627ceca97fad (patch)
treefcde10e26a580a87707fc919a83f9b708b94bc41 /libjava
parent6ea868b758701be4ac1fe50fb40bac04a0a3ba74 (diff)
downloadgcc-a2139e0c4890674db9c87c427f52627ceca97fad.tar.gz
libjava.exp: Add "xfail-byte-output" and "xfail-source-output".
* lib/libjava.exp: Add "xfail-byte-output" and "xfail-source-output". Don't display expected and actual output for a failed output test. * libjava.lang/ArrayStore.java: New file. * libjava.lang/ArrayStore.out: New file. * libjava.lang/ArrayStore.xfail: New file. xfail-byte-output. * libjava.lang/ArrayStore2.java: New file. * libjava.lang/ArrayStore2.out: New file. * libjava.lang/ArrayStore2.xfail: New file. xfail-source-output. From-SVN: r49888
Diffstat (limited to 'libjava')
-rw-r--r--libjava/testsuite/ChangeLog15
-rw-r--r--libjava/testsuite/lib/libjava.exp14
-rw-r--r--libjava/testsuite/libjava.lang/ArrayStore.java52
-rw-r--r--libjava/testsuite/libjava.lang/ArrayStore.out4
-rw-r--r--libjava/testsuite/libjava.lang/ArrayStore.xfail1
-rw-r--r--libjava/testsuite/libjava.lang/ArrayStore2.java31
-rw-r--r--libjava/testsuite/libjava.lang/ArrayStore2.out3
-rw-r--r--libjava/testsuite/libjava.lang/ArrayStore2.xfail1
8 files changed, 117 insertions, 4 deletions
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index a9799583d08..b9f5d6219bf 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -1,7 +1,22 @@
+2002-02-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * lib/libjava.exp: Add "xfail-byte-output" and "xfail-source-output".
+ Don't display expected and actual output for a failed output test.
+
+ * libjava.lang/ArrayStore.java: New file.
+ * libjava.lang/ArrayStore.out: New file.
+ * libjava.lang/ArrayStore.xfail: New file. xfail-byte-output.
+ * libjava.lang/ArrayStore2.java: New file.
+ * libjava.lang/ArrayStore2.out: New file.
+ * libjava.lang/ArrayStore2.xfail: New file. xfail-source-output.
+
2002-02-18 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* libjava.lang/err7.xfail: Removed.
* libjava.lang/err8.xfail: Removed.
+
+ * libjava.lang/ArrayStore.java: New file.
+ * libjava.lang/ArrayStore.out: New file.
2002-02-10 Tom Tromey <tromey@redhat.com>
diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp
index 67f9b6eea25..50996aa4ad9 100644
--- a/libjava/testsuite/lib/libjava.exp
+++ b/libjava/testsuite/lib/libjava.exp
@@ -510,12 +510,13 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
if {[info exists opts(xfail-output)]} {
setup_xfail *-*-*
}
+ if {[info exists opts(xfail-source-output)]} {
+ setup_xfail *-*-*
+ }
if { $passed == 1 } {
pass "$errname output from source compiled test"
eval gcj_cleanup $removeList
} else {
- clone_output "expected was $expected"
- clone_output "output was $output"
fail "$errname output from source compiled test"
}
close $id;
@@ -737,6 +738,9 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
if {[info exists opts(xfail-output)]} {
setup_xfail *-*-*
}
+ if {[info exists opts(xfail-byte-output)]} {
+ setup_xfail *-*-*
+ }
if {$options == "regexp_match"} {
if [regexp $expected $output] {
set passed 1;
@@ -750,8 +754,6 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
pass "$errname output from bytecode->native test"
eval gcj_cleanup $removeList
} else {
- clone_output "expected was $expected"
- clone_output "output was $output"
fail "$errname output from bytecode->native test"
}
close $id;
@@ -774,6 +776,10 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
# `xfail-exec' exec will fail
# `xfail-output'
# output will be wrong
+# `xfail-byte-output'
+# output will be wrong when compiled from bytecode
+# `xfail-source-output'
+# output will be wrong when compiled from source code
# `need-threads'
# test relies on thread support
#
diff --git a/libjava/testsuite/libjava.lang/ArrayStore.java b/libjava/testsuite/libjava.lang/ArrayStore.java
new file mode 100644
index 00000000000..9afac71c2b5
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/ArrayStore.java
@@ -0,0 +1,52 @@
+public class ArrayStore
+{
+ public static void main(String[] args)
+ {
+ ArrayStore s = new ArrayStore();
+
+ /* Check that bounds check takes precedence over array store check. */
+ try
+ {
+ s.a(new String[1]);
+ }
+ catch (Exception x)
+ {
+ System.out.println (x.getClass().getName());
+ }
+
+ try
+ {
+ s.a(new String[2]);
+ }
+ catch (Exception x)
+ {
+ System.out.println (x.getClass().getName());
+ }
+
+ /* Check that += operator on String[] element works and throws bounds
+ exception. */
+ try
+ {
+ s.b(new String[1]);
+ }
+ catch (Exception x)
+ {
+ System.out.println (x.getClass().getName());
+ }
+
+ String[] sb = new String[2];
+ sb[1] = "foo";
+ s.b(sb);
+ System.out.println (sb[1]);
+ }
+
+ void a(Object[] oa)
+ {
+ oa[1] = new Integer(2);
+ }
+
+ void b(String[] sa)
+ {
+ sa[1] += "bar";
+ }
+}
diff --git a/libjava/testsuite/libjava.lang/ArrayStore.out b/libjava/testsuite/libjava.lang/ArrayStore.out
new file mode 100644
index 00000000000..b22379de2a5
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/ArrayStore.out
@@ -0,0 +1,4 @@
+java.lang.ArrayIndexOutOfBoundsException
+java.lang.ArrayStoreException
+java.lang.ArrayIndexOutOfBoundsException
+foobar
diff --git a/libjava/testsuite/libjava.lang/ArrayStore.xfail b/libjava/testsuite/libjava.lang/ArrayStore.xfail
new file mode 100644
index 00000000000..7728fd25dcf
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/ArrayStore.xfail
@@ -0,0 +1 @@
+xfail-byte-output
diff --git a/libjava/testsuite/libjava.lang/ArrayStore2.java b/libjava/testsuite/libjava.lang/ArrayStore2.java
new file mode 100644
index 00000000000..1364d39b40e
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/ArrayStore2.java
@@ -0,0 +1,31 @@
+public class ArrayStore2
+{
+ public static void main(String[] args)
+ {
+ new ArrayStore2().a(new Object[2], 3);
+ }
+
+ void a(Object[] oa, int i)
+ {
+ try
+ {
+ oa[index()] = obj();
+ }
+ catch (Exception x)
+ {
+ System.out.println (x.getClass().getName());
+ }
+ }
+
+ int index()
+ {
+ System.out.println ("index");
+ return 3;
+ }
+
+ Object obj()
+ {
+ System.out.println ("rhs");
+ return new Object();
+ }
+}
diff --git a/libjava/testsuite/libjava.lang/ArrayStore2.out b/libjava/testsuite/libjava.lang/ArrayStore2.out
new file mode 100644
index 00000000000..89dddb244b2
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/ArrayStore2.out
@@ -0,0 +1,3 @@
+index
+rhs
+java.lang.ArrayIndexOutOfBoundsException
diff --git a/libjava/testsuite/libjava.lang/ArrayStore2.xfail b/libjava/testsuite/libjava.lang/ArrayStore2.xfail
new file mode 100644
index 00000000000..e4c7ce34df9
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/ArrayStore2.xfail
@@ -0,0 +1 @@
+xfail-source-output