1
2#include <stdio.h>
3#include "valgrind.h"
4
5/* The simplest possible wrapping test: just call a wrapped function
6   and check we run the wrapper instead.  Except: the wrapped
7   function is in a different shared object.  This causes some
8   additional complications on ppc64-linux, hence another test. */
9
10extern void actual ( void );
11
12/* The wrapper.  The function being wrapped is in a .so with soname
13   "wrap7so.so". */
14void I_WRAP_SONAME_FNNAME_ZU(wrap7soZdso,actual) ( void )
15{
16   OrigFn fn;
17   VALGRIND_GET_ORIG_FN(fn);
18   printf("wrapper-pre\n");
19   CALL_FN_v_v(fn);
20   printf("wrapper-post\n");
21}
22
23/* --------------- */
24
25int main ( void )
26{
27   printf("starting\n");
28   actual();
29   return 0;
30}
31