diff options
| author | Jordy Rose <jediknil@belkadan.com> | 2010-08-14 20:46:10 +0000 |
|---|---|---|
| committer | Jordy Rose <jediknil@belkadan.com> | 2010-08-14 20:46:10 +0000 |
| commit | a7974757128761c7d2020fd9994b6bfb22d71a68 (patch) | |
| tree | 27ccba63e1cfac1ca13c4b2cbdf59c1804e7f281 /clang/test/Analysis/outofbound.c | |
| parent | ac0ab20e3be35c4525ce826c29110bbdb6812621 (diff) | |
| download | bcm5719-llvm-a7974757128761c7d2020fd9994b6bfb22d71a68.tar.gz bcm5719-llvm-a7974757128761c7d2020fd9994b6bfb22d71a68.zip | |
Add a test for alloca region extents.
llvm-svn: 111079
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}} + } +} |

