From 7bab5ff8e70c2f5076a26bcc6099b81c06a4de9a Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 25 Nov 2009 00:27:52 +0000 Subject: 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. llvm-svn: 89817 --- clang/test/CodeGenCXX/condition.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'clang/test/CodeGenCXX/condition.cpp') diff --git a/clang/test/CodeGenCXX/condition.cpp b/clang/test/CodeGenCXX/condition.cpp index 0bb9121f7f3..198c93b664c 100644 --- a/clang/test/CodeGenCXX/condition.cpp +++ b/clang/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; +} -- cgit v1.2.3