1 /* { dg-options "-Warray-bounds" } */
2 /* { dg-do compile } */
51 __builtin_offsetof (struct A
, p
[4]); /* OK */
52 __builtin_offsetof (struct B
, a
.p
[4]); /* { dg-warning "greater than size" } */
53 __builtin_offsetof (struct C
, a
.p
[4]); /* OK */
54 __builtin_offsetof (union D
, p
[4]); /* OK */
55 __builtin_offsetof (union D
, a
.p
[4]); /* OK */
56 __builtin_offsetof (union D
, b
.a
.p
[4]); /* { dg-warning "greater than size" } */
57 __builtin_offsetof (union D
, c
.a
.p
[4]); /* OK */
58 __builtin_offsetof (struct E
, d
.p
[4]); /* OK */
59 __builtin_offsetof (struct E
, d
.a
.p
[4]); /* OK */
60 __builtin_offsetof (struct E
, d
.b
.a
.p
[4]); /* { dg-warning "greater than size" } */
61 __builtin_offsetof (struct E
, d
.c
.a
.p
[4]); /* OK */
62 __builtin_offsetof (struct F
, d
.p
[4]); /* { dg-warning "greater than size" } */
63 __builtin_offsetof (struct F
, d
.a
.p
[4]); /* { dg-warning "greater than size" } */
64 __builtin_offsetof (struct F
, d
.b
.a
.p
[4]); /* { dg-warning "greater than size" } */
65 __builtin_offsetof (struct F
, d
.c
.a
.p
[4]); /* { dg-warning "greater than size" } */
66 __builtin_offsetof (union G
, d
.p
[4]); /* OK */
67 __builtin_offsetof (union G
, d
.a
.p
[4]); /* OK */
68 __builtin_offsetof (union G
, d
.b
.a
.p
[4]); /* { dg-warning "greater than size" } */
69 __builtin_offsetof (union G
, d
.c
.a
.p
[4]); /* OK */