blob: dcff28dafa67568a6c610ec0e880f63b1e308532 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#include <stdio.h>
2#include <dlfcn.h>
3#include <mcheck.h>
4#include <stdlib.h>
5
6static int
7do_test (void)
8{
9 mtrace ();
10
11 int ret = 0;
12 for (int i = 0; i < 10; i++)
13 {
14 void *h = dlopen (i < 5 ? "./tst-leaks1.c"
15 : "$ORIGIN/tst-leaks1.o", RTLD_LAZY);
16 if (h != NULL)
17 {
18 puts ("dlopen unexpectedly succeeded");
19 ret = 1;
20 dlclose (h);
21 }
22 }
23
24 return ret;
25}
26
27#define TEST_FUNCTION do_test ()
28#include "../test-skeleton.c"