aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/ptrmemfield.C
blob: c32ebba0002ec1aac4ada6a574a13e893c7fdf41 (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
/* { dg-do compile } */
// { dg-options "-O2 -fdump-tree-optimized" }


struct f
{
  char m;
  char m1;
};

static inline char f:: *g(int a)
{
  return a?0:&f::m;
}

int h(void)
{
  char f:: *a = g(0);
  return a == 0;
}

/* We should have no cast to offset_type. */
/* { dg-final { scan-tree-dump-times "offset_type" 0 "optimized"} } */
// And we should optimized this code to just return 0
/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized"} } */
/* { dg-final { cleanup-tree-dump "optimized" } } */