]> git.saurik.com Git - apple/dyld.git/blob - unit-tests/test-cases/re-export-symbol/main2.c
dyld-851.27.tar.gz
[apple/dyld.git] / unit-tests / test-cases / re-export-symbol / main2.c
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
10 extern int foo();
11 extern int mybar();
12
13 int (*pmybar)() = &mybar;
14
15 int main()
16 {
17 if ( foo() != 10 )
18 FAIL("re-export-symbol: foo() returned wrong value");
19 if ( mybar() != 10 )
20 FAIL("re-export-symbol: mybar() returned wrong value");
21 if ( (*pmybar)() != 10 )
22 FAIL("re-export-symbol: (*pmybar)() returned wrong value");
23 PASS("re-export-symbol");
24 return 0;
25 }
26