1 /* { dg-do run } */ 2 /* { dg-options "-fsanitize=bounds" } */ 3 4 struct S 5 { 6 unsigned long a[1]; 7 int l; 8 }; 9 10 static inline unsigned long fn(const struct S * s,int i)11fn (const struct S *s, int i) 12 { 13 return s->a[i] << i; 14 } 15 16 int main()17main () 18 { 19 struct S s; 20 fn (&s, 1); 21 } 22 23 /* { dg-output "index 1 out of bounds for type 'long unsigned int \\\[1\\\]'" } */ 24