lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #include "tst-unique3.h" |
| 2 | |
| 3 | #include <cstdio> |
| 4 | #include "../dlfcn/dlfcn.h" |
| 5 | |
| 6 | int t = S<char>::i; |
| 7 | |
| 8 | int |
| 9 | main (void) |
| 10 | { |
| 11 | std::printf ("%d %d\n", S<char>::i, t); |
| 12 | int result = S<char>::i++ != 1 || t != 1; |
| 13 | result |= in_lib (); |
| 14 | void *d = dlopen ("$ORIGIN/tst-unique3lib2.so", RTLD_LAZY); |
| 15 | int (*fp) (); |
| 16 | if (d == NULL || (fp = (int(*)()) dlsym (d, "in_lib2")) == NULL) |
| 17 | { |
| 18 | std::printf ("failed to get symbol in_lib2\n"); |
| 19 | return 1; |
| 20 | } |
| 21 | result |= fp (); |
| 22 | dlclose (d); |
| 23 | return result; |
| 24 | } |