benchtests: Generate .d dependency files [BZ #28922]
[glibc.git] / elf / order2.c
blobbcf266d5b1c490008345bc55a07629962d6a96cf
1 #include <dlfcn.h>
2 #include <stdio.h>
5 int call_puts;
7 static int
8 do_test (void)
10 call_puts = 1;
12 void *h1 = dlopen ("$ORIGIN/order2mod1.so", RTLD_LAZY | RTLD_GLOBAL);
13 if (h1 == NULL)
15 puts ("cannot load order2mod1");
16 return 1;
18 void *h2 = dlopen ("$ORIGIN/order2mod2.so", RTLD_LAZY);
19 if (h2 == NULL)
21 puts ("cannot load order2mod2");
22 return 1;
24 if (dlclose (h1) != 0)
26 puts ("dlclose order2mod1 failed");
27 return 1;
29 if (dlclose (h2) != 0)
31 puts ("dlclose order2mod2 failed");
32 return 1;
34 return 0;
37 #include <support/test-driver.c>
39 static void
40 __attribute__ ((destructor))
41 fini (void)
43 if (call_puts)
44 puts ("5");