Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / libjava / testsuite / libjava.lang / ArrayStore.java
blob9afac71c2b57a621acce64825a0c2c0277450600
1 public class ArrayStore
3 public static void main(String[] args)
5 ArrayStore s = new ArrayStore();
7 /* Check that bounds check takes precedence over array store check. */
8 try
10 s.a(new String[1]);
12 catch (Exception x)
14 System.out.println (x.getClass().getName());
17 try
19 s.a(new String[2]);
21 catch (Exception x)
23 System.out.println (x.getClass().getName());
26 /* Check that += operator on String[] element works and throws bounds
27 exception. */
28 try
30 s.b(new String[1]);
32 catch (Exception x)
34 System.out.println (x.getClass().getName());
37 String[] sb = new String[2];
38 sb[1] = "foo";
39 s.b(sb);
40 System.out.println (sb[1]);
43 void a(Object[] oa)
45 oa[1] = new Integer(2);
48 void b(String[] sa)
50 sa[1] += "bar";