1 2#include <stdio.h> // fprintf(), NULL 3#include <stdlib.h> // exit(), EXIT_SUCCESS 4#include <dlfcn.h> 5 6#include "test.h" // PASS(), FAIL(), XPASS(), XFAIL() 7 8 9 10extern int foo(); 11extern int bar(); 12extern int baz(); 13extern int frob(); 14 15int (*pfoo)() = &foo; 16int (*pbar)() = &bar; 17int (*pbaz)() = &baz; 18int (*pfrob)() = &frob; 19 20 21int main() 22{ 23 if ( foo() != 1 ) 24 FAIL("re-export-symbol-dylib: foo() returned wrong value"); 25 else if ( bar() != 2 ) 26 FAIL("re-export-symbol-dylib: bar() returned wrong value"); 27 else if ( baz() != 3 ) 28 FAIL("re-export-symbol-dylib: baz() returned wrong value"); 29 else if ( frob() != 4 ) 30 FAIL("re-export-symbol-dylib: frob() returned wrong value"); 31 32 else if ( (*pfoo)() != 1 ) 33 FAIL("re-export-symbol-dylib: (*pfoo)() returned wrong value"); 34 else if ( (*pbar)() != 2 ) 35 FAIL("re-export-symbol-dylib: (*pbar)() returned wrong value"); 36 else if ( (*pbaz)() != 3 ) 37 FAIL("re-export-symbol-dylib: (*pbaz)() returned wrong value"); 38 else if ( (*pfrob)() != 4 ) 39 FAIL("re-export-symbol-dylib: (*pfrob)() returned wrong value"); 40 else 41 PASS("re-export-symbol-dylib"); 42 return 0; 43} 44 45