aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Tooling/CompilationDatabaseTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Tooling/CompilationDatabaseTest.cpp')
-rw-r--r--clang/unittests/Tooling/CompilationDatabaseTest.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/unittests/Tooling/CompilationDatabaseTest.cpp b/clang/unittests/Tooling/CompilationDatabaseTest.cpp
index a3ea899..ba40a7a 100644
--- a/clang/unittests/Tooling/CompilationDatabaseTest.cpp
+++ b/clang/unittests/Tooling/CompilationDatabaseTest.cpp
@@ -843,6 +843,18 @@ TEST_F(InterpolateTest, DriverModes) {
EXPECT_EQ(getCommand("bar.h"), "clang -D bar.cpp --driver-mode=cl /TP");
}
+TEST(TransferCompileCommandTest, Smoke) {
+ CompileCommand Cmd;
+ Cmd.Filename = "foo.cc";
+ Cmd.CommandLine = {"clang", "-Wall", "foo.cc"};
+ Cmd.Directory = "dir";
+ 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"));
+ EXPECT_EQ(Transferred.Directory, "dir");
+}
+
TEST(CompileCommandTest, EqualityOperator) {
CompileCommand CCRef("/foo/bar", "hello.c", {"a", "b"}, "hello.o");
CompileCommand CCTest = CCRef;