[clang-tools-extra] r339866 - Attempt to fix clangd tests on older compilers
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 16 04:41:19 PDT 2018
Author: rksimon
Date: Thu Aug 16 04:41:19 2018
New Revision: 339866
URL: http://llvm.org/viewvc/llvm-project?rev=339866&view=rev
Log:
Attempt to fix clangd tests on older compilers
Old gcc versions of gcc struggle with raw string literals inside macros.
Inspired by rL339759
Modified:
clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp
Modified: clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp?rev=339866&r1=339865&r2=339866&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp Thu Aug 16 04:41:19 2018
@@ -1538,36 +1538,39 @@ TEST(SignatureHelpTest, OverloadsOrderin
}
TEST(SignatureHelpTest, InstantiatedSignatures) {
- EXPECT_THAT(signatures(R"cpp(
+ StringRef Sig0 = R"cpp(
template <class T>
void foo(T, T, T);
int main() {
foo<int>(^);
}
- )cpp")
- .signatures,
+ )cpp";
+
+ EXPECT_THAT(signatures(Sig0).signatures,
ElementsAre(Sig("foo(T, T, T) -> void", {"T", "T", "T"})));
- EXPECT_THAT(signatures(R"cpp(
+ StringRef Sig1 = R"cpp(
template <class T>
void foo(T, T, T);
int main() {
foo(10, ^);
- })cpp")
- .signatures,
+ })cpp";
+
+ EXPECT_THAT(signatures(Sig1).signatures,
ElementsAre(Sig("foo(T, T, T) -> void", {"T", "T", "T"})));
- EXPECT_THAT(signatures(R"cpp(
+ StringRef Sig2 = R"cpp(
template <class ...T>
void foo(T...);
int main() {
foo<int>(^);
}
- )cpp")
- .signatures,
+ )cpp";
+
+ EXPECT_THAT(signatures(Sig2).signatures,
ElementsAre(Sig("foo(T...) -> void", {"T..."})));
// It is debatable whether we should substitute the outer template parameter
@@ -1575,7 +1578,7 @@ TEST(SignatureHelpTest, InstantiatedSign
// do substitute in code complete.
// FIXME: make code complete and signature help consistent, figure out which
// way is better.
- EXPECT_THAT(signatures(R"cpp(
+ StringRef Sig3 = R"cpp(
template <class T>
struct X {
template <class U>
@@ -1585,8 +1588,9 @@ TEST(SignatureHelpTest, InstantiatedSign
int main() {
X<int>().foo<double>(^)
}
- )cpp")
- .signatures,
+ )cpp";
+
+ EXPECT_THAT(signatures(Sig3).signatures,
ElementsAre(Sig("foo(T, U) -> void", {"T", "U"})));
}
More information about the cfe-commits
mailing list