#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* pfoo;
extern int bar[];
int* pbar = &bar[1];
extern int getfrob();
int main()
{
if ( *pfoo != 7 )
FAIL("weak-external-reloc-flat, pfoo=%d", *pfoo);
else if ( *pbar != 21 )
FAIL("weak-external-reloc-flat, pbar=%d", *pbar);
else if ( getfrob() != 22 )
FAIL("weak-external-reloc-flat, frob()=%d", getfrob());
else
PASS("weak-external-reloc-flat");
return EXIT_SUCCESS;
}