diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-02-13 04:32:57 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-02-13 04:32:57 +0000 |
commit | 6fa7e74dea00f66315835e70cdea047ba58f7b4c (patch) | |
tree | 14393e919d7a1ab5fa784674971f7c07add23458 /unittests/Format/FormatTest.cpp | |
parent | 37d693160eba22343e08d7bcf66cd132ace77e5c (diff) |
Formatter: Add more cast tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175030 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index a91d325b51..20667208da 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -1723,7 +1723,13 @@ TEST_F(FormatTest, FormatsCasts) { // These are not casts. verifyFormat("void f(int *) {}"); - verifyFormat("f(foo)[4];"); + verifyFormat("f(foo)->b;"); + verifyFormat("f(foo).b;"); + verifyFormat("f(foo)(b);"); + verifyFormat("f(foo)[b];"); + verifyFormat("[](foo) { return 4; }(bar)];"); + verifyFormat("(*funptr)(foo)[4];"); + verifyFormat("funptrs[4](foo)[4];"); verifyFormat("void f(int *);"); verifyFormat("void f(int *) = 0;"); verifyFormat("void f(SmallVector<int>) {}"); @@ -1731,6 +1737,8 @@ TEST_F(FormatTest, FormatsCasts) { verifyFormat("void f(SmallVector<int>) = 0;"); verifyFormat("void f(int i = (kValue) * kMask) {}"); verifyFormat("void f(int i = (kA * kB) & kMask) {}"); + verifyFormat("int a = sizeof(int) * b;"); + verifyFormat("int a = alignof(int) * b;"); } TEST_F(FormatTest, FormatsFunctionTypes) { |