summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorBrian Gesiak <modocache@gmail.com>2019-11-30 15:36:35 -0500
committerBrian Gesiak <modocache@gmail.com>2019-11-30 15:47:58 -0500
commit8682d29a28772bab0283a141b8701bfaea8881a6 (patch)
tree2a5c48ada05c62a143f2cd2db3b5ac2f08de3537 /clang/unittests/Format/FormatTest.cpp
parent40dfc6dff10bd8881c6df31884e2184bbaab5698 (diff)
downloadbcm5719-llvm-8682d29a28772bab0283a141b8701bfaea8881a6.tar.gz
bcm5719-llvm-8682d29a28772bab0283a141b8701bfaea8881a6.zip
[Format] Add format check for coroutine keywords with negative numbers
Summary: As a followup to D69144, this diff fixes the coroutine keyword spacing for co_yield / co_returning negative numbers. Reviewers: modocache, sammccall, Quuxplusone Reviewed By: modocache Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69180 Patch by Jonathan Thomas (jonathoma)!
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index d89ad44e457..e6fa829e7ff 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -6990,6 +6990,9 @@ TEST_F(FormatTest, UnderstandsUnaryOperators) {
verifyFormat("int a = /* confusing comment */ -1;");
// FIXME: The space after 'i' is wrong, but hopefully, this is a rare case.
verifyFormat("int a = i /* confusing comment */++;");
+
+ verifyFormat("co_yield -1;");
+ verifyFormat("co_return -1;");
}
TEST_F(FormatTest, DoesNotIndentRelativeToUnaryOperators) {
OpenPOWER on IntegriCloud