X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=tests%2Fgcc-weak-hidden%2Fmain.c;fp=tests%2Fgcc-weak-hidden%2Fmain.c;h=a2f31756f41560db3d1783ffdb5c94586252ed67;hb=5a67344622044d35ae424565e03aec25221cae58;hp=0000000000000000000000000000000000000000;hpb=cad6b749231be8c91fcfd3616934032b5dfd3614;p=lttng-ust.git diff --git a/tests/gcc-weak-hidden/main.c b/tests/gcc-weak-hidden/main.c new file mode 100644 index 00000000..a2f31756 --- /dev/null +++ b/tests/gcc-weak-hidden/main.c @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2016 - Mathieu Desnoyers + * + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED + * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * + * Permission is hereby granted to use or copy this program for any + * purpose, provided the above notices are retained on all copies. + * Permission to modify the code and to distribute modified code is + * granted, provided the above notices are retained, and a notice that + * the code was modified is included with the above copyright notice. + */ +#include "tap.h" + +#define NUM_TESTS 2 + +char testsym[9] __attribute__((weak, visibility("hidden"))); + +void *fct1(void); +void *fctlib1(void); +void *fctlib2(void); + +int main() +{ + plan_tests(NUM_TESTS); + ok(fct1() == testsym, + "Address of weak symbol with hidden visibility match between compile units within same module for main program"); + ok(fctlib1() == fctlib2(), + "Address of weak symbol with hidden visibility match between compile units within same module for shared library"); + return 0; +}