From 171969c8c2004547650f02719cbb550374159841 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 7 Oct 2011 00:52:56 +0000 Subject: [PATCH] r141345 also fixed a -Wuninitialized bug where loop conditions were not always flagged as being uninitialized. Addresses . llvm-svn: 141346 --- clang/test/Sema/uninit-variables.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clang/test/Sema/uninit-variables.c b/clang/test/Sema/uninit-variables.c index bcffbd6a3d50..f716124bcbbb 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; +}