1 /* This is the main program for the shared library test. */
9 extern int shlib_mainvar ();
10 extern int shlib_overriddenvar ();
11 extern int shlib_shlibvar1 ();
12 extern int shlib_shlibvar2 ();
13 extern int shlib_shlibcall ();
14 extern int shlib_maincall ();
15 extern int shlib_checkfunptr1 ();
16 extern int shlib_checkfunptr2 ();
17 extern int (*shlib_getfunptr1 ()) ();
18 extern int (*shlib_getfunptr2 ()) ();
19 extern int shlib_check ();
20 extern int shlib_shlibcall2 ();
22 /* This function is called by the shared library. */
30 /* This function overrides a function in the shared library. */
33 shlib_overriddencall2 ()
41 printf ("mainvar == %d\n", mainvar
);
42 printf ("overriddenvar == %d\n", overriddenvar
);
43 printf ("shlibvar1 == %d\n", shlibvar1
);
45 printf ("shlib_mainvar () == %d\n", shlib_mainvar ());
46 printf ("shlib_overriddenvar () == %d\n", shlib_overriddenvar ());
48 printf ("shlib_shlibvar1 () == %d\n", shlib_shlibvar1 ());
49 printf ("shlib_shlibvar2 () == %d\n", shlib_shlibvar2 ());
50 printf ("shlib_shlibcall () == %d\n", shlib_shlibcall ());
52 printf ("shlib_shlibcall2 () == %d\n", shlib_shlibcall2 ());
53 printf ("shlib_maincall () == %d\n", shlib_maincall ());
55 printf ("main_called () == %d\n", main_called ());
57 printf ("shlib_checkfunptr1 (shlib_shlibvar1) == %d\n",
58 shlib_checkfunptr1 (shlib_shlibvar1
));
60 printf ("shlib_checkfunptr2 (main_called) == %d\n",
61 shlib_checkfunptr2 (main_called
));
66 p
= shlib_getfunptr1 ();
67 printf ("shlib_getfunptr1 () ");
68 if (p
== shlib_shlibvar1
)
72 printf (" shlib_shlibvar1\n");
78 p
= shlib_getfunptr2 ();
79 printf ("shlib_getfunptr2 () ");
84 printf (" main_called\n");
88 printf ("shlib_check () == %d\n", shlib_check ());