]> git.ipfire.org Git - thirdparty/glibc.git/blame - dlfcn/bug-atexit1.c
[BZ #4775, BZ #4776]
[thirdparty/glibc.git] / dlfcn / bug-atexit1.c
CommitLineData
7237d704
UD
1/* Derived from a test case in
2 http://sourceware.org/bugzilla/show_bug.cgi?id=1158. */
3#include <dlfcn.h>
4#include <stdio.h>
5#include <stdlib.h>
6
7static int
8do_test (void)
9{
10 for (int i = 0; i < 2; ++i)
11 {
12 void *dso = dlopen ("$ORIGIN/bug-atexit1-lib.so", RTLD_NOW);
0317eaec 13 void (*fn) (void) = (void (*) (void)) dlsym (dso, "foo");
7237d704
UD
14 fn ();
15 dlclose (dso);
16 puts ("round done");
17 }
18
19 return 0;
20}
21
22#define TEST_FUNCTION do_test ()
23#include "../test-skeleton.c"