summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/condition.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenCXX/condition.cpp')
-rw-r--r--clang/test/CodeGenCXX/condition.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/condition.cpp b/clang/test/CodeGenCXX/condition.cpp
index f3c8a9b7695..0bb9121f7f3 100644
--- a/clang/test/CodeGenCXX/condition.cpp
+++ b/clang/test/CodeGenCXX/condition.cpp
@@ -69,3 +69,23 @@ void switch_destruct(int z) {
// CHECK: store i32 20
z = 20;
}
+
+int foo();
+
+void while_destruct(int z) {
+ // CHECK: define void @_Z14while_destructi
+ // CHECK: while.cond:
+ while (X x = X()) {
+ // CHECK: call void @_ZN1XC1Ev
+
+ // CHECK: while.body:
+ // CHECK: store i32 21
+ z = 21;
+
+ // CHECK: while.cleanup:
+ // CHECK: call void @_ZN1XD1Ev
+ }
+ // CHECK: while.end
+ // CHECK: store i32 22
+ z = 22;
+}
OpenPOWER on IntegriCloud