1 //===-- BenchmarkRunnerTest.cpp ---------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #include "BenchmarkRunner.h"
10 #include "gmock/gmock.h"
11 #include "gtest/gtest.h"
18 TEST(ScratchSpaceTest
, Works
) {
19 BenchmarkRunner::ScratchSpace Space
;
20 EXPECT_EQ(reinterpret_cast<intptr_t>(Space
.ptr()) %
21 BenchmarkRunner::ScratchSpace::kAlignment
,
24 Space
.ptr()[BenchmarkRunner::ScratchSpace::kSize
- 1] = 43;
26 EXPECT_EQ(Space
.ptr()[0], 0);
27 EXPECT_EQ(Space
.ptr()[BenchmarkRunner::ScratchSpace::kSize
- 1], 0);
31 } // namespace exegesis