Index: tests/pnacl_dynamic_loading/test_pso.c |
diff --git a/tests/pnacl_dynamic_loading/test_pso.c b/tests/pnacl_dynamic_loading/test_pso.c |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ad4d5c1e5749f53a30e55dd6884ea3b27933e1c8 |
--- /dev/null |
+++ b/tests/pnacl_dynamic_loading/test_pso.c |
@@ -0,0 +1,26 @@ |
+/* |
+ * Copyright (c) 2014 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. |
+ */ |
+ |
+static int var = 2345; |
+ |
+static int example_func(int *ptr) { |
+ return *ptr + 1234; |
+} |
+ |
+static int *get_var(void) { |
+ /* Test use of -fPIC by getting an address. */ |
+ return &var; |
+} |
+ |
+struct pso_root { |
+ int (*example_func)(int *ptr); |
+ int *(*get_var)(void); |
+}; |
+ |
+struct pso_root __pnacl_pso_root = { |
+ example_func, |
+ get_var, |
+}; |