tests/benchmark/bench2
tests/ctf-types/ctf-types
tests/test-app-ctx/hello
+tests/gcc-weak-hidden/test-gcc-wh
+tests/gcc-weak-hidden/test_gcc_weak_hidden
# Java agent library
*.class
tests/benchmark/Makefile
tests/utils/Makefile
tests/test-app-ctx/Makefile
+ tests/gcc-weak-hidden/Makefile
lttng-ust.pc
])
SUBDIRS = utils hello same_line_tracepoint snprintf benchmark ust-elf \
- ctf-types test-app-ctx
+ ctf-types test-app-ctx gcc-weak-hidden
if CXX_WORKS
SUBDIRS += hello.cxx
$(top_srcdir)/config/tap-driver.sh
TESTS = snprintf/test_snprintf \
- ust-elf/test_ust_elf
+ ust-elf/test_ust_elf \
+ gcc-weak-hidden/test_gcc_weak_hidden
check-loop:
while [ 0 ]; do \
--- /dev/null
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/tests/utils
+
+noinst_LTLIBRARIES = libgcc-wh.la
+libgcc_wh_la_SOURCES = c.c d.c
+
+noinst_PROGRAMS = test-gcc-wh
+test_gcc_wh_SOURCES = main.c b.c
+test_gcc_wh_LDADD = $(top_builddir)/tests/utils/libtap.a \
+ $(builddir)/libgcc-wh.la
+
+noinst_SCRIPTS = test_gcc_weak_hidden
+CLEANFILES = $(noinst_SCRIPTS)
+EXTRA_DIST = test_gcc_weak_hidden.in
+
+$(noinst_SCRIPTS): %: %.in
+ sed "s#@ABSTOPSRCDIR@#$(abs_top_srcdir)#g" < $< > $@
+ chmod +x $@
--- /dev/null
+char testsym[9] __attribute__((weak, visibility("hidden")));
+
+void *fct1(void)
+{
+ return testsym;
+}
--- /dev/null
+char testsym[9] __attribute__((weak, visibility("hidden")));
+
+void *fctlib1(void)
+{
+ return testsym;
+}
--- /dev/null
+char testsym[9] __attribute__((weak, visibility("hidden")));
+
+void *fctlib2(void)
+{
+ return testsym;
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * 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;
+}
--- /dev/null
+#!/bin/bash
+
+TEST_DIR=$(dirname $0)
+./${TEST_DIR}/test-gcc-wh