1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/unittests/tools/llvm-exegesis/BenchmarkRunnerTest.cpp
Guillaume Chatelet 4d60477cbd [llvm-exegesis] Provide a way to handle memory instructions.
Summary:
And implement memory instructions on X86.

This fixes PR36906.

Reviewers: gchatelet

Reviewed By: gchatelet

Subscribers: lebedev.ri, filcab, mgorny, tschuett, RKSimon, llvm-commits

Differential Revision: https://reviews.llvm.org/D48935

llvm-svn: 338567
2018-08-01 14:41:45 +00:00

32 lines
905 B
C++

//===-- BenchmarkRunnerTest.cpp ---------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "BenchmarkRunner.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
namespace exegesis {
namespace {
TEST(ScratchSpaceTest, Works) {
BenchmarkRunner::ScratchSpace Space;
EXPECT_EQ(reinterpret_cast<intptr_t>(Space.ptr()) %
BenchmarkRunner::ScratchSpace::kAlignment,
0u);
Space.ptr()[0] = 42;
Space.ptr()[BenchmarkRunner::ScratchSpace::kSize - 1] = 43;
Space.clear();
EXPECT_EQ(Space.ptr()[0], 0);
EXPECT_EQ(Space.ptr()[BenchmarkRunner::ScratchSpace::kSize - 1], 0);
}
} // namespace
} // namespace exegesis