aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/pr40172-1.c
blob: a834a8a998e22481cb286b11322c2121c6c86e6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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;
}