From 67c32a98315f785a9ec9d531c1f571a0196c7463 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 18 Jan 2015 16:17:27 +0000 Subject: Vendor import of llvm RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1): https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_360/rc1@226102 --- unittests/Support/StreamingMemoryObject.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 unittests/Support/StreamingMemoryObject.cpp (limited to 'unittests/Support/StreamingMemoryObject.cpp') diff --git a/unittests/Support/StreamingMemoryObject.cpp b/unittests/Support/StreamingMemoryObject.cpp new file mode 100644 index 0000000000000..20136491ab8bd --- /dev/null +++ b/unittests/Support/StreamingMemoryObject.cpp @@ -0,0 +1,29 @@ +//===- llvm/unittest/Support/StreamingMemoryObject.cpp - unit tests -------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "llvm/Support/StreamingMemoryObject.h" +#include "gtest/gtest.h" +#include + +using namespace llvm; + +namespace { +class NullDataStreamer : public DataStreamer { + size_t GetBytes(unsigned char *buf, size_t len) override { + memset(buf, 0, len); + return len; + } +}; +} + +TEST(StreamingMemoryObject, Test) { + auto *DS = new NullDataStreamer(); + StreamingMemoryObject O(DS); + EXPECT_TRUE(O.isValidAddress(32 * 1024)); +} -- cgit v1.2.3