diff options
Diffstat (limited to 'clang/unittests/Tooling/CompilationDatabaseTest.cpp')
-rw-r--r-- | clang/unittests/Tooling/CompilationDatabaseTest.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/clang/unittests/Tooling/CompilationDatabaseTest.cpp b/clang/unittests/Tooling/CompilationDatabaseTest.cpp index 218a352..adb9de0 100644 --- a/clang/unittests/Tooling/CompilationDatabaseTest.cpp +++ b/clang/unittests/Tooling/CompilationDatabaseTest.cpp @@ -739,6 +739,9 @@ protected: EXPECT_EQ(Results[0].CommandLine.back(), MakeNative ? path(F) : F) << "Last arg should be the file"; Results[0].CommandLine.pop_back(); + EXPECT_EQ(Results[0].CommandLine.back(), "--") + << "Second-last arg should be --"; + Results[0].CommandLine.pop_back(); return llvm::join(Results[0].CommandLine, " "); } @@ -826,18 +829,6 @@ TEST_F(InterpolateTest, StripDoubleDash) { EXPECT_EQ(getCommand("dir/bar.cpp"), "clang -D dir/foo.cpp -Wall -std=c++14"); } -TEST_F(InterpolateTest, InsertDoubleDash) { - add("dir/foo.cpp", "-o foo.o -std=c++14 -Wall"); - EXPECT_EQ(getCommand("-dir/bar.cpp", false), - "clang -D dir/foo.cpp -Wall -std=c++14 --"); -} - -TEST_F(InterpolateTest, InsertDoubleDashForClangCL) { - add("dir/foo.cpp", "clang-cl", "/std:c++14 /W4"); - EXPECT_EQ(getCommand("/dir/bar.cpp", false), - "clang-cl -D dir/foo.cpp /W4 /std:c++14 --"); -} - TEST_F(InterpolateTest, Case) { add("FOO/BAR/BAZ/SHOUT.cc"); add("foo/bar/baz/quiet.cc"); @@ -879,7 +870,7 @@ TEST(TransferCompileCommandTest, Smoke) { CompileCommand Transferred = transferCompileCommand(std::move(Cmd), "foo.h"); EXPECT_EQ(Transferred.Filename, "foo.h"); EXPECT_THAT(Transferred.CommandLine, - ElementsAre("clang", "-Wall", "-x", "c++-header", "foo.h")); + ElementsAre("clang", "-Wall", "-x", "c++-header", "--", "foo.h")); EXPECT_EQ(Transferred.Directory, "dir"); } |