
public class BigArrayTest {
  public static void main(String args[])
    {
      try {
	byte[] big_array = new byte[Integer.MAX_VALUE];
	big_array[Integer.MAX_VALUE-1] = 42;

	if (big_array[Integer.MAX_VALUE-1] == 42)
	  {
	    System.out.println("PASSED:  42");
	  }
	else
	  {
	    System.out.println("FAILED:  " + big_array[Integer.MAX_VALUE-1]);
	  }
      }
      catch (OutOfMemoryError e)
	{
	  System.out.println("FAILED: Unable to allocate array "+
			     "byte[" + (Integer.MAX_VALUE-1) + "]");
	}
      catch (Exception e)
	{
	  System.out.println("FAILED:  Unknown exception "+e);
	}
  }
}
