diff options
author | Sean Callanan <scallanan@apple.com> | 2016-11-16 18:21:00 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2016-11-16 18:21:00 +0000 |
commit | 52fefd89fd4c7ce3d10b9df5ec0b1da5258fb33f (patch) | |
tree | d241145cd1d5c5f83af2e173cd241960576eab9e /test/ASTMerge/class2 | |
parent | 75468b182ef85c3e12160057b3ff8daf40cf4dee (diff) | |
download | clang-52fefd89fd4c7ce3d10b9df5ec0b1da5258fb33f.tar.gz |
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
Diffstat (limited to 'test/ASTMerge/class2')
-rw-r--r-- | test/ASTMerge/class2/Inputs/class3.cpp | 26 | ||||
-rw-r--r-- | test/ASTMerge/class2/test.cpp | 9 |
2 files changed, 35 insertions, 0 deletions
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; + } +}; |