aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/Frontend/ASTUnitTest.cpp2
-rw-r--r--clang/unittests/libclang/LibclangTest.cpp25
2 files changed, 26 insertions, 1 deletions
diff --git a/clang/unittests/Frontend/ASTUnitTest.cpp b/clang/unittests/Frontend/ASTUnitTest.cpp
index 0785c6a..d9d4932 100644
--- a/clang/unittests/Frontend/ASTUnitTest.cpp
+++ b/clang/unittests/Frontend/ASTUnitTest.cpp
@@ -167,7 +167,7 @@ TEST_F(ASTUnitTest, LoadFromCommandLineEarlyError) {
std::unique_ptr<clang::ASTUnit> ErrUnit;
ASTUnit *AST = ASTUnit::LoadFromCommandLine(
- &Args[0], &Args[4], PCHContainerOps, Diags, "", "", false,
+ &Args[0], &Args[4], PCHContainerOps, Diags, "", false, "", false,
CaptureDiagsKind::All, std::nullopt, true, 0, TU_Complete, false, false,
false, SkipFunctionBodiesScope::None, false, true, false, false,
std::nullopt, &ErrUnit, nullptr);
diff --git a/clang/unittests/libclang/LibclangTest.cpp b/clang/unittests/libclang/LibclangTest.cpp
index 662377c..ca762eb 100644
--- a/clang/unittests/libclang/LibclangTest.cpp
+++ b/clang/unittests/libclang/LibclangTest.cpp
@@ -479,6 +479,7 @@ protected:
};
class LibclangSetPreambleStoragePathTest : public LibclangPreambleStorageTest {
+ virtual bool StorePreamblesInMemory() { return false; }
virtual const char *PreambleStoragePath() = 0;
protected:
@@ -487,6 +488,7 @@ protected:
CXIndexOptions Opts{};
Opts.Size = sizeof(CXIndexOptions);
+ Opts.StorePreamblesInMemory = StorePreamblesInMemory();
Opts.PreambleStoragePath = PreambleStoragePath();
Index = clang_createIndexWithOptions(&Opts);
ASSERT_TRUE(Index);
@@ -506,6 +508,19 @@ class LibclangPreambleDirPreambleStoragePathTest
const char *PreambleStoragePath() override { return PreambleDir.c_str(); }
};
+class LibclangStoreInMemoryNullPreambleStoragePathTest
+ : public LibclangNullPreambleStoragePathTest {
+ bool StorePreamblesInMemory() override { return true; }
+};
+class LibclangStoreInMemoryEmptyPreambleStoragePathTest
+ : public LibclangEmptyPreambleStoragePathTest {
+ bool StorePreamblesInMemory() override { return true; }
+};
+class LibclangStoreInMemoryPreambleDirPreambleStoragePathTest
+ : public LibclangPreambleDirPreambleStoragePathTest {
+ bool StorePreamblesInMemory() override { return true; }
+};
+
TEST_F(LibclangNotOverriddenPreambleStoragePathTest, CountPreambles) {
CountPreamblesInPreambleDir(0);
}
@@ -518,6 +533,16 @@ TEST_F(LibclangEmptyPreambleStoragePathTest, CountPreambles) {
TEST_F(LibclangPreambleDirPreambleStoragePathTest, CountPreambles) {
CountPreamblesInPreambleDir(1);
}
+TEST_F(LibclangStoreInMemoryNullPreambleStoragePathTest, CountPreambles) {
+ CountPreamblesInPreambleDir(0);
+}
+TEST_F(LibclangStoreInMemoryEmptyPreambleStoragePathTest, CountPreambles) {
+ CountPreamblesInPreambleDir(0);
+}
+TEST_F(LibclangStoreInMemoryPreambleDirPreambleStoragePathTest,
+ CountPreambles) {
+ CountPreamblesInPreambleDir(0);
+}
TEST_F(LibclangParseTest, AllSkippedRanges) {
std::string Header = "header.h", Main = "main.cpp";