| 1 |
/* { dg-do compile } */ |
| 2 |
// { dg-options "-O2 -fdump-tree-optimized" } |
| 3 |
|
| 4 |
|
| 5 |
struct f |
| 6 |
{ |
| 7 |
char m; |
| 8 |
char m1; |
| 9 |
}; |
| 10 |
|
| 11 |
static inline char f:: *g(int a) |
| 12 |
{ |
| 13 |
return a?0:&f::m; |
| 14 |
} |
| 15 |
|
| 16 |
int h(void) |
| 17 |
{ |
| 18 |
char f:: *a = g(0); |
| 19 |
return a == 0; |
| 20 |
} |
| 21 |
|
| 22 |
/* We should have no cast to offset_type. */ |
| 23 |
/* { dg-final { scan-tree-dump-times "offset_type" 0 "optimized"} } */ |
| 24 |
// And we should optimized this code to just return 0 |
| 25 |
/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized"} } */ |
| 26 |
|