]> git.saurik.com Git - apple/dyld.git/blob - unit-tests/test-cases/absolute-symbol/main.c
dyld-360.19.tar.gz
[apple/dyld.git] / unit-tests / test-cases / absolute-symbol / main.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
8 extern int var;
9 extern void func();
10 extern int myAbs1 __attribute__((weak_import));
11 extern int myAbs2;
12
13
14 int main()
15 {
16
17 if (&myAbs1 != 0 ) {
18 FAIL("absolute-symbol: &myAbs1 != 0");
19 return 0;
20 }
21
22
23 if ((uintptr_t)&myAbs2 != 1 ) {
24 FAIL("absolute-symbol: &myAbs2 != 1");
25 return 0;
26 }
27
28
29 PASS("absolute-symbol");
30 return 0;
31 }