Fix PR78333

Message ID CAKdteOZVB18A-Mn3e=rnyH6jvn=iJiXeB--i8KrX4MygDtyp6g@mail.gmail.com
State New
Headers show

Commit Message

Christophe Lyon Nov. 17, 2016, 4:19 p.m.
On 17 November 2016 at 11:27, Christophe Lyon
<christophe.lyon@linaro.org> wrote:
> On 17 November 2016 at 10:53, Richard Biener <rguenther@suse.de> wrote:

>> On Thu, 17 Nov 2016, Rainer Orth wrote:

>>

>>> Hi Richard,

>>>

>>> >> Probably providing dummy implemenations as in the original testcase in

>>> >> the PR is enough?

>>> >

>>> > Maybe { dg-require weak } plus weak definitions of the cyg_profile funcs?

>>> > Or simply restrict the test to { target *-*-linux* }?

>>>

>>> the only existing dg-do run testcase (gcc.dg/20001117-1.c) just has

>>>

>>> void __attribute__((no_instrument_function))

>>> __cyg_profile_func_enter(void *this_fn, void *call_site)

>>> {

>>>   if (call_site == (void *)0)

>>>     abort ();

>>> }

>>>

>>> void __attribute__((no_instrument_function))

>>> __cyg_profile_func_exit(void *this_fn, void *call_site)

>>> {

>>>   if (call_site == (void *)0)

>>>     abort ();

>>> }

>>>

>>> In the case at hand, we could do with empty implementations.  This

>>> certainly works on Solaris.

>>

>> Ok.  Christophe, can you add the above and verify it works for you

>> (and then commit)?

>>

> OK, I'm taking a look.

>


I tested and committed (r242553) the attached patch (on arm-none-eabi and
arm-none-linux-gnueabihf). I used empty function as suggested by Rainer.

Thanks,

Christophe

>> Thanks,

>> Richard.
Fix PR78333 testcase for non-glibc systems.

2016-11-17  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/testsuite/

	* gcc.dg/pr78333.c: Add empty implementations of
	__cyg_profile_func_enter() and __cyg_profile_func_exit() to avoid
	problems on non-glibc systems.

Patch hide | download patch | download mbox

diff --git a/gcc/testsuite/gcc.dg/pr78333.c b/gcc/testsuite/gcc.dg/pr78333.c
index fd3669c..ca037e5 100644
--- a/gcc/testsuite/gcc.dg/pr78333.c
+++ b/gcc/testsuite/gcc.dg/pr78333.c
@@ -1,6 +1,19 @@ 
 /* { dg-do link } */
 /* { dg-options "-finstrument-functions" } */
 
+/* Add empty implementations of __cyg_profile_func_enter() and
+   __cyg_profile_func_exit() to avoid problems on non-glibc
+   systems.  */
+void __attribute__((no_instrument_function))
+__cyg_profile_func_enter(void *this_fn, void *call_site)
+{
+}
+
+void __attribute__((no_instrument_function))
+__cyg_profile_func_exit(void *this_fn, void *call_site)
+{
+}
+
 extern inline __attribute__((gnu_inline, always_inline)) int foo () { }
 int main()
 {