From 6501320e723a63bcbadf49c9e9dd4cfde904619e Mon Sep 17 00:00:00 2001 From: DeLesley Hutchins Date: Thu, 17 Oct 2013 18:19:31 +0000 Subject: Consumed analysis: fix ICE in handling of loop source locations. llvm-svn: 192911 --- clang/test/SemaCXX/warn-consumed-analysis.cpp | 28 ++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'clang/test/SemaCXX/warn-consumed-analysis.cpp') diff --git a/clang/test/SemaCXX/warn-consumed-analysis.cpp b/clang/test/SemaCXX/warn-consumed-analysis.cpp index 8a55c8820a2..e7380b97feb 100644 --- a/clang/test/SemaCXX/warn-consumed-analysis.cpp +++ b/clang/test/SemaCXX/warn-consumed-analysis.cpp @@ -546,14 +546,36 @@ void testWhileLoop1() { ConsumableClass var0, var1(42); - while (i-- > 0) { + while (i-- > 0) { // expected-warning {{state of variable 'var1' must match at the entry and exit of loop}} *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}} *var1; var1.consume(); - *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}} \ - // expected-warning {{state of variable 'var1' must match at the entry and exit of loop}} + *var1; // expected-warning {{invalid invocation of method 'operator*' on object 'var1' while it is in the 'consumed' state}} } *var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}} } + + +namespace ContinueICETest { + +bool cond1(); +bool cond2(); + +static void foo1() { + while (cond1()) { + if (cond2()) + continue; + } +} + +static void foo2() { + while (true) { + if (false) + continue; + } +} + +} // end namespace ContinueICETest + -- cgit v1.2.3