]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/flat-namespace-absolute-symbol.dtest/main.c
dyld-551.4.tar.gz
[apple/dyld.git] / testing / test-cases / flat-namespace-absolute-symbol.dtest / main.c
1 // BUILD_ONLY: MacOSX
2
3 // BUILD: $CC foo.s -dynamiclib -o $BUILD_DIR/libfoo.dylib -install_name $RUN_DIR/libfoo.dylib
4 // BUILD: $CC main.c $BUILD_DIR/libfoo.dylib -o $BUILD_DIR/flat-namespace.exe -flat_namespace
5
6 // RUN: ./flat-namespace.exe
7
8
9
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <string.h>
13
14 extern int myAbs1;
15 int* ptr = &myAbs1;
16
17 int main()
18 {
19 printf("[BEGIN] flat-namespace-absolute-symbol\n");
20
21 if ( ptr != 0 ) {
22 printf("[FAIL] absolute symbol not bound to zero with flat lookup\n");
23 return 0;
24 }
25
26 printf("[PASS] flat-namespace-absolute-symbol\n");
27 return 0;
28 }