1 // Contributed by Dodji Seketeli <dodji@redhat.com>
3 // { dg-options "-Warray-bounds" }
20 __builtin_offsetof(struct A
, p
); // OK
21 __builtin_offsetof(struct A
, p
[0]); // { dg-error "non constant address" }
22 __builtin_offsetof(struct B
, p
[0]); // OK
23 __builtin_offsetof(struct B
, p
[9]); // OK
24 __builtin_offsetof(struct B
, p
[10]); // OK
25 __builtin_offsetof(struct B
, p
[11]); // { dg-warning "greater than size" }
26 __builtin_offsetof(struct B
, a
.p
); // OK
27 __builtin_offsetof(struct B
, p
[0]); // OK
28 __builtin_offsetof(struct B
, a
.p
[0]); // { dg-error "non constant address" }