Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / pnacl_dynamic_loading / test_pso.c
1 /*
2  * Copyright (c) 2014 The Native Client Authors. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the LICENSE file.
5  */
6
7 static int var = 2345;
8
9 static int example_func(int *ptr) {
10   return *ptr + 1234;
11 }
12
13 static int *get_var(void) {
14   /* Test use of -fPIC by getting an address. */
15   return &var;
16 }
17
18 struct pso_root {
19   int (*example_func)(int *ptr);
20   int *(*get_var)(void);
21 };
22
23 struct pso_root __pnacl_pso_root = {
24   example_func,
25   get_var,
26 };