]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/Warray-bounds-18.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / Warray-bounds-18.c
CommitLineData
798e2a8e 1/* { dg-do compile } */
daa94de2 2/* { dg-options "-O2 -Warray-bounds -Wno-stringop-overflow" } */
798e2a8e
RB
3
4typedef struct
5{
6 int len;
7 char data[1];
8} rec;
9
10int
11p(rec *r, int len);
12
13int
14f (char prm1, char prm2)
15{
16 char buf[10];
17
18 rec *r1 = (rec *)&buf;
19
20 r1->len = 10;
21 r1->data[0] = prm1;
22 r1->data[1] = prm2; /* { dg-bogus "above array bounds" } */
23
24 return p(r1, r1->len);
25}