dyld-750.5.tar.gz
[apple/dyld.git] / testing / test-cases / weak-def-bind-old-format.dtest / main.c
1 // BUILD_ONLY: MacOSX
2 // BUILD_MIN_OS: 10.5
3 // BUILD: $CC bar.c -dynamiclib -install_name $RUN_DIR/libbar.dylib -o $BUILD_DIR/libbar.dylib
4 // BUILD: $CC foo.c -dynamiclib $BUILD_DIR/libbar.dylib -install_name $RUN_DIR/libfoo.dylib -o $BUILD_DIR/libfoo.dylib
5 // BUILD: $CC main.c -o $BUILD_DIR/weak-def-bind-old-format.exe $BUILD_DIR/libfoo.dylib $BUILD_DIR/libbar.dylib -L$BUILD_DIR
6
7 // RUN: ./weak-def-bind-old-format.exe
8
9
10 #include <stdio.h>
11
12 #include "test_support.h"
13
14 extern int foo();
15 extern int bar();
16
17
18 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
19 if ( foo() != 42 ) {
20 FAIL("weak-def-bind-old-format, wrong value");
21 }
22 if ( bar() != 42 ) {
23 FAIL("weak-def-bind-old-format, wrong value");
24 }
25
26 PASS("weak-def-bind-old-format");
27 }
28
29