1 /* For use by jit-verify-dynamic-library, used by
2 test-compile-to-dynamic-library.c. */
8 main (int argc
, char **argv
)
11 void (*hello_world
) (const char *name
);
14 handle
= dlopen ("./output-of-test-compile-to-dynamic-library.c.so",
15 RTLD_NOW
| RTLD_LOCAL
);
18 fprintf (stderr
, "dlopen failed: %s\n", dlerror());
22 /* Clear any existing error */
25 /* This symbol is from the DSO built by
26 test-compile-to-dynamic-library.c. */
27 *(void **) (&hello_world
) = dlsym (handle
, "hello_world");
29 if ((error
= dlerror()) != NULL
)
31 fprintf (stderr
, "dlsym failed: %s\n", error
);
35 /* Call the function from the generated DSO. */
36 hello_world (argv
[0]);