2 // BUILD: $CC foo.c foo2.c -dynamiclib -install_name $RUN_DIR/libfoo.dylib -o $BUILD_DIR/libfoo.dylib
3 // BUILD: $CC main.c $BUILD_DIR/libfoo.dylib -o $BUILD_DIR/symbol-resolver.exe
5 // RUN: ./symbol-resolver.exe
6 // RUN: TEN=1 ./symbol-resolver.exe
13 extern int fooPlusOne();
18 if ( getenv("TEN") != NULL
) {
20 printf("[FAIL] symbol-resolver-basic: foo() != 10\n");
21 else if ( fooPlusOne() != 11 )
22 printf("[FAIL] symbol-resolver-basic: fooPlusOne() != 11\n");
24 printf("[PASS] symbol-resolver-basic\n");
28 printf("[FAIL] symbol-resolver-basic: foo() != 0\n");
29 else if ( fooPlusOne() != 1 )
30 printf("[FAIL] symbol-resolver-basic: fooPlusOne() != 1\n");
32 printf("[PASS] symbol-resolver-basic\n");