]> git.ipfire.org Git - thirdparty/glibc.git/blame - elf/tst-unique3.cc
sem_close: Use __twalk_r
[thirdparty/glibc.git] / elf / tst-unique3.cc
CommitLineData
028478fa 1#include "tst-unique3.h"
28926a1b 2
028478fa
UD
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}