]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/weak-dylib-re-export.dtest/main.c
7b9b7e67efd1942848a536e6d282bc1933b5cbeb
[apple/dyld.git] / testing / test-cases / weak-dylib-re-export.dtest / main.c
1
2
3 // BUILD: $CC bar.c -dynamiclib -o $TEMP_DIR/libbar.dylib -install_name $RUN_DIR/libbar.dylib
4 // BUILD: $CC foo.c -dynamiclib -L$TEMP_DIR -weak-lbar -Wl,-reexported_symbols_list,symbols.txt -install_name $RUN_DIR/libfoo.dylib -o $BUILD_DIR/libfoo.dylib
5 // BUILD: $CC main.c -o $BUILD_DIR/dylib-re-export.exe $BUILD_DIR/libfoo.dylib -L$BUILD_DIR
6
7 // RUN: ./dylib-re-export.exe
8
9
10 #include <stdio.h>
11
12 __attribute__((weak_import))
13 extern int bar();
14
15 int main()
16 {
17 printf("[BEGIN] dylib-re-export\n");
18 if ( &bar == 0 )
19 printf("[PASS] dylib-re-export\n");
20 else
21 printf("[FAIL] dylib-re-export, wrong value\n");
22
23 return 0;
24 }
25
26