<div dir="ltr">Thanks Dave!<div><br></div><div>- Lang.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 22, 2015 at 4:36 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: dblaikie<br>
Date: Sun Feb 22 18:36:25 2015<br>
New Revision: 230196<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=230196&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=230196&view=rev</a><br>
Log:<br>
[orc] Add a trivial unit test to get the ball rolling<br>
<br>
I made my best guess at the Makefile, since I don't have a make build.<br>
<br>
I'm not sure if it should be valid to add an empty list of things, but<br>
it seemed the sort of degenerate case.<br>
<br>
Added:<br>
    llvm/trunk/unittests/ExecutionEngine/Orc/<br>
    llvm/trunk/unittests/ExecutionEngine/Orc/CMakeLists.txt<br>
    llvm/trunk/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp<br>
    llvm/trunk/unittests/ExecutionEngine/Orc/Makefile<br>
      - copied, changed from r230193, llvm/trunk/unittests/ExecutionEngine/Makefile<br>
Modified:<br>
    llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h<br>
    llvm/trunk/unittests/ExecutionEngine/CMakeLists.txt<br>
    llvm/trunk/unittests/ExecutionEngine/Makefile<br>
<br>
Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h?rev=230196&r1=230195&r2=230196&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h?rev=230196&r1=230195&r2=230196&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h (original)<br>
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h Sun Feb 22 18:36:25 2015<br>
@@ -19,6 +19,7 @@<br>
 #include "llvm/ExecutionEngine/RTDyldMemoryManager.h"<br>
 #include "llvm/IR/GlobalValue.h"<br>
 #include "llvm/IR/Mangler.h"<br>
+#include "llvm/IR/Module.h"<br>
 #include "llvm/ADT/StringMap.h"<br>
 #include <list><br>
<br>
<br>
Modified: llvm/trunk/unittests/ExecutionEngine/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/CMakeLists.txt?rev=230196&r1=230195&r2=230196&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/CMakeLists.txt?rev=230196&r1=230195&r2=230196&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/ExecutionEngine/CMakeLists.txt (original)<br>
+++ llvm/trunk/unittests/ExecutionEngine/CMakeLists.txt Sun Feb 22 18:36:25 2015<br>
@@ -3,6 +3,7 @@ set(LLVM_LINK_COMPONENTS<br>
   ExecutionEngine<br>
   Interpreter<br>
   MC<br>
+  OrcJIT<br>
   RuntimeDyld<br>
   Support<br>
   )<br>
@@ -11,6 +12,8 @@ add_llvm_unittest(ExecutionEngineTests<br>
   ExecutionEngineTest.cpp<br>
   )<br>
<br>
+add_subdirectory(Orc)<br>
+<br>
 # Include MCJIT tests only if native arch is a built JIT target.<br>
 list(FIND LLVM_TARGETS_TO_BUILD "${LLVM_NATIVE_ARCH}" build_idx)<br>
 list(FIND LLVM_TARGETS_WITH_JIT "${LLVM_NATIVE_ARCH}" jit_idx)<br>
<br>
Modified: llvm/trunk/unittests/ExecutionEngine/Makefile<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/Makefile?rev=230196&r1=230195&r2=230196&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/Makefile?rev=230196&r1=230195&r2=230196&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/ExecutionEngine/Makefile (original)<br>
+++ llvm/trunk/unittests/ExecutionEngine/Makefile Sun Feb 22 18:36:25 2015<br>
@@ -13,8 +13,10 @@ LINK_COMPONENTS :=interpreter<br>
<br>
 include $(LEVEL)/Makefile.config<br>
<br>
+PARALLEL_DIRS = Orc<br>
+<br>
 ifeq ($(TARGET_HAS_JIT),1)<br>
-  PARALLEL_DIRS = MCJIT<br>
+  PARALLEL_DIRS = $(PARALLEL_DIRS) MCJIT<br>
 endif<br>
<br>
 include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest<br>
<br>
Added: llvm/trunk/unittests/ExecutionEngine/Orc/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/Orc/CMakeLists.txt?rev=230196&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/Orc/CMakeLists.txt?rev=230196&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/ExecutionEngine/Orc/CMakeLists.txt (added)<br>
+++ llvm/trunk/unittests/ExecutionEngine/Orc/CMakeLists.txt Sun Feb 22 18:36:25 2015<br>
@@ -0,0 +1,8 @@<br>
+set(LLVM_LINK_COMPONENTS<br>
+  Core<br>
+  Support<br>
+  )<br>
+<br>
+add_llvm_unittest(OrcJITTests<br>
+  LazyEmittingLayerTest.cpp<br>
+  )<br>
<br>
Added: llvm/trunk/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp?rev=230196&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp?rev=230196&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp (added)<br>
+++ llvm/trunk/unittests/ExecutionEngine/Orc/LazyEmittingLayerTest.cpp Sun Feb 22 18:36:25 2015<br>
@@ -0,0 +1,30 @@<br>
+//===- LazyEmittingLayerTest.cpp - Unit tests for the lazy emitting layer -===//<br>
+//<br>
+//                     The LLVM Compiler Infrastructure<br>
+//<br>
+// This file is distributed under the University of Illinois Open Source<br>
+// License. See LICENSE.TXT for details.<br>
+//<br>
+//===----------------------------------------------------------------------===//<br>
+<br>
+#include "llvm/ExecutionEngine/Orc/LazyEmittingLayer.h"<br>
+#include "gtest/gtest.h"<br>
+<br>
+namespace {<br>
+<br>
+struct MockBaseLayer {<br>
+  typedef int ModuleSetHandleT;<br>
+  ModuleSetHandleT addModuleSet(std::list<std::unique_ptr<llvm::Module>>,<br>
+                                std::unique_ptr<llvm::RTDyldMemoryManager> x) {<br>
+    EXPECT_FALSE(x);<br>
+    return 42;<br>
+  }<br>
+};<br>
+<br>
+TEST(LazyEmittingLayerTest, Empty) {<br>
+  MockBaseLayer M;<br>
+  llvm::orc::LazyEmittingLayer<MockBaseLayer> L(M);<br>
+  L.addModuleSet(std::list<std::unique_ptr<llvm::Module>>(), nullptr);<br>
+}<br>
+<br>
+}<br>
<br>
Copied: llvm/trunk/unittests/ExecutionEngine/Orc/Makefile (from r230193, llvm/trunk/unittests/ExecutionEngine/Makefile)<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/Orc/Makefile?p2=llvm/trunk/unittests/ExecutionEngine/Orc/Makefile&p1=llvm/trunk/unittests/ExecutionEngine/Makefile&r1=230193&r2=230196&rev=230196&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/Orc/Makefile?p2=llvm/trunk/unittests/ExecutionEngine/Orc/Makefile&p1=llvm/trunk/unittests/ExecutionEngine/Makefile&r1=230193&r2=230196&rev=230196&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/ExecutionEngine/Makefile (original)<br>
+++ llvm/trunk/unittests/ExecutionEngine/Orc/Makefile Sun Feb 22 18:36:25 2015<br>
@@ -1,4 +1,4 @@<br>
-##===- unittests/ExecutionEngine/Makefile ------------------*- Makefile -*-===##<br>
+##===- unittests/ExecutionEngine/Orc/Makefile --------------*- Makefile -*-===##<br>
 #<br>
 #                     The LLVM Compiler Infrastructure<br>
 #<br>
@@ -7,14 +7,10 @@<br>
 #<br>
 ##===----------------------------------------------------------------------===##<br>
<br>
-LEVEL = ../..<br>
-TESTNAME = ExecutionEngine<br>
-LINK_COMPONENTS :=interpreter<br>
+LEVEL = ../../..<br>
+TESTNAME = OrcJIT<br>
+LINK_COMPONENTS := core ipo mcjit orcjit native support<br>
<br>
 include $(LEVEL)/Makefile.config<br>
-<br>
-ifeq ($(TARGET_HAS_JIT),1)<br>
-  PARALLEL_DIRS = MCJIT<br>
-endif<br>
-<br>
 include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest<br>
+<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>