blob: 2c2df251b37c228d533e6e10e3693feeb70d86de [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#include <dlfcn.h>
2#include <stdio.h>
3#include <stdlib.h>
4
5static int
6do_test (void)
7{
8 void *h = dlopen ("tst-tlsmod15a.so", RTLD_NOW);
9 if (h != NULL)
10 {
11 puts ("unexpectedly succeeded to open tst-tlsmod15a.so");
12 exit (1);
13 }
14
15 h = dlopen ("tst-tlsmod15b.so", RTLD_NOW);
16 if (h == NULL)
17 {
18 puts ("failed to open tst-tlsmod15b.so");
19 exit (1);
20 }
21
22 int (*fp) (void) = (int (*) (void)) dlsym (h, "in_dso");
23 if (fp == NULL)
24 {
25 puts ("cannot find in_dso");
26 exit (1);
27 }
28
29 return fp ();
30}
31
32#define TEST_FUNCTION do_test ()
33#include "../test-skeleton.c"