#include "../kernel-test-runner.h"
extern int bar();
__typeof(&bar) barPtr = &bar;
int foo() {
return barPtr() + 4;
}
__attribute__((constructor))
int test(const TestRunnerFunctions* funcs) {
LOG("test(): start");
int v = foo();
if ( v != 7 ) {
FAIL("foo() returned %d vs expected 7", v);
}
LOG("test(): end");
return 0;
}
int fooDirect() {
return bar() + 4;
}
__attribute__((constructor))
int testDirect(const TestRunnerFunctions* funcs) {
LOG("testDirect(): start");
int v = fooDirect();
if ( v != 7 ) {
FAIL("fooDirect() returned %d vs expected 7", v);
}
LOG("testDirect(): end");
return 0;
}