From 59a92a4aa354eee24286570e16b933ec9841951e Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Wed, 15 Aug 2018 22:51:37 +0000 Subject: [PATCH] [ASTImporter] Add test for ExprWithCleanups Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50731 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339830 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Import/expr-with-cleanups/Inputs/S.cpp | 8 ++++++++ test/Import/expr-with-cleanups/test.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/Import/expr-with-cleanups/Inputs/S.cpp create mode 100644 test/Import/expr-with-cleanups/test.cpp diff --git a/test/Import/expr-with-cleanups/Inputs/S.cpp b/test/Import/expr-with-cleanups/Inputs/S.cpp new file mode 100644 index 0000000000..7b69f48f68 --- /dev/null +++ b/test/Import/expr-with-cleanups/Inputs/S.cpp @@ -0,0 +1,8 @@ +struct RAII { + int i = 0; + RAII() { i++; } + ~RAII() { i--; } +}; +void f() { + RAII(); +} diff --git a/test/Import/expr-with-cleanups/test.cpp b/test/Import/expr-with-cleanups/test.cpp new file mode 100644 index 0000000000..79b76f414e --- /dev/null +++ b/test/Import/expr-with-cleanups/test.cpp @@ -0,0 +1,8 @@ +// RUN: clang-import-test -dump-ast -import %S/Inputs/S.cpp -expression %s | FileCheck %s +// CHECK: ExprWithCleanups +// CHECK-SAME: 'RAII' +// CHECK-NEXT: CXXBindTemporaryExpr + +void expr() { + f(); +} -- 2.40.0