posix: Fix posix_spawn implict check style
[glibc.git] / elf / tst-nodelete.cc
blob176cb6883675f9c163d1e4848153fac3b35f8596
1 #include "../dlfcn/dlfcn.h"
2 #include <stdio.h>
3 #include <stdlib.h>
5 static int
6 do_test (void)
8 int result = 0;
10 /* This is a test for correct handling of dlopen failures for library that
11 is loaded with RTLD_NODELETE flag. The first dlopen should fail because
12 of undefined symbols in shared library. The second dlopen then verifies
13 that library was properly unloaded. */
14 if (dlopen ("tst-nodelete-rtldmod.so", RTLD_NOW | RTLD_NODELETE) != NULL
15 || dlopen ("tst-nodelete-rtldmod.so", RTLD_LAZY | RTLD_NOLOAD) != NULL)
17 printf ("RTLD_NODELETE test failed\n");
18 result = 1;
21 /* This is a test for correct handling of dlopen failures for library that
22 is linked with '-z nodelete' option and hence has DF_1_NODELETE flag.
23 The first dlopen should fail because of undefined symbols in shared
24 library. The second dlopen then verifies that library was properly
25 unloaded. */
26 if (dlopen ("tst-nodelete-zmod.so", RTLD_NOW) != NULL
27 || dlopen ("tst-nodelete-zmod.so", RTLD_LAZY | RTLD_NOLOAD) != NULL)
29 printf ("-z nodelete test failed\n");
30 result = 1;
33 /* This is a test for correct handling of dlopen failures for library
34 with unique symbols. The first dlopen should fail because of undefined
35 symbols in shared library. The second dlopen then verifies that library
36 was properly unloaded. */
37 if (dlopen ("tst-nodelete-uniquemod.so", RTLD_NOW) != NULL
38 || dlopen ("tst-nodelete-uniquemod.so", RTLD_LAZY | RTLD_NOLOAD) != NULL)
40 printf ("Unique symbols test failed\n");
41 result = 1;
44 if (result == 0)
45 printf ("SUCCESS\n");
47 return result;
50 #define TEST_FUNCTION do_test ()
51 #include "../test-skeleton.c"