]> git.saurik.com Git - apple/dyld.git/blobdiff - testing/test-cases/rpath-relative.dtest/main.c
dyld-750.5.tar.gz
[apple/dyld.git] / testing / test-cases / rpath-relative.dtest / main.c
diff --git a/testing/test-cases/rpath-relative.dtest/main.c b/testing/test-cases/rpath-relative.dtest/main.c
new file mode 100644 (file)
index 0000000..2779b7b
--- /dev/null
@@ -0,0 +1,29 @@
+
+// BOOT_ARGS: dyld_flags=2
+
+// BUILD:  $CC foo.c -dynamiclib -o $BUILD_DIR/librel.dylib -install_name @rpath/librel.dylib
+// BUILD:  $CC main.c $BUILD_DIR/librel.dylib -o $BUILD_DIR/rpath-executable.exe       -rpath @executable_path
+// BUILD:  $CC main.c $BUILD_DIR/librel.dylib -o $BUILD_DIR/rpath-executable-slash.exe -rpath @executable_path/
+// BUILD:  $CC main.c $BUILD_DIR/librel.dylib -o $BUILD_DIR/rpath-loader.exe           -rpath @loader_path
+// BUILD:  $CC main.c $BUILD_DIR/librel.dylib -o $BUILD_DIR/rpath-loader-slash.exe     -rpath @loader_path/
+
+// RUN: ./rpath-executable.exe
+// RUN: ./rpath-executable-slash.exe
+// RUN: ./rpath-loader.exe
+// RUN: ./rpath-loader-slash.exe
+
+// main prog links with librel.dylib.  There are four variants of how LC_RPATH is set up.
+
+#include <stdio.h>
+
+#include "test_support.h"
+
+extern char* __progname;
+
+
+int main(int argc, const char* argv[])
+{
+    PASS("%s", __progname);
+}
+
+