diff --git a/cmake/ExternalDependencies.cmake b/cmake/ExternalDependencies.cmake index 272d224822..8294ed8bbe 100644 --- a/cmake/ExternalDependencies.cmake +++ b/cmake/ExternalDependencies.cmake @@ -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 diff --git a/mlir/unittests/Compiler/test_compiler_pipeline.cpp b/mlir/unittests/Compiler/test_compiler_pipeline.cpp index 25c2a3454a..24673a0ae6 100644 --- a/mlir/unittests/Compiler/test_compiler_pipeline.cpp +++ b/mlir/unittests/Compiler/test_compiler_pipeline.cpp @@ -31,7 +31,10 @@ #include "qco_programs.h" #include "qir_programs.h" +#include +#include #include +#include #include #include #include @@ -75,6 +78,7 @@ #include #include #include +#include #include #include #include @@ -87,6 +91,8 @@ using namespace mlir::qc; using namespace mlir::qco; using namespace mlir::qir; +namespace jeff = mlir::jeff; + using QCProgramBuilderFn = NamedMLIRBuilder; using QIRProgramBuilderFn = NamedMLIRBuilder; @@ -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;