]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/weak-dylib-re-export.dtest/main.c
dyld-832.7.1.tar.gz
[apple/dyld.git] / testing / test-cases / weak-dylib-re-export.dtest / main.c
1
2
3 // BUILD: $CC bar.c -dynamiclib -o $BUILD_DIR/libbar.dylib -install_name $RUN_DIR/libbar.dylib
4 // BUILD: $CC foo.c -dynamiclib -L$BUILD_DIR -weak-lbar -Wl,-reexported_symbols_list,$SRC_DIR/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 // BUILD: $SKIP_INSTALL $BUILD_DIR/libbar.dylib
8
9 // RUN: ./dylib-re-export.exe
10
11
12 #include <stdio.h>
13
14 #include "test_support.h"
15
16 __attribute__((weak_import))
17 extern int bar();
18
19 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
20 if ( &bar == 0 )
21 PASS("SUCCESS");
22 else
23 FAIL("wrong value");
24
25 return 0;
26 }
27
28