Fix a typo in linux lxstat.c
[glibc.git] / dlfcn / tststatic.c
blob3d6551389eb306c32dacb4d66f05ca6cd5eac072
1 #include <dlfcn.h>
2 #include <stdio.h>
3 #include <stdlib.h>
5 static int
6 do_test (void)
8 void *handle;
9 int (*test) (int);
10 int res;
12 handle = dlopen ("modstatic.so", RTLD_LAZY);
13 if (handle == NULL)
15 printf ("%s\n", dlerror ());
16 exit(1);
19 test = dlsym (handle, "test");
20 if (test == NULL)
22 printf ("%s\n", dlerror ());
23 exit(1);
26 res = test (2);
27 if (res != 4)
29 printf ("Got %i, expected 4\n", res);
30 exit (1);
33 dlclose (handle);
34 return 0;
37 #define TEST_FUNCTION do_test ()
38 #include "../test-skeleton.c"