blob: efdd6d78c2cc016085263912c5f786b402ac6139 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#include "tst-unique3.h"
2
3#include <cstdio>
4#include "../dlfcn/dlfcn.h"
5
6int t = S<char>::i;
7
8int
9main (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}