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
Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git]
/
main
/
gcc
/
testsuite
/
c-c++-common
/
ubsan
/
vla-3.c
blob
7772857fdea95165485c0474480484fd24d5faf9
1
/* { dg-do run } */
2
/* { dg-options "-fsanitize=vla-bound" } */
3
4
#include <stdio.h>
5
6
/* Don't instrument the arrays here. */
7
int
8
foo
(
int
n
,
int
a
[])
9
{
10
return
a
[
n
-
1
];
11
}
12
13
int
14
main
(
void
)
15
{
16
fputs
(
"UBSAN TEST START
\n
"
,
stderr
);
17
18
int
a
[
6
] = { };
19
int
ret
=
foo
(
3
,
a
);
20
21
fputs
(
"UBSAN TEST END
\n
"
,
stderr
);
22
return
ret
;
23
}
24
25
/* { dg-output "UBSAN TEST START(\n|\r\n|\r)UBSAN TEST END" } */