aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/warn-loop-analysis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/warn-loop-analysis.cpp')
-rw-r--r--test/SemaCXX/warn-loop-analysis.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-loop-analysis.cpp b/test/SemaCXX/warn-loop-analysis.cpp
index a55ca6c6ea..627bc51d1b 100644
--- a/test/SemaCXX/warn-loop-analysis.cpp
+++ b/test/SemaCXX/warn-loop-analysis.cpp
@@ -144,3 +144,11 @@ void test5() {
for (int a; a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a+a;);//\
// expected-warning {{variable 'a' used in loop condition not modified in loop body}}
}
+
+// Ignore global variables and static variables.
+int x6;
+void test6() {
+ static int y;
+ for (;x6;);
+ for (;y;);
+}