]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/missing-weak-def.dtest/main.c
dyld-750.5.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 $BUILD_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))
19 __attribute__((weak_import))
20 int bar();
21
22 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
23 if (&bar) {
24 FAIL("bar from libbar not bound");
25 }
26
27 PASS("Success");
28 }
29