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 ()
43 printf ("mainvar == %d\n", mainvar
);
44 printf ("overriddenvar == %d\n", overriddenvar
);
45 printf ("shlibvar1 == %d\n", shlibvar1
);
47 printf ("shlib_mainvar () == %d\n", shlib_mainvar ());
48 printf ("shlib_overriddenvar () == %d\n", shlib_overriddenvar ());
50 printf ("shlib_shlibvar1 () == %d\n", shlib_shlibvar1 ());
51 printf ("shlib_shlibvar2 () == %d\n", shlib_shlibvar2 ());
52 printf ("shlib_shlibcall () == %d\n", shlib_shlibcall ());
54 printf ("shlib_shlibcall2 () == %d\n", shlib_shlibcall2 ());
55 printf ("shlib_maincall () == %d\n", shlib_maincall ());
57 printf ("main_called () == %d\n", main_called ());
59 printf ("shlib_checkfunptr1 (shlib_shlibvar1) == %d\n",
60 shlib_checkfunptr1 (shlib_shlibvar1
));
62 printf ("shlib_checkfunptr2 (main_called) == %d\n",
63 shlib_checkfunptr2 (main_called
));
65 p
= shlib_getfunptr1 ();
66 printf ("shlib_getfunptr1 () ");
67 if (p
== shlib_shlibvar1
)
71 printf (" shlib_shlibvar1\n");
73 p
= shlib_getfunptr2 ();
74 printf ("shlib_getfunptr2 () ");
79 printf (" main_called\n");
82 printf ("shlib_check () == %d\n", shlib_check ());