# LVB (c) Copyright 2003-2006 by Daniel Barker.
# Permission is granted to copy and use this program provided that no fee is
# charged for it and provided that this copyright notice is not removed.

# Negative test for alloc(). Check a massive allocation fails
# gracefully (likely), or really succeeds (less likely).

# run testprog.exe
$output = `./testprog.exe`;
$status = $?;

# check output
if ((($status != 0)
 && ($output =~ /FATAL ERROR: out of memory: cannot allocate for massive array/))
 || (($status == 0) && ($output =~ /^test passed$/)))
{
    print "test passed\n";
}
else
{
    print "test failed\n";
}
