Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: tests/pnacl_dynamic_loading/dependencies_test.c

Issue 1825893002: PNaCl Dynamic Linking: Added portable dependencies to shared objects. (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Use file basename as dependency, not absolute / relative path. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/pnacl_dynamic_loading/dependencies_test.c
diff --git a/tests/pnacl_dynamic_loading/dependencies_test.c b/tests/pnacl_dynamic_loading/dependencies_test.c
new file mode 100644
index 0000000000000000000000000000000000000000..56539a8ec8d1261046e80e8f17ebdde9f4f103fc
--- /dev/null
+++ b/tests/pnacl_dynamic_loading/dependencies_test.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2016 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <stdio.h>
+
+/*
+ * These functions would typically be declared in a shared header file, but for
+ * testing convenience, they are defined here.
+ */
+int get_module_a_var();
+int get_module_b_var();
+int get_module_c_var();
+
+/*
+ * The loader should only need to load "dependencies_test", and the dependencies
+ * should by loaded automatically by the pll_loader.
+ *
+ * | dependencies_test (depends on libc and test_pll_c)
+ * | libc
+ * * No dependencies
+ * | test_pll_c (depends on test_pll_a and test_pll_b)
+ * | test_pll_a
+ * * No dependencies
+ * | test_pll_b (depends on test_pll_a)
+ * | test_pll_a
+ * * No dependencies
+ */
+
+int main(int argc, char* argv[]) {
+ printf("%d\n", get_module_a_var());
Mark Seaborn 2016/03/30 23:24:57 I would be inclined to use ASSERT_EQ(get_module_a_
Mark Seaborn 2016/04/01 19:10:42 As you discovered, that currently doesn't work, be
Sean Klein 2016/04/01 23:12:25 Done.
+ printf("%d\n", get_module_b_var());
+ printf("%d\n", get_module_c_var());
+ return 0;
+}

Powered by Google App Engine
This is Rietveld 408576698