repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* asan.c (pass_sanopt::execute): Handle IFN_UBSAN_OBJECT_SIZE.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
ubsan
/
object-size-1.C
blob
e2aad4670bbb16c3a84fa95eb6e7efe28a3f038a
1
// { dg-do compile }
2
// { dg-options "-fsanitize=undefined -fpermissive" }
3
4
struct T { int c; char d[]; };
5
6
struct T t = { 1, "a" }; // { dg-warning "initializer-string for array of chars is too long" }
7
8
int
9
baz (int i)
10
{
11
return t.d[i];
12
}
13
14
int
15
main (void)
16
{
17
baz (3);
18
}