2 // { dg-do run { target { dlopen && disable-for-4.9 } } }
3 // { dg-add-options dlopen }
4 // { dg-build-dso "dlclose1-dso.cc" }
7 extern "C" void abort();
8 extern "C" int printf (const char *, ...);
10 // Open and close the DSO for each call so that statics are reinitialized.
13 void *h = dlopen ("./dlclose1-dso.so", RTLD_NOW);
14 if (!h) { printf ("dlopen failed: %s\n", dlerror()); abort(); }
15 int (*fn)() = (int(*)())dlsym (h, "fn");
16 if (!fn) { printf ("dlsym failed: %s\n", dlerror()); abort(); }
27 printf ("mismatch: %d != %d\n", i, j);