* 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
+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>
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;
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;
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;
# `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
#
--- /dev/null
+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";
+ }
+}
--- /dev/null
+java.lang.ArrayIndexOutOfBoundsException
+java.lang.ArrayStoreException
+java.lang.ArrayIndexOutOfBoundsException
+foobar
--- /dev/null
+xfail-byte-output
--- /dev/null
+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();
+ }
+}
--- /dev/null
+index
+rhs
+java.lang.ArrayIndexOutOfBoundsException
--- /dev/null
+xfail-source-output