LazyEmittingLayerTest.cpp 939 B

12345678910111213141516171819202122232425262728293031
  1. //===- LazyEmittingLayerTest.cpp - Unit tests for the lazy emitting layer -===//
  2. //
  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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #include "llvm/ExecutionEngine/Orc/LazyEmittingLayer.h"
  9. #include "llvm/ExecutionEngine/RuntimeDyld.h"
  10. #include "gtest/gtest.h"
  11. namespace {
  12. struct MockBaseLayer {
  13. typedef int ModuleHandleT;
  14. ModuleHandleT addModule(llvm::orc::VModuleKey,
  15. std::shared_ptr<llvm::Module>) {
  16. return 42;
  17. }
  18. };
  19. TEST(LazyEmittingLayerTest, Empty) {
  20. MockBaseLayer M;
  21. llvm::orc::LazyEmittingLayer<MockBaseLayer> L(
  22. llvm::AcknowledgeORCv1Deprecation, M);
  23. cantFail(
  24. L.addModule(llvm::orc::VModuleKey(), std::unique_ptr<llvm::Module>()));
  25. }
  26. }