2009-05-19 H.J. Lu PR c/40172 * gcc.dg/pr40172.c: Renamed to ... * gcc.dg/pr40172-1.c: This. * gcc.dg/pr40172-2.c: New. * gcc.dg/pr40172-3.c: Likewise. --- gcc/testsuite/gcc.dg/pr40172-1.c.foo 2009-05-19 13:17:34.000000000 -0700 +++ gcc/testsuite/gcc.dg/pr40172-1.c 2009-05-19 10:19:24.000000000 -0700 @@ -0,0 +1,31 @@ +/* PR middle-end/40172 */ +/* { dg-do compile } */ +/* { dg-options "-Wall -W -Werror -Wlogical-op" } */ + +struct rtx_def; +typedef struct rtx_def *rtx; + +extern int foo; +extern int bar; +extern int xxx; + +int +test (void) +{ + if (((rtx) 0 != (rtx) 0) && xxx ? foo : bar) + return 1; + else if ((foo & 0) && xxx) + return 2; + else if (foo & 0) + return 3; + else if (0 && xxx) + return 4; + else if (0) + return 5; + if (((int) 0 != (int) 0) && bar ? foo : xxx) + return 6; + else if (0 != 0 && foo ? xxx : bar) + return 7; + else + return 0; +} --- gcc/testsuite/gcc.dg/pr40172-2.c.foo 2009-05-19 10:28:55.000000000 -0700 +++ gcc/testsuite/gcc.dg/pr40172-2.c 2009-05-19 10:20:49.000000000 -0700 @@ -0,0 +1,16 @@ +/* PR middle-end/40172 */ +/* { dg-do compile } */ +/* { dg-options "-Wall -W -Werror" } */ + +extern int xxx; + +#define XXX xxx + +int +test (void) +{ + if (!XXX && xxx) + return 4; + else + return 0; +} --- gcc/testsuite/gcc.dg/pr40172-3.c.foo 2009-05-19 10:28:52.000000000 -0700 +++ gcc/testsuite/gcc.dg/pr40172-3.c 2009-05-19 10:28:36.000000000 -0700 @@ -0,0 +1,17 @@ +/* PR middle-end/40172 */ +/* { dg-do compile */ +/* { dg-xfail-if "" { "*-*-*" } { "*" } { "" } } */ +/* { dg-options "-Wall -W -Werror -Wlogical-op" } */ + +extern int xxx; + +#define XXX xxx + +int +test (void) +{ + if (!XXX && xxx) + return 4; + else + return 0; +} --- gcc/testsuite/gcc.dg/pr40172.c.foo 2009-05-19 13:15:47.000000000 -0700 +++ gcc/testsuite/gcc.dg/pr40172.c 2009-05-19 13:17:36.000000000 -0700 @@ -1,31 +0,0 @@ -/* PR middle-end/40172 */ -/* { dg-do compile } */ -/* { dg-options "-Wall -W -Werror -Wlogical-op" } */ - -struct rtx_def; -typedef struct rtx_def *rtx; - -extern int foo; -extern int bar; -extern int xxx; - -int -test (void) -{ - if (((rtx) 0 != (rtx) 0) && xxx ? foo : bar) - return 1; - else if ((foo & 0) && xxx) - return 2; - else if (foo & 0) - return 3; - else if (0 && xxx) - return 4; - else if (0) - return 5; - if (((int) 0 != (int) 0) && bar ? foo : xxx) - return 6; - else if (0 != 0 && foo ? xxx : bar) - return 7; - else - return 0; -}