Clang Project

clang_source_code/unittests/Driver/ModuleCacheTest.cpp
1//===- unittests/Driver/ModuleCacheTest.cpp -------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Unit tests for the LLDB module cache API.
10//
11//===----------------------------------------------------------------------===//
12
13#include "clang/Driver/Driver.h"
14#include "gtest/gtest.h"
15using namespace clang;
16using namespace clang::driver;
17
18namespace {
19
20TEST(ModuleCacheTest, GetTargetAndMode) {
21  SmallString<128Buf;
22  Driver::getDefaultModuleCachePath(Buf);
23  StringRef Path = Buf;
24  EXPECT_TRUE(Path.find("org.llvm.clang") != Path.npos);
25  EXPECT_TRUE(Path.endswith("ModuleCache"));  
26}
27// end anonymous namespace.
28