xref: /llvm-project/clang/unittests/Driver/ModuleCacheTest.cpp (revision 01d5cbe2ea396abb64b9f44dc255931d6255d246)
1 //===- unittests/Driver/ModuleCacheTest.cpp -------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Unit tests for the LLDB module cache API.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "clang/Driver/Driver.h"
15 #include "gtest/gtest.h"
16 using namespace clang;
17 using namespace clang::driver;
18 
19 namespace {
20 
21 TEST(ModuleCacheTest, GetTargetAndMode) {
22   SmallString<128> Buf;
23   Driver::getDefaultModuleCachePath(Buf);
24   StringRef Path = Buf;
25   EXPECT_TRUE(Path.find("org.llvm.clang") != Path.npos);
26   EXPECT_TRUE(Path.endswith("ModuleCache"));
27 }
28 } // end anonymous namespace.
29