Patchwork [testsuite] Fix gcc.c-torture/execute/20101011-1.c

login
register
mail settings
Submitter Pat Haugen
Date Oct. 28, 2010, 9:37 p.m.
Message ID <4CC9ECFF.8020208@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/69500/
State New
Headers show

Comments

Pat Haugen - Oct. 28, 2010, 9:37 p.m.
Committed the following as obvious after noticing failure on PowerPC.

testsuite/ChangeLog

2010-10-29  Pat Haugen <pthaugen@us.ibm.com>
         * gcc.c-torture/execute/20101011-1.c: Fix #ifdef.
Gerald Pfeifer - Oct. 31, 2010, 7:43 p.m.
On Thu, 28 Oct 2010, Pat Haugen wrote:
> 2010-10-29  Pat Haugen <pthaugen@us.ibm.com>
>         * gcc.c-torture/execute/20101011-1.c: Fix #ifdef.
> 
> 
> Index: gcc.c-torture/execute/20101011-1.c
> ===================================================================
> --- gcc.c-torture/execute/20101011-1.c  (revision 166039)
> +++ gcc.c-torture/execute/20101011-1.c  (working copy)
> @@ -35,7 +35,7 @@ int k;
>  int
>  main ()
>  {
> -#ifdef DO_TEST
> +#if DO_TEST

That will run afoul -Wundef.  Not sure what alternative is best,
something like

  #ifdef DO_TEST
  # if DO_TEST
  # endif
  #endif

perhaps, or 

  #if defined(DO_TEST) && DO_TEST

?

Or someone just says there are so many of these everywhere that
we shouldn't worry about -Wundef, of course...

Gerald
Pat Haugen - Nov. 1, 2010, 5:42 p.m.
On 10/31/2010 2:43 PM, Gerald Pfeifer wrote:
>> Index: gcc.c-torture/execute/20101011-1.c
>> >  ===================================================================
>> >  --- gcc.c-torture/execute/20101011-1.c  (revision 166039)
>> >  +++ gcc.c-torture/execute/20101011-1.c  (working copy)
>> >  @@ -35,7 +35,7 @@ int k;
>> >    int
>> >    main ()
>> >    {
>> >  -#ifdef DO_TEST
>> >  +#if DO_TEST
> That will run afoul -Wundef.  Not sure what alternative is best,
> something like
>
>    #ifdef DO_TEST
>    # if DO_TEST
>    # endif
>    #endif
>
> perhaps, or
>
>    #if defined(DO_TEST)&&  DO_TEST
>
DO_TEST is always defined in the testcase, which is what led to the 
original problem.

-Pat

Patch

Index: gcc.c-torture/execute/20101011-1.c
===================================================================
--- gcc.c-torture/execute/20101011-1.c  (revision 166039)
+++ gcc.c-torture/execute/20101011-1.c  (working copy)
@@ -35,7 +35,7 @@  int k;
  int
  main ()
  {
-#ifdef DO_TEST
+#if DO_TEST
    signal (SIGFPE, sigfpe);
    k = i / j;
    abort ();