blob: cbb4e50f7d26e063d26b2232d4c45590b957ac1d [file] [log] [blame]
sewardj134d1aa2006-01-20 14:21:28 +00001
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{
sewardj5a6d7e42006-01-20 16:47:20 +000016 OrigFn fn;
17 VALGRIND_GET_ORIG_FN(fn);
sewardj134d1aa2006-01-20 14:21:28 +000018 printf("wrapper-pre\n");
sewardj5a6d7e42006-01-20 16:47:20 +000019 CALL_FN_v_v(fn);
sewardj134d1aa2006-01-20 14:21:28 +000020 printf("wrapper-post\n");
21}
22
23/* --------------- */
24
25int main ( void )
26{
27 printf("starting\n");
28 actual();
29 return 0;
30}