This is the mail archive of the
mailing list for the GCC project.
RE: [Testsuite] getpid in gcc.c-torture/execute/pr58419.c
- From: "Dhakshinamoorthy, Soundararajan" <Soundararajan dot Dhakshinamoorthy at atmel dot com>
- To: Jeff Law <law at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 25 Apr 2014 09:16:00 +0000
- Subject: RE: [Testsuite] getpid in gcc.c-torture/execute/pr58419.c
- Authentication-results: sourceware.org; auth=none
- References: <54196F45A68D5F44A17DBFF39883E26F84DE25B2 at penmbx02 dot corp dot atmel dot com>,<5357EA80 dot 1090900 at redhat dot com>
I have attached a patch based on the recommendation. Can you please review and apply, if it looks ok ?. I don't have commit access.
2014-04-25 Soundararajan Dhakshinamoorthy <email@example.com>
* gcc.c-torture/execute/pr58419.c: Adjust the test to work with bare metal targets. The
test code references to functions that is not implemented for the avr target (getpid()).
From: Jeff Law [firstname.lastname@example.org]
Sent: 23 April 2014 21:59:52
To: Dhakshinamoorthy, Soundararajan; email@example.com
Subject: Re: [Testsuite] getpid in gcc.c-torture/execute/pr58419.c
On 04/23/14 05:50, Dhakshinamoorthy, Soundararajan wrote:
> Hi all,
> The test mentioned in the link had a call to getpid which causes the test to fail for bare metal targets. Is it ok to replace it with
> printf("\0") ?
> which seems to be the first version of the test.
You want to avoid the printf. Instead I think a dummy function that is
marked as noinline should be sufficient -- I just haven't had the time
to verify that myself.
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr58419.c b/gcc/testsuite/gcc.c-torture/execute/pr58419.c
index 69cc040..78bf437 100644
@@ -1,4 +1,9 @@
-int printf(const char *, ...);
+ asm volatile("");
int a, g, i, k, *p;
signed char b;
@@ -31,6 +36,6 @@ main ()
*l = a;
g = foo (*m = k && *d, 1 > i) || bar ();