diff options
author | 2020-08-09 15:51:07 +0000 | |
---|---|---|
committer | 2020-08-09 15:51:07 +0000 | |
commit | 389bb291c0c8961ca40ac7a2636e1ca69ca7653c (patch) | |
tree | e027d0b3ed5ed27fe08d1bcaa20e3c191232a53b /gnu/llvm/clang/unittests/Tooling/Syntax/TokensTest.cpp | |
parent | Import LLVM 10.0.1 including clang, lld and lldb. (diff) | |
download | wireguard-openbsd-389bb291c0c8961ca40ac7a2636e1ca69ca7653c.tar.xz wireguard-openbsd-389bb291c0c8961ca40ac7a2636e1ca69ca7653c.zip |
Import LLVM 10.0.1 including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/clang/unittests/Tooling/Syntax/TokensTest.cpp')
-rw-r--r-- | gnu/llvm/clang/unittests/Tooling/Syntax/TokensTest.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/gnu/llvm/clang/unittests/Tooling/Syntax/TokensTest.cpp b/gnu/llvm/clang/unittests/Tooling/Syntax/TokensTest.cpp index b2ad3859104..f1e2dda963c 100644 --- a/gnu/llvm/clang/unittests/Tooling/Syntax/TokensTest.cpp +++ b/gnu/llvm/clang/unittests/Tooling/Syntax/TokensTest.cpp @@ -470,11 +470,28 @@ file './input.cpp' mappings: ['#'_0, 'int'_7) => ['int'_0, 'int'_0) ['FOO'_10, '<eof>'_11) => ['10'_3, '<eof>'_7) -)"}}; +)"}, + {R"cpp( + #define NUM 42 + #define ID(a) a + #define M 1 + ID + M(NUM) + )cpp", + R"(expanded tokens: + 1 + 42 +file './input.cpp' + spelled tokens: + # define NUM 42 # define ID ( a ) a # define M 1 + ID M ( NUM ) + mappings: + ['#'_0, 'M'_17) => ['1'_0, '1'_0) + ['M'_17, '<eof>'_21) => ['1'_0, '<eof>'_3) +)"}, + }; - for (auto &Test : TestCases) - EXPECT_EQ(Test.second, collectAndDump(Test.first)) - << collectAndDump(Test.first); + for (auto &Test : TestCases) { + std::string Dump = collectAndDump(Test.first); + EXPECT_EQ(Test.second, Dump) << Dump; + } } TEST_F(TokenCollectorTest, SpecialTokens) { |