* asan.c (pass_sanopt::execute): Handle IFN_UBSAN_OBJECT_SIZE.
[official-gcc.git] / gcc / testsuite / g++.dg / ubsan / object-size-1.C
blobe2aad4670bbb16c3a84fa95eb6e7efe28a3f038a
1 // { dg-do compile }
2 // { dg-options "-fsanitize=undefined -fpermissive" }
4 struct T { int c; char d[]; };
6 struct T t = { 1, "a" }; // { dg-warning "initializer-string for array of chars is too long" }
8 int
9 baz (int i)
11   return t.d[i];
14 int
15 main (void)
17   baz (3);