]> git.saurik.com Git - apple/dyld.git/blob - unit-tests/test-cases/re-export-symbol/main1.c
dyld-195.5.tar.gz
[apple/dyld.git] / unit-tests / test-cases / re-export-symbol / main1.c
1 #include <stdio.h> // fprintf(), NULL
2 #include <stdlib.h> // exit(), EXIT_SUCCESS
3 #include <dlfcn.h>
4
5 #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL()
6
7 extern int foo();
8 extern int bar();
9
10 int (*pbar)() = &bar;
11
12
13 int main()
14 {
15 if ( foo() != 10 )
16 FAIL("re-export-symbol: foo() returned wrong value");
17 if ( bar() != 10 )
18 FAIL("re-export-symbol: bar() returned wrong value");
19 if ( (*pbar)() != 10 )
20 FAIL("re-export-symbol: (*pbar)() returned wrong value");
21 PASS("re-export-symbol");
22 return 0;
23 }