36#include <gtest/gtest.h>
50 "import \"math.aw\";\n"
51 "let answer = add(40, 2);\n"});
66 Compiler_Driver_Action::Run));
71 " add = Function(add)\n"
72 " answer = Int(42)\n");
74 const auto * hir =
driver.find_artifact(
"hir");
76 EXPECT_NE(hir->text.find(
"HIRModule"), std::string::npos);
77 const auto * order =
driver.find_artifact(
"imports.order");
83 const auto *
surface =
driver.find_artifact(
"modules.surface");
89 const auto *
linkage =
driver.find_artifact(
"modules.linkage");
93 EXPECT_NE(
linkage->text.find(
"Visible(Function(add)) from math.aw imported"),
97 const auto * binding =
driver.find_artifact(
"modules.binding");
99 EXPECT_NE(binding->text.find(
"ModuleBindings"), std::string::npos);
100 EXPECT_NE(binding->text.find(
"Bind(Function(add)) -> math.aw imported"),
102 EXPECT_NE(binding->text.find(
"Bind(Global(answer)) -> main.aw local"),
104 const auto * names =
driver.find_artifact(
"modules.names");
106 EXPECT_NE(names->text.find(
"ModuleNameTable"), std::string::npos);
107 EXPECT_NE(names->text.find(
"Name(Function(add)) -> math.aw imported"),
127 Compiler_Driver_Action::Emit_Bytecode));
137 options.c_backend_options.emit_main =
true;
141 Compiler_Driver_Action::Emit_C));
154 "let crash = 1 / 0;\n"});
167 EXPECT_NE(
messages->text.find(
"run: HIR runtime execution failed: RUN007 division by zero"),
Reusable pipeline driver that operates on any Compiler_Frontend.
Reference frontend adapter that exposes the existing MVP language through Compiler_Frontend.
Reusable orchestration object built on top of Compiler_Frontend.
Compiler_Frontend implementation backed by the current MVP language stack.
T & append()
Allocate a new entry to the end of array.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
static struct argp_option options[]
std::string module_name
Prefix used to derive stable C identifiers.
Configuration shared by all runs of Compiler_Generic_Driver.
Compiler_C_Backend_Options c_backend_options
Backend-C emission options used by emit-c.