]> git.saurik.com Git - apple/dyld.git/blobdiff - testing/test-cases/dylib-static-link.dtest/main.c
dyld-750.5.tar.gz
[apple/dyld.git] / testing / test-cases / dylib-static-link.dtest / main.c
diff --git a/testing/test-cases/dylib-static-link.dtest/main.c b/testing/test-cases/dylib-static-link.dtest/main.c
new file mode 100644 (file)
index 0000000..6dd84b6
--- /dev/null
@@ -0,0 +1,23 @@
+
+
+// BUILD:  $CC foo.c -dynamiclib -o $BUILD_DIR/libfoo.dylib -install_name $RUN_DIR/libfoo.dylib
+// BUILD:  $CC main.c $BUILD_DIR/libfoo.dylib -o $BUILD_DIR/dylib-static-link.exe
+
+// RUN:  ./dylib-static-link.exe
+
+
+#include <stdio.h>
+
+#include "test_support.h"
+
+extern int foo;
+
+
+int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
+    if ( foo == 42 )
+        PASS("Success");
+    else
+        FAIL("Wrong value");
+}
+
+