#include <stdio.h> // fprintf(), NULL
#include <stdlib.h> // exit(), EXIT_SUCCESS
#include "test.h" // PASS(), FAIL(), XPASS(), XFAIL()
int foo[] = { 5, 6, 7, 8 };
extern int* getfoo();
extern int bar[];
int __attribute__((weak)) stuff[] = { 1, 2, 3, 4, 5 };
void realmain()
{
if ( getfoo()[2] != 7 )
FAIL("weak-non-lazy, getfoo()[2]=%d", getfoo()[2]);
else if ( bar[1] != 21 )
FAIL("weak-non-lazy, bar[1]=%d", bar[1]);
else if ( stuff[3] != 4 )
FAIL("weak-external-reloc, pstuffr=%d", stuff[3]);
else
PASS("weak-non-lazy");
}