Print DBG() message about compiler weak hidden symbol behavior
[lttng-ust.git] / tests / gcc-weak-hidden / main.c
CommitLineData
5a673446
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
17char testsym[9] __attribute__((weak, visibility("hidden")));
18
19void *fct1(void);
20void *fctlib1(void);
21void *fctlib2(void);
22
23int 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}
This page took 0.023886 seconds and 4 git commands to generate.