From f8fd4d49625ca8d150b86d46d9ffc36ad795c66f Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 7 Oct 2011 00:42:48 +0000 Subject: Fix infinite loop in -Wuninitialized reported in PR 11069. llvm-svn: 141345 --- clang/test/Sema/uninit-variables.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'clang/test/Sema/uninit-variables.c') diff --git a/clang/test/Sema/uninit-variables.c b/clang/test/Sema/uninit-variables.c index 2398504347d..bcffbd6a3d5 100644 --- a/clang/test/Sema/uninit-variables.c +++ b/clang/test/Sema/uninit-variables.c @@ -391,3 +391,17 @@ int test_block_and_dead_code() { return x; // no-warning } +// This previously triggered an infinite loop in the analysis. +void PR11069(int a, int b) { + unsigned long flags; + for (;;) { + if (a && !b) + break; + } + for (;;) { + // This does not trigger a warning because it isn't a real use. + (void)(flags); // no-warning + } +} + + -- cgit v1.2.3