summaryrefslogtreecommitdiff
path: root/test/CXX
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-10-16 23:45:15 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-10-16 23:45:15 +0000
commit915c07db05375d563187f8b75fa4f766a5220b75 (patch)
treeb75101004140733090c3f90f8e53c77d9d152dff /test/CXX
parent57016dda61498294120b1a881d9e6606337b29d9 (diff)
downloadclang-915c07db05375d563187f8b75fa4f766a5220b75.tar.gz
Fix pretty-printing for variables declared in a condition. Patch by Grzegorz Jablonski.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX')
-rw-r--r--test/CXX/ast-print.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CXX/ast-print.cpp b/test/CXX/ast-print.cpp
index fb8588d4b1..44b34aa12c 100644
--- a/test/CXX/ast-print.cpp
+++ b/test/CXX/ast-print.cpp
@@ -19,3 +19,14 @@ int main()
(r->method());
}
+// CHECK: if (int a = 1)
+// CHECK: while (int a = 1)
+// CHECK: switch (int a = 1)
+
+void f()
+{
+ if (int a = 1) { }
+ while (int a = 1) { }
+ switch (int a = 1) { }
+}
+