Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/ExternalDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if(BUILD_MQT_CORE_MLIR)
FetchContent_Declare(
jeff-mlir
GIT_REPOSITORY https://github.com/unitaryfoundation/jeff-mlir.git
GIT_TAG 4732c4f12047e8cbf1890c79e90e30110e6588e2
GIT_TAG 316eab7fab26d80a38278c8bf2ac2d249bda81a1
EXCLUDE_FROM_ALL)
block()
# Cap'n Proto, which is fetched transitively by jeff-mlir, uses the generic BUILD_TESTING option
Expand Down
14 changes: 14 additions & 0 deletions mlir/unittests/Compiler/test_compiler_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
#include "qco_programs.h"
#include "qir_programs.h"

#include <capnp/message.h>
#include <capnp/serialize.h>
#include <gtest/gtest.h>
#include <jeff.capnp.h>
#include <jeff/IR/JeffDialect.h>
#include <jeff/IR/JeffOps.h>
#include <llvm/ADT/APFloat.h>
Expand Down Expand Up @@ -75,6 +78,7 @@
#include <iterator>
#include <memory>
#include <optional>
#include <span>
#include <string>
#include <utility>
#include <variant>
Expand All @@ -87,6 +91,8 @@ using namespace mlir::qc;
using namespace mlir::qco;
using namespace mlir::qir;

namespace jeff = mlir::jeff;

using QCProgramBuilderFn = NamedMLIRBuilder<QCProgramBuilder>;
using QIRProgramBuilderFn = NamedMLIRBuilder<QIRProgramBuilder>;

Expand Down Expand Up @@ -1481,6 +1487,14 @@ TEST_F(CompilerPipelineTest, JeffRejectsMutableClassicalHelperArguments) {
EXPECT_FALSE(std::move(*qco).intoJeff());
}

TEST_F(CompilerPipelineTest, RejectsJeffModuleWithoutFunctions) {
capnp::MallocMessageBuilder message;
message.initRoot<::jeff::Module>().setVersionMinor(3);
auto words = capnp::messageToFlatArray(message);
EXPECT_FALSE(JeffProgram::fromBytes(
std::as_bytes(std::span(words.begin(), words.size()))));
}

// Test: jeff programs round-trip through their binary APIs.
TEST_F(CompilerPipelineTest, JeffProgramsRoundTripThroughBytesAndFiles) {
const std::string qasm = R"(OPENQASM 3.0;
Expand Down
Loading