summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr35833.c
blob: 2e740f29f84137ed03e84dea07cd91de77bc7485 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do run } */
/* { dg-options "-ftree-vrp" } */

struct S {struct S *field;};
struct S True, False, Z;
static inline int f(void) {return 1;}
static inline int g(struct S **obj) {
   return f() && *obj == &Z;
}
struct S **h(struct S **x) {
   if (x)
      return g(x) ? &True.field : &False.field;
   else
      return &True.field;
}
extern void abort (void);
int main()
{
  if (h(&False.field) != &False.field)
    abort ();
  return 0;
}