xref: /llvm-project/lldb/unittests/Expression/CppModuleConfigurationTest.cpp (revision e04fc2d88efa60ed5527b90c15d8fc188739e989)
180814287SRaphael Isemann //===-- CppModuleConfigurationTest.cpp ------------------------------------===//
29379d19fSRaphael Isemann //
39379d19fSRaphael Isemann // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
49379d19fSRaphael Isemann // See https://llvm.org/LICENSE.txt for license information.
59379d19fSRaphael Isemann // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
69379d19fSRaphael Isemann //
79379d19fSRaphael Isemann //===----------------------------------------------------------------------===//
89379d19fSRaphael Isemann 
99379d19fSRaphael Isemann #include "Plugins/ExpressionParser/Clang/CppModuleConfiguration.h"
109379d19fSRaphael Isemann #include "Plugins/ExpressionParser/Clang/ClangHost.h"
115dca0596SRaphael Isemann #include "TestingSupport/SubsystemRAII.h"
129379d19fSRaphael Isemann #include "lldb/Host/FileSystem.h"
139379d19fSRaphael Isemann #include "lldb/Host/HostInfo.h"
149379d19fSRaphael Isemann 
159379d19fSRaphael Isemann #include "gmock/gmock.h"
169379d19fSRaphael Isemann #include "gtest/gtest.h"
179379d19fSRaphael Isemann 
189379d19fSRaphael Isemann using namespace lldb_private;
199379d19fSRaphael Isemann 
209379d19fSRaphael Isemann namespace {
219379d19fSRaphael Isemann struct CppModuleConfigurationTest : public testing::Test {
2299b7b41eSRaphael Isemann   llvm::MemoryBufferRef m_empty_buffer;
2399b7b41eSRaphael Isemann   llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> m_fs;
2499b7b41eSRaphael Isemann 
CppModuleConfigurationTest__anon79d508220111::CppModuleConfigurationTest2599b7b41eSRaphael Isemann   CppModuleConfigurationTest()
2699b7b41eSRaphael Isemann       : m_empty_buffer("", "<empty buffer>"),
2799b7b41eSRaphael Isemann         m_fs(new llvm::vfs::InMemoryFileSystem()) {}
2899b7b41eSRaphael Isemann 
SetUp__anon79d508220111::CppModuleConfigurationTest2999b7b41eSRaphael Isemann   void SetUp() override {
3099b7b41eSRaphael Isemann     FileSystem::Initialize(m_fs);
3199b7b41eSRaphael Isemann     HostInfo::Initialize();
3299b7b41eSRaphael Isemann   }
3399b7b41eSRaphael Isemann 
TearDown__anon79d508220111::CppModuleConfigurationTest3499b7b41eSRaphael Isemann   void TearDown() override {
3599b7b41eSRaphael Isemann     HostInfo::Terminate();
3699b7b41eSRaphael Isemann     FileSystem::Terminate();
3799b7b41eSRaphael Isemann   }
3899b7b41eSRaphael Isemann 
3999b7b41eSRaphael Isemann   /// Utility function turning a list of paths into a FileSpecList.
makeFiles__anon79d508220111::CppModuleConfigurationTest4099b7b41eSRaphael Isemann   FileSpecList makeFiles(llvm::ArrayRef<std::string> paths) {
4199b7b41eSRaphael Isemann     FileSpecList result;
4299b7b41eSRaphael Isemann     for (const std::string &path : paths) {
4399b7b41eSRaphael Isemann       result.Append(FileSpec(path, FileSpec::Style::posix));
4499b7b41eSRaphael Isemann       if (!m_fs->addFileNoOwn(path, static_cast<time_t>(0), m_empty_buffer))
4599b7b41eSRaphael Isemann         llvm_unreachable("Invalid test configuration?");
4699b7b41eSRaphael Isemann     }
4799b7b41eSRaphael Isemann     return result;
4899b7b41eSRaphael Isemann   }
499379d19fSRaphael Isemann };
509379d19fSRaphael Isemann } // namespace
519379d19fSRaphael Isemann 
529379d19fSRaphael Isemann /// Returns the Clang resource include directory.
ResourceInc()539379d19fSRaphael Isemann static std::string ResourceInc() {
549379d19fSRaphael Isemann   llvm::SmallString<256> resource_dir;
559379d19fSRaphael Isemann   llvm::sys::path::append(resource_dir, GetClangResourceDir().GetPath(),
569379d19fSRaphael Isemann                           "include");
57e28d8f90SJonas Devlieghere   return std::string(resource_dir);
589379d19fSRaphael Isemann }
599379d19fSRaphael Isemann 
TEST_F(CppModuleConfigurationTest,Linux)609379d19fSRaphael Isemann TEST_F(CppModuleConfigurationTest, Linux) {
619379d19fSRaphael Isemann   // Test the average Linux configuration.
6299b7b41eSRaphael Isemann 
639379d19fSRaphael Isemann   std::string usr = "/usr/include";
6499b7b41eSRaphael Isemann   std::string libcpp = "/usr/include/c++/v1";
6599b7b41eSRaphael Isemann   std::vector<std::string> files = {// C library
6699b7b41eSRaphael Isemann                                     usr + "/stdio.h",
6799b7b41eSRaphael Isemann                                     // C++ library
6899b7b41eSRaphael Isemann                                     libcpp + "/vector",
6999b7b41eSRaphael Isemann                                     libcpp + "/module.modulemap"};
70*1aab5e65SPavel Kosov   CppModuleConfiguration config(makeFiles(files), llvm::Triple());
719379d19fSRaphael Isemann   EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
729379d19fSRaphael Isemann   EXPECT_THAT(config.GetIncludeDirs(),
739379d19fSRaphael Isemann               testing::ElementsAre(libcpp, ResourceInc(), usr));
749379d19fSRaphael Isemann }
759379d19fSRaphael Isemann 
TEST_F(CppModuleConfigurationTest,LinuxTargetSpecificInclude)76*1aab5e65SPavel Kosov TEST_F(CppModuleConfigurationTest, LinuxTargetSpecificInclude) {
77*1aab5e65SPavel Kosov   // Test the average Linux configuration.
78*1aab5e65SPavel Kosov 
79*1aab5e65SPavel Kosov   std::string usr = "/usr/include";
80*1aab5e65SPavel Kosov   std::string usr_target = "/usr/include/x86_64-linux-gnu";
81*1aab5e65SPavel Kosov   std::string libcpp = "/usr/include/c++/v1";
82*1aab5e65SPavel Kosov   std::string libcpp_target = "/usr/include/x86_64-unknown-linux-gnu/c++/v1";
83*1aab5e65SPavel Kosov   std::vector<std::string> files = {
84*1aab5e65SPavel Kosov       // C library
85*1aab5e65SPavel Kosov       usr + "/stdio.h", usr_target + "/sys/cdefs.h",
86*1aab5e65SPavel Kosov       // C++ library
87*1aab5e65SPavel Kosov       libcpp + "/vector", libcpp + "/module.modulemap"};
88*1aab5e65SPavel Kosov   CppModuleConfiguration config(makeFiles(files),
89*1aab5e65SPavel Kosov                                 llvm::Triple("x86_64-unknown-linux-gnu"));
90*1aab5e65SPavel Kosov   EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
91*1aab5e65SPavel Kosov   EXPECT_THAT(config.GetIncludeDirs(),
92*1aab5e65SPavel Kosov               testing::ElementsAre(libcpp, ResourceInc(), usr, usr_target,
93*1aab5e65SPavel Kosov                                    libcpp_target));
94*1aab5e65SPavel Kosov }
95*1aab5e65SPavel Kosov 
TEST_F(CppModuleConfigurationTest,Sysroot)969379d19fSRaphael Isemann TEST_F(CppModuleConfigurationTest, Sysroot) {
979379d19fSRaphael Isemann   // Test that having a sysroot for the whole system works fine.
9899b7b41eSRaphael Isemann 
999379d19fSRaphael Isemann   std::string libcpp = "/home/user/sysroot/usr/include/c++/v1";
1009379d19fSRaphael Isemann   std::string usr = "/home/user/sysroot/usr/include";
10199b7b41eSRaphael Isemann   std::vector<std::string> files = {// C library
10299b7b41eSRaphael Isemann                                     usr + "/stdio.h",
10399b7b41eSRaphael Isemann                                     // C++ library
10499b7b41eSRaphael Isemann                                     libcpp + "/vector",
10599b7b41eSRaphael Isemann                                     libcpp + "/module.modulemap"};
106*1aab5e65SPavel Kosov   CppModuleConfiguration config(makeFiles(files), llvm::Triple());
1079379d19fSRaphael Isemann   EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
1089379d19fSRaphael Isemann   EXPECT_THAT(config.GetIncludeDirs(),
1099379d19fSRaphael Isemann               testing::ElementsAre(libcpp, ResourceInc(), usr));
1109379d19fSRaphael Isemann }
1119379d19fSRaphael Isemann 
TEST_F(CppModuleConfigurationTest,LinuxLocalLibCpp)1129379d19fSRaphael Isemann TEST_F(CppModuleConfigurationTest, LinuxLocalLibCpp) {
1139379d19fSRaphael Isemann   // Test that a locally build libc++ is detected.
11499b7b41eSRaphael Isemann 
1159379d19fSRaphael Isemann   std::string usr = "/usr/include";
11699b7b41eSRaphael Isemann   std::string libcpp = "/home/user/llvm-build/include/c++/v1";
11799b7b41eSRaphael Isemann   std::vector<std::string> files = {// C library
11899b7b41eSRaphael Isemann                                     usr + "/stdio.h",
11999b7b41eSRaphael Isemann                                     // C++ library
12099b7b41eSRaphael Isemann                                     libcpp + "/vector",
12199b7b41eSRaphael Isemann                                     libcpp + "/module.modulemap"};
122*1aab5e65SPavel Kosov   CppModuleConfiguration config(makeFiles(files), llvm::Triple());
1239379d19fSRaphael Isemann   EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
1249379d19fSRaphael Isemann   EXPECT_THAT(config.GetIncludeDirs(),
1259379d19fSRaphael Isemann               testing::ElementsAre(libcpp, ResourceInc(), usr));
1269379d19fSRaphael Isemann }
1279379d19fSRaphael Isemann 
TEST_F(CppModuleConfigurationTest,UnrelatedLibrary)1289379d19fSRaphael Isemann TEST_F(CppModuleConfigurationTest, UnrelatedLibrary) {
1299379d19fSRaphael Isemann   // Test that having an unrelated library in /usr/include doesn't break.
13099b7b41eSRaphael Isemann 
1319379d19fSRaphael Isemann   std::string usr = "/usr/include";
13299b7b41eSRaphael Isemann   std::string libcpp = "/home/user/llvm-build/include/c++/v1";
13399b7b41eSRaphael Isemann   std::vector<std::string> files = {// C library
13499b7b41eSRaphael Isemann                                     usr + "/stdio.h",
13599b7b41eSRaphael Isemann                                     // unrelated library
13699b7b41eSRaphael Isemann                                     usr + "/boost/vector",
13799b7b41eSRaphael Isemann                                     // C++ library
13899b7b41eSRaphael Isemann                                     libcpp + "/vector",
13999b7b41eSRaphael Isemann                                     libcpp + "/module.modulemap"};
140*1aab5e65SPavel Kosov   CppModuleConfiguration config(makeFiles(files), llvm::Triple());
1419379d19fSRaphael Isemann   EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
1429379d19fSRaphael Isemann   EXPECT_THAT(config.GetIncludeDirs(),
1439379d19fSRaphael Isemann               testing::ElementsAre(libcpp, ResourceInc(), usr));
1449379d19fSRaphael Isemann }
1459379d19fSRaphael Isemann 
TEST_F(CppModuleConfigurationTest,UnrelatedLibraryWithTargetSpecificInclude)146*1aab5e65SPavel Kosov TEST_F(CppModuleConfigurationTest, UnrelatedLibraryWithTargetSpecificInclude) {
147*1aab5e65SPavel Kosov   // Test that having an unrelated library in /usr/include doesn't break.
148*1aab5e65SPavel Kosov 
149*1aab5e65SPavel Kosov   std::string usr = "/usr/include";
150*1aab5e65SPavel Kosov   std::string libcpp = "/home/user/llvm-build/include/c++/v1";
151*1aab5e65SPavel Kosov   std::string libcpp_target =
152*1aab5e65SPavel Kosov       "/home/user/llvm-build/include/x86_64-unknown-linux-gnu/c++/v1";
153*1aab5e65SPavel Kosov   std::vector<std::string> files = {// C library
154*1aab5e65SPavel Kosov                                     usr + "/stdio.h",
155*1aab5e65SPavel Kosov                                     // unrelated library
156*1aab5e65SPavel Kosov                                     usr + "/boost/vector",
157*1aab5e65SPavel Kosov                                     // C++ library
158*1aab5e65SPavel Kosov                                     libcpp + "/vector",
159*1aab5e65SPavel Kosov                                     libcpp + "/module.modulemap"};
160*1aab5e65SPavel Kosov   CppModuleConfiguration config(makeFiles(files),
161*1aab5e65SPavel Kosov                                 llvm::Triple("x86_64-unknown-linux-gnu"));
162*1aab5e65SPavel Kosov   EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
163*1aab5e65SPavel Kosov   EXPECT_THAT(config.GetIncludeDirs(),
164*1aab5e65SPavel Kosov               testing::ElementsAre(libcpp, ResourceInc(), usr, libcpp_target));
165*1aab5e65SPavel Kosov }
166*1aab5e65SPavel Kosov 
TEST_F(CppModuleConfigurationTest,Xcode)1679379d19fSRaphael Isemann TEST_F(CppModuleConfigurationTest, Xcode) {
1689379d19fSRaphael Isemann   // Test detection of libc++ coming from Xcode with generic platform names.
16999b7b41eSRaphael Isemann 
1709379d19fSRaphael Isemann   std::string p = "/Applications/Xcode.app/Contents/Developer/";
1719379d19fSRaphael Isemann   std::string libcpp = p + "Toolchains/B.xctoolchain/usr/include/c++/v1";
1729379d19fSRaphael Isemann   std::string usr =
1739379d19fSRaphael Isemann       p + "Platforms/A.platform/Developer/SDKs/OSVers.sdk/usr/include";
17499b7b41eSRaphael Isemann   std::vector<std::string> files = {
17599b7b41eSRaphael Isemann       // C library
17699b7b41eSRaphael Isemann       usr + "/stdio.h",
17799b7b41eSRaphael Isemann       // C++ library
17899b7b41eSRaphael Isemann       libcpp + "/vector",
17999b7b41eSRaphael Isemann       libcpp + "/module.modulemap",
18099b7b41eSRaphael Isemann   };
181*1aab5e65SPavel Kosov   CppModuleConfiguration config(makeFiles(files), llvm::Triple());
1829379d19fSRaphael Isemann   EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
1839379d19fSRaphael Isemann   EXPECT_THAT(config.GetIncludeDirs(),
1849379d19fSRaphael Isemann               testing::ElementsAre(libcpp, ResourceInc(), usr));
1859379d19fSRaphael Isemann }
1869379d19fSRaphael Isemann 
TEST_F(CppModuleConfigurationTest,LibCppV2)1879379d19fSRaphael Isemann TEST_F(CppModuleConfigurationTest, LibCppV2) {
1889379d19fSRaphael Isemann   // Test that a "v2" of libc++ is still correctly detected.
18999b7b41eSRaphael Isemann 
19099b7b41eSRaphael Isemann   std::string libcpp = "/usr/include/c++/v2";
19199b7b41eSRaphael Isemann   std::vector<std::string> files = {// C library
19299b7b41eSRaphael Isemann                                     "/usr/include/stdio.h",
19399b7b41eSRaphael Isemann                                     // C++ library
19499b7b41eSRaphael Isemann                                     libcpp + "/vector",
19599b7b41eSRaphael Isemann                                     libcpp + "/module.modulemap"};
196*1aab5e65SPavel Kosov   CppModuleConfiguration config(makeFiles(files), llvm::Triple());
1979379d19fSRaphael Isemann   EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
1989379d19fSRaphael Isemann   EXPECT_THAT(config.GetIncludeDirs(),
1999379d19fSRaphael Isemann               testing::ElementsAre("/usr/include/c++/v2", ResourceInc(),
2009379d19fSRaphael Isemann                                    "/usr/include"));
2019379d19fSRaphael Isemann }
2029379d19fSRaphael Isemann 
TEST_F(CppModuleConfigurationTest,UnknownLibCppFile)2039379d19fSRaphael Isemann TEST_F(CppModuleConfigurationTest, UnknownLibCppFile) {
2049379d19fSRaphael Isemann   // Test that having some unknown file in the libc++ path doesn't break
2059379d19fSRaphael Isemann   // anything.
20699b7b41eSRaphael Isemann 
20799b7b41eSRaphael Isemann   std::string libcpp = "/usr/include/c++/v1";
20899b7b41eSRaphael Isemann   std::vector<std::string> files = {// C library
20999b7b41eSRaphael Isemann                                     "/usr/include/stdio.h",
21099b7b41eSRaphael Isemann                                     // C++ library
21199b7b41eSRaphael Isemann                                     libcpp + "/non_existing_file",
21299b7b41eSRaphael Isemann                                     libcpp + "/module.modulemap",
21399b7b41eSRaphael Isemann                                     libcpp + "/vector"};
214*1aab5e65SPavel Kosov   CppModuleConfiguration config(makeFiles(files), llvm::Triple());
2159379d19fSRaphael Isemann   EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
2169379d19fSRaphael Isemann   EXPECT_THAT(config.GetIncludeDirs(),
2179379d19fSRaphael Isemann               testing::ElementsAre("/usr/include/c++/v1", ResourceInc(),
2189379d19fSRaphael Isemann                                    "/usr/include"));
2199379d19fSRaphael Isemann }
2209379d19fSRaphael Isemann 
TEST_F(CppModuleConfigurationTest,MissingUsrInclude)2219379d19fSRaphael Isemann TEST_F(CppModuleConfigurationTest, MissingUsrInclude) {
2229379d19fSRaphael Isemann   // Test that we don't load 'std' if we can't find the C standard library.
22399b7b41eSRaphael Isemann 
22499b7b41eSRaphael Isemann   std::string libcpp = "/usr/include/c++/v1";
22599b7b41eSRaphael Isemann   std::vector<std::string> files = {// C++ library
22699b7b41eSRaphael Isemann                                     libcpp + "/vector",
22799b7b41eSRaphael Isemann                                     libcpp + "/module.modulemap"};
228*1aab5e65SPavel Kosov   CppModuleConfiguration config(makeFiles(files), llvm::Triple());
2299379d19fSRaphael Isemann   EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre());
2309379d19fSRaphael Isemann   EXPECT_THAT(config.GetIncludeDirs(), testing::ElementsAre());
2319379d19fSRaphael Isemann }
2329379d19fSRaphael Isemann 
TEST_F(CppModuleConfigurationTest,MissingLibCpp)2339379d19fSRaphael Isemann TEST_F(CppModuleConfigurationTest, MissingLibCpp) {
2349379d19fSRaphael Isemann   // Test that we don't load 'std' if we don't have a libc++.
23599b7b41eSRaphael Isemann 
23699b7b41eSRaphael Isemann   std::string usr = "/usr/include";
23799b7b41eSRaphael Isemann   std::vector<std::string> files = {
23899b7b41eSRaphael Isemann       // C library
23999b7b41eSRaphael Isemann       usr + "/stdio.h",
24099b7b41eSRaphael Isemann   };
241*1aab5e65SPavel Kosov   CppModuleConfiguration config(makeFiles(files), llvm::Triple());
2429379d19fSRaphael Isemann   EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre());
2439379d19fSRaphael Isemann   EXPECT_THAT(config.GetIncludeDirs(), testing::ElementsAre());
2449379d19fSRaphael Isemann }
2459379d19fSRaphael Isemann 
TEST_F(CppModuleConfigurationTest,IgnoreLibStdCpp)2469379d19fSRaphael Isemann TEST_F(CppModuleConfigurationTest, IgnoreLibStdCpp) {
2479379d19fSRaphael Isemann   // Test that we don't do anything bad when we encounter libstdc++ paths.
24899b7b41eSRaphael Isemann 
24999b7b41eSRaphael Isemann   std::string usr = "/usr/include";
25099b7b41eSRaphael Isemann   std::vector<std::string> files = {
25199b7b41eSRaphael Isemann       // C library
25299b7b41eSRaphael Isemann       usr + "/stdio.h",
25399b7b41eSRaphael Isemann       // C++ library
25499b7b41eSRaphael Isemann       usr + "/c++/8.0.1/vector",
25599b7b41eSRaphael Isemann   };
256*1aab5e65SPavel Kosov   CppModuleConfiguration config(makeFiles(files), llvm::Triple());
2579379d19fSRaphael Isemann   EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre());
2589379d19fSRaphael Isemann   EXPECT_THAT(config.GetIncludeDirs(), testing::ElementsAre());
2599379d19fSRaphael Isemann }
2609379d19fSRaphael Isemann 
TEST_F(CppModuleConfigurationTest,AmbiguousCLib)2619379d19fSRaphael Isemann TEST_F(CppModuleConfigurationTest, AmbiguousCLib) {
2629379d19fSRaphael Isemann   // Test that we don't do anything when we are not sure where the
2639379d19fSRaphael Isemann   // right C standard library is.
26499b7b41eSRaphael Isemann 
26599b7b41eSRaphael Isemann   std::string usr1 = "/usr/include";
26699b7b41eSRaphael Isemann   std::string usr2 = "/usr/include/other/path";
26799b7b41eSRaphael Isemann   std::string libcpp = usr1 + "c++/v1";
26899b7b41eSRaphael Isemann   std::vector<std::string> files = {
26999b7b41eSRaphael Isemann       // First C library
27099b7b41eSRaphael Isemann       usr1 + "/stdio.h",
27199b7b41eSRaphael Isemann       // Second C library
27299b7b41eSRaphael Isemann       usr2 + "/stdio.h",
27399b7b41eSRaphael Isemann       // C++ library
27499b7b41eSRaphael Isemann       libcpp + "/vector",
27599b7b41eSRaphael Isemann       libcpp + "/module.modulemap",
27699b7b41eSRaphael Isemann   };
277*1aab5e65SPavel Kosov   CppModuleConfiguration config(makeFiles(files), llvm::Triple());
2789379d19fSRaphael Isemann   EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre());
2799379d19fSRaphael Isemann   EXPECT_THAT(config.GetIncludeDirs(), testing::ElementsAre());
2809379d19fSRaphael Isemann }
2819379d19fSRaphael Isemann 
TEST_F(CppModuleConfigurationTest,AmbiguousLibCpp)2829379d19fSRaphael Isemann TEST_F(CppModuleConfigurationTest, AmbiguousLibCpp) {
2839379d19fSRaphael Isemann   // Test that we don't do anything when we are not sure where the
2849379d19fSRaphael Isemann   // right libc++ is.
28599b7b41eSRaphael Isemann 
28699b7b41eSRaphael Isemann   std::string usr = "/usr/include";
28799b7b41eSRaphael Isemann   std::string libcpp1 = usr + "c++/v1";
28899b7b41eSRaphael Isemann   std::string libcpp2 = usr + "c++/v2";
28999b7b41eSRaphael Isemann   std::vector<std::string> files = {
29099b7b41eSRaphael Isemann       // C library
29199b7b41eSRaphael Isemann       usr + "/stdio.h",
29299b7b41eSRaphael Isemann       // First C++ library
29399b7b41eSRaphael Isemann       libcpp1 + "/vector",
29499b7b41eSRaphael Isemann       libcpp1 + "/module.modulemap",
29599b7b41eSRaphael Isemann       // Second C++ library
29699b7b41eSRaphael Isemann       libcpp2 + "/vector",
29799b7b41eSRaphael Isemann       libcpp2 + "/module.modulemap",
29899b7b41eSRaphael Isemann   };
299*1aab5e65SPavel Kosov   CppModuleConfiguration config(makeFiles(files), llvm::Triple());
3009379d19fSRaphael Isemann   EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre());
3019379d19fSRaphael Isemann   EXPECT_THAT(config.GetIncludeDirs(), testing::ElementsAre());
3029379d19fSRaphael Isemann }
303