From 52fefd89fd4c7ce3d10b9df5ec0b1da5258fb33f Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Wed, 16 Nov 2016 18:21:00 +0000 Subject: Fixed layout of test/ASTMerge. As outlined in a previous RFC, the test/ASTMerge/Inputs folder is getting full and the tests are starting to become interdependent. This is undesirable because - it makes it harder to write new tests - it makes it harder to figure out at a glance what old tests are doing, and - it adds the risk of breaking one test while changing a different one, because of the interdependencies. To fix this, according to the conversation in the RFC, I have changed the layout from a.c Inputs/a1.c Inputs/a2.c to a/test.c a/Inputs/a1.c a/Inputs/a2.c for all existing tests. I have also eliminated interdependencies by replicating the input files for each test that uses them. https://reviews.llvm.org/D26571 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287129 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/ASTMerge/class2/Inputs/class3.cpp | 26 ++++++++++++++++++++++++++ test/ASTMerge/class2/test.cpp | 9 +++++++++ 2 files changed, 35 insertions(+) create mode 100644 test/ASTMerge/class2/Inputs/class3.cpp create mode 100644 test/ASTMerge/class2/test.cpp (limited to 'test/ASTMerge/class2') diff --git a/test/ASTMerge/class2/Inputs/class3.cpp b/test/ASTMerge/class2/Inputs/class3.cpp new file mode 100644 index 0000000000..428acc3f03 --- /dev/null +++ b/test/ASTMerge/class2/Inputs/class3.cpp @@ -0,0 +1,26 @@ +class C1 { +public: + C1(); + ~C1(); + C1 *method_1() { + return this; + } + C1 method_2() { + return C1(); + } + void method_3() { + const C1 &ref = C1(); + } +}; + +class C11 : public C1 { +}; + +class C2 { +private: + int x; + friend class C3; +public: + static_assert(sizeof(x) == sizeof(int), "Error"); + typedef class C2::C2 InjType; +}; diff --git a/test/ASTMerge/class2/test.cpp b/test/ASTMerge/class2/test.cpp new file mode 100644 index 0000000000..6021403d72 --- /dev/null +++ b/test/ASTMerge/class2/test.cpp @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++1z -emit-pch -o %t.1.ast %S/Inputs/class3.cpp +// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++1z -ast-merge %t.1.ast -fsyntax-only -verify %s +// expected-no-diagnostics + +class C3 { + int method_1(C2 *x) { + return x->x; + } +}; -- cgit v1.2.1