]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/missing-weak-def.dtest/main.c
dyld-832.7.1.tar.gz
[apple/dyld.git] / testing / test-cases / missing-weak-def.dtest / main.c
1
2 // BUILD: $CC bar.c -dynamiclib -install_name $RUN_DIR/libbar.dylib -o $BUILD_DIR/missing/libbar.dylib
3 // BUILD: $CC bar-empty.c -dynamiclib -install_name $RUN_DIR/libbar.dylib -o $BUILD_DIR/libbar.dylib
4 // BUILD: $CC main.c $BUILD_DIR/missing/libbar.dylib -o $BUILD_DIR/missing-weak-def.exe
5
6 // BUILD: $SKIP_INSTALL $BUILD_DIR/missing/libbar.dylib
7
8 // RUN: ./missing-weak-def.exe
9
10 // bar is a weak_import weak bind and the libbar we have at runtime is missing that symbol
11
12
13 #include <stdio.h>
14 #include <stdlib.h>
15
16 #include "test_support.h"
17
18 __attribute__((weak_import))
19 int bar();
20
21 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
22 if (&bar) {
23 bar();
24 FAIL("bar from libbar not bound");
25 }
26
27 PASS("Success");
28 }
29