Sign in
gnu
/
gcc
/
d769c5040874bf9546f2524f3f1d2a894165f92a
/
.
/
gcc
/
testsuite
/
gcc.dg
/
pr44061.c
blob: 60a4260ae94c3257e9c9b37a945b1f654809ea39 [
file
] [
log
] [
blame
]
/* { dg-do compile } */
/* { dg-options "-O2 -Wall" } */
int
a
[
2
];
int
foo
(
int
q
)
{
if
(
__builtin_constant_p
(
q
))
{
if
(
q
==
4
)
return
a
[
4
];
/* { dg-bogus "array subscript is above array bounds" } */
else
return
a
[
0
];
}
else
return
a
[
q
];
}