bug-atexit1.c 492 B

1234567891011121314151617181920212223
  1. /* Derived from a test case in
  2. https://sourceware.org/bugzilla/show_bug.cgi?id=1158. */
  3. #include <dlfcn.h>
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. static int
  7. do_test (void)
  8. {
  9. for (int i = 0; i < 2; ++i)
  10. {
  11. void *dso = dlopen ("$ORIGIN/bug-atexit1-lib.so", RTLD_NOW);
  12. void (*fn) (void) = (void (*) (void)) dlsym (dso, "foo");
  13. fn ();
  14. dlclose (dso);
  15. puts ("round done");
  16. }
  17. return 0;
  18. }
  19. #define TEST_FUNCTION do_test ()
  20. #include "../test-skeleton.c"