tst-tls17.c 499 B

1234567891011121314151617181920212223242526272829
  1. #include <dlfcn.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. static int
  5. do_test (void)
  6. {
  7. void *h = dlopen ("tst-tlsmod17b.so", RTLD_LAZY);
  8. if (h == NULL)
  9. {
  10. puts ("unexpectedly failed to open tst-tlsmod17b.so");
  11. exit (1);
  12. }
  13. int (*fp) (void) = (int (*) (void)) dlsym (h, "tlsmod17b");
  14. if (fp == NULL)
  15. {
  16. puts ("cannot find tlsmod17b");
  17. exit (1);
  18. }
  19. if (fp ())
  20. exit (1);
  21. return 0;
  22. }
  23. #define TEST_FUNCTION do_test ()
  24. #include "../test-skeleton.c"