Commit | Line | Data |
---|---|---|
73de71c3 MD |
1 | /* |
2 | * Copyright (C) 2016 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
3 | * | |
4 | * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED | |
5 | * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. | |
6 | * | |
7 | * Permission is hereby granted to use or copy this program for any | |
8 | * purpose, provided the above notices are retained on all copies. | |
9 | * Permission to modify the code and to distribute modified code is | |
10 | * granted, provided the above notices are retained, and a notice that | |
11 | * the code was modified is included with the above copyright notice. | |
12 | */ | |
13 | #include "tap.h" | |
14 | ||
15 | #define NUM_TESTS 2 | |
16 | ||
17 | char testsym[9] __attribute__((weak, visibility("hidden"))); | |
18 | ||
19 | void *fct1(void); | |
20 | void *fctlib1(void); | |
21 | void *fctlib2(void); | |
22 | ||
23 | int main() | |
24 | { | |
25 | plan_tests(NUM_TESTS); | |
26 | ok(fct1() == testsym, | |
27 | "Address of weak symbol with hidden visibility match between compile units within same module for main program"); | |
28 | ok(fctlib1() == fctlib2(), | |
29 | "Address of weak symbol with hidden visibility match between compile units within same module for shared library"); | |
30 | return 0; | |
31 | } |