summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/tools/llvm-exegesis/BenchmarkRunnerTest.cpp
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2018-08-01 14:41:45 +0000
committerGuillaume Chatelet <gchatelet@google.com>2018-08-01 14:41:45 +0000
commitfb94354d2dbee7628770b8b75b8289fa8d225ef3 (patch)
tree37cd240911a715166dc635311122985a7d05e614 /llvm/unittests/tools/llvm-exegesis/BenchmarkRunnerTest.cpp
parentc8e3924b3b8aacbcd089530e5fe8c1b463177780 (diff)
downloadbcm5719-llvm-fb94354d2dbee7628770b8b75b8289fa8d225ef3.tar.gz
bcm5719-llvm-fb94354d2dbee7628770b8b75b8289fa8d225ef3.zip
[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
Diffstat (limited to 'llvm/unittests/tools/llvm-exegesis/BenchmarkRunnerTest.cpp')
-rw-r--r--llvm/unittests/tools/llvm-exegesis/BenchmarkRunnerTest.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/unittests/tools/llvm-exegesis/BenchmarkRunnerTest.cpp b/llvm/unittests/tools/llvm-exegesis/BenchmarkRunnerTest.cpp
new file mode 100644
index 00000000000..05b36a31b9e
--- /dev/null
+++ b/llvm/unittests/tools/llvm-exegesis/BenchmarkRunnerTest.cpp
@@ -0,0 +1,31 @@
+//===-- 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
OpenPOWER on IntegriCloud