[docs] Fix build-docs.sh
[llvm-project.git] / llvm / unittests / tools / llvm-exegesis / BenchmarkRunnerTest.cpp
blob9414a48c989e4e91a6ef6b3ef1bf41e97c02289b
1 //===-- BenchmarkRunnerTest.cpp ---------------------------------*- C++ -*-===//
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 //===----------------------------------------------------------------------===//
9 #include "BenchmarkRunner.h"
10 #include "gmock/gmock.h"
11 #include "gtest/gtest.h"
13 namespace llvm {
14 namespace exegesis {
16 namespace {
18 TEST(ScratchSpaceTest, Works) {
19 BenchmarkRunner::ScratchSpace Space;
20 EXPECT_EQ(reinterpret_cast<intptr_t>(Space.ptr()) %
21 BenchmarkRunner::ScratchSpace::kAlignment,
22 0u);
23 Space.ptr()[0] = 42;
24 Space.ptr()[BenchmarkRunner::ScratchSpace::kSize - 1] = 43;
25 Space.clear();
26 EXPECT_EQ(Space.ptr()[0], 0);
27 EXPECT_EQ(Space.ptr()[BenchmarkRunner::ScratchSpace::kSize - 1], 0);
30 } // namespace
31 } // namespace exegesis
32 } // namespace llvm