diff options
Diffstat (limited to 'clang/test/Analysis/outofbound.c')
| -rw-r--r-- | clang/test/Analysis/outofbound.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Analysis/outofbound.c b/clang/test/Analysis/outofbound.c index 9b487300c88..529f0e77b26 100644 --- a/clang/test/Analysis/outofbound.c +++ b/clang/test/Analysis/outofbound.c @@ -71,3 +71,11 @@ void sizeof_vla(int a) { y[5] = 5; // expected-warning{{out-of-bound}} } } + +void alloca_region(int a) { + if (a == 5) { + char *x = __builtin_alloca(a); + x[4] = 4; // no-warning + x[5] = 5; // expected-warning{{out-of-bound}} + } +} |

