summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/condition.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-25 00:27:52 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-25 00:27:52 +0000
commit99e9b4d172f6877e6ba5ebe75bb8238721f5e01c (patch)
tree16c143b06b39022258614b713ed5999a7d7679c0 /test/CodeGenCXX/condition.cpp
parentd1a7846699a82f85ff3ce6b2e383409537c3f5c5 (diff)
Eliminate CXXConditionDeclExpr with extreme prejudice.
All statements that involve conditions can now hold on to a separate condition declaration (a VarDecl), and will use a DeclRefExpr referring to that VarDecl for the condition expression. ForStmts now have such a VarDecl (I'd missed those in previous commits). Also, since this change reworks the Action interface for if/while/switch/for, use FullExprArg for the full expressions in those expressions, to ensure that we're emitting Note that we are (still) not generating the right cleanups for condition variables in for statements. That will be a follow-on commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/condition.cpp')
-rw-r--r--test/CodeGenCXX/condition.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGenCXX/condition.cpp b/test/CodeGenCXX/condition.cpp
index 0bb9121f7f..198c93b664 100644
--- a/test/CodeGenCXX/condition.cpp
+++ b/test/CodeGenCXX/condition.cpp
@@ -89,3 +89,17 @@ void while_destruct(int z) {
// CHECK: store i32 22
z = 22;
}
+
+void for_destruct(int z) {
+ // CHECK: define void @_Z12for_destruct
+ // CHECK: call void @_ZN1XC1Ev
+ for(X x = X(); z; ++z)
+ // CHECK: for.body:
+ // CHECK: store i32 23
+ z = 23;
+ // CHECK: for.inc:
+ // CHECK: for.end
+ // CHECK: call void @_ZN1XD1Ev
+ // CHECK: store i32 24
+ z = 24;
+}