blob: d9f0ac13b5512be729f51d11260a51accf168772 (
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
|
/* { dg-do run } */
/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis " } */
#include <assert.h>
int
main ()
{
struct astruct_s
{
_Bool a;
_Bool b;
_Bool c;
};
struct astruct_s b[2];
_Bool *a_0_ptr = &(b[0].a);
_Bool *c_0_ptr = &(b[0].c);
_Bool *a_1_ptr = &(b[1].a);
_Bool *c_0_ptr_from_a_0_ptr = a_0_ptr + 1;
_Bool *c_0_ptr_from_a_1_ptr = a_1_ptr - 1;
assert(c_0_ptr_from_a_0_ptr == c_0_ptr);
assert(c_0_ptr_from_a_1_ptr == c_0_ptr);
}
|