diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-10-07 00:52:56 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-10-07 00:52:56 +0000 |
commit | 171969c8c2004547650f02719cbb550374159841 (patch) | |
tree | 61f84ee986e8ec33d840f29768d10dc4b7899891 /clang/test/Sema/uninit-variables.c | |
parent | f8fd4d49625ca8d150b86d46d9ffc36ad795c66f (diff) | |
download | bcm5719-llvm-171969c8c2004547650f02719cbb550374159841.tar.gz bcm5719-llvm-171969c8c2004547650f02719cbb550374159841.zip |
r141345 also fixed a -Wuninitialized bug where loop conditions were not always flagged as being uninitialized. Addresses <rdar://problem/9432305>.
llvm-svn: 141346
Diffstat (limited to 'clang/test/Sema/uninit-variables.c')
-rw-r--r-- | clang/test/Sema/uninit-variables.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Sema/uninit-variables.c b/clang/test/Sema/uninit-variables.c index bcffbd6a3d5..f716124bcbb 100644 --- a/clang/test/Sema/uninit-variables.c +++ b/clang/test/Sema/uninit-variables.c @@ -404,4 +404,10 @@ void PR11069(int a, int b) { } } +// Test uninitialized value used in loop condition. +void rdar9432305(float *P) { + int i; // expected-note {{initialize the variable 'i' to silence this warning}} + for (; i < 10000; ++i) // expected-warning {{variable 'i' is uninitialized when used here}} + P[i] = 0.0f; +} |