mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 16:51:53 +03:00
Merge pull request #2542 from rtfeldman/i/2535
Monomorphize records with same layout, but different field order, correctly
This commit is contained in:
commit
5fec87dc2a
@ -580,7 +580,7 @@ impl<
|
||||
}
|
||||
let base_offset = self.claim_stack_area(sym, struct_size);
|
||||
|
||||
if let Layout::Struct(field_layouts) = layout {
|
||||
if let Layout::Struct { field_layouts, .. } = layout {
|
||||
let mut current_offset = base_offset;
|
||||
for (field, field_layout) in fields.iter().zip(field_layouts.iter()) {
|
||||
self.copy_symbol_to_stack_offset(buf, current_offset, field, field_layout);
|
||||
|
@ -374,7 +374,9 @@ fn build_transform_caller_help<'a, 'ctx, 'env>(
|
||||
}
|
||||
|
||||
match closure_data_layout.runtime_representation() {
|
||||
Layout::Struct(&[]) => {
|
||||
Layout::Struct {
|
||||
field_layouts: &[], ..
|
||||
} => {
|
||||
// nothing to add
|
||||
}
|
||||
other => {
|
||||
@ -694,7 +696,9 @@ pub fn build_compare_wrapper<'a, 'ctx, 'env>(
|
||||
let default = [value1.into(), value2.into()];
|
||||
|
||||
let arguments_cast = match closure_data_layout.runtime_representation() {
|
||||
Layout::Struct(&[]) => {
|
||||
Layout::Struct {
|
||||
field_layouts: &[], ..
|
||||
} => {
|
||||
// nothing to add
|
||||
&default
|
||||
}
|
||||
|
@ -714,8 +714,7 @@ fn promote_to_main_function<'a, 'ctx, 'env>(
|
||||
);
|
||||
|
||||
// NOTE fake layout; it is only used for debug prints
|
||||
let roc_main_fn =
|
||||
function_value_by_func_spec(env, *func_spec, symbol, &[], &Layout::Struct(&[]));
|
||||
let roc_main_fn = function_value_by_func_spec(env, *func_spec, symbol, &[], &Layout::UNIT);
|
||||
|
||||
let main_fn_name = "$Test.main";
|
||||
|
||||
@ -1188,8 +1187,8 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
|
||||
|
||||
// extract field from a record
|
||||
match (value, layout) {
|
||||
(StructValue(argument), Layout::Struct(fields)) => {
|
||||
debug_assert!(!fields.is_empty());
|
||||
(StructValue(argument), Layout::Struct { field_layouts, .. }) => {
|
||||
debug_assert!(!field_layouts.is_empty());
|
||||
|
||||
let field_value = env
|
||||
.builder
|
||||
@ -1201,14 +1200,14 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let field_layout = fields[*index as usize];
|
||||
let field_layout = field_layouts[*index as usize];
|
||||
use_roc_value(env, field_layout, field_value, "struct_field_tag")
|
||||
}
|
||||
(
|
||||
PointerValue(argument),
|
||||
Layout::Union(UnionLayout::NonNullableUnwrapped(fields)),
|
||||
) => {
|
||||
let struct_layout = Layout::Struct(fields);
|
||||
let struct_layout = Layout::struct_no_name_order(fields);
|
||||
let struct_type = basic_type_from_layout(env, &struct_layout);
|
||||
|
||||
let cast_argument = env
|
||||
@ -1292,7 +1291,7 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
|
||||
)
|
||||
}
|
||||
UnionLayout::NonNullableUnwrapped(field_layouts) => {
|
||||
let struct_layout = Layout::Struct(field_layouts);
|
||||
let struct_layout = Layout::struct_no_name_order(field_layouts);
|
||||
|
||||
let struct_type = basic_type_from_layout(env, &struct_layout);
|
||||
|
||||
@ -1341,7 +1340,7 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
|
||||
debug_assert_ne!(*tag_id != 0, *nullable_id);
|
||||
|
||||
let field_layouts = other_fields;
|
||||
let struct_layout = Layout::Struct(field_layouts);
|
||||
let struct_layout = Layout::struct_no_name_order(field_layouts);
|
||||
|
||||
let struct_type = basic_type_from_layout(env, &struct_layout);
|
||||
|
||||
@ -2024,7 +2023,7 @@ fn lookup_at_index_ptr2<'a, 'ctx, 'env>(
|
||||
) -> BasicValueEnum<'ctx> {
|
||||
let builder = env.builder;
|
||||
|
||||
let struct_layout = Layout::Struct(field_layouts);
|
||||
let struct_layout = Layout::struct_no_name_order(field_layouts);
|
||||
let struct_type = basic_type_from_layout(env, &struct_layout);
|
||||
|
||||
let wrapper_type = env
|
||||
@ -3522,7 +3521,7 @@ fn expose_function_to_host_help_c_abi_gen_test<'a, 'ctx, 'env>(
|
||||
call_roc_function(
|
||||
env,
|
||||
roc_wrapper_function,
|
||||
&Layout::Struct(&[Layout::u64(), return_layout]),
|
||||
&Layout::struct_no_name_order(&[Layout::u64(), return_layout]),
|
||||
arguments_for_call,
|
||||
)
|
||||
};
|
||||
@ -3903,7 +3902,7 @@ fn roc_result_layout<'a>(
|
||||
) -> Layout<'a> {
|
||||
let elements = [Layout::u64(), Layout::usize(target_info), return_layout];
|
||||
|
||||
Layout::Struct(arena.alloc(elements))
|
||||
Layout::struct_no_name_order(arena.alloc(elements))
|
||||
}
|
||||
|
||||
fn roc_result_type<'a, 'ctx, 'env>(
|
||||
@ -5363,7 +5362,7 @@ fn run_low_level<'a, 'ctx, 'env>(
|
||||
let (string, _string_layout) = load_symbol_and_layout(scope, &args[0]);
|
||||
|
||||
let number_layout = match layout {
|
||||
Layout::Struct(fields) => fields[0], // TODO: why is it sometimes a struct?
|
||||
Layout::Struct { field_layouts, .. } => field_layouts[0], // TODO: why is it sometimes a struct?
|
||||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
@ -6977,9 +6976,9 @@ fn build_int_unary_op<'a, 'ctx, 'env>(
|
||||
// return_layout : Result N [ OutOfBounds ]* ~ { result: N, out_of_bounds: bool }
|
||||
|
||||
let target_int_width = match return_layout {
|
||||
Layout::Struct(layouts) if layouts.len() == 2 => {
|
||||
debug_assert!(matches!(layouts[1], Layout::Builtin(Builtin::Bool)));
|
||||
match layouts[0] {
|
||||
Layout::Struct { field_layouts, .. } if field_layouts.len() == 2 => {
|
||||
debug_assert!(matches!(field_layouts[1], Layout::Builtin(Builtin::Bool)));
|
||||
match field_layouts[0] {
|
||||
Layout::Builtin(Builtin::Int(iw)) => iw,
|
||||
layout => internal_error!(
|
||||
"There can only be an int layout here, found {:?}!",
|
||||
|
@ -735,8 +735,7 @@ pub fn set_from_list<'a, 'ctx, 'env>(
|
||||
|
||||
let result_alloca = builder.build_alloca(zig_dict_type(env), "result_alloca");
|
||||
|
||||
let alignment =
|
||||
Alignment::from_key_value_layout(key_layout, &Layout::Struct(&[]), env.target_info);
|
||||
let alignment = Alignment::from_key_value_layout(key_layout, &Layout::UNIT, env.target_info);
|
||||
let alignment_iv = alignment.as_int_value(env.context);
|
||||
|
||||
let hash_fn = build_hash_wrapper(env, layout_ids, key_layout);
|
||||
|
@ -50,10 +50,10 @@ fn build_hash_layout<'a, 'ctx, 'env>(
|
||||
hash_builtin(env, layout_ids, seed, val, layout, builtin, when_recursive)
|
||||
}
|
||||
|
||||
Layout::Struct(fields) => build_hash_struct(
|
||||
Layout::Struct { field_layouts, .. } => build_hash_struct(
|
||||
env,
|
||||
layout_ids,
|
||||
fields,
|
||||
field_layouts,
|
||||
when_recursive,
|
||||
seed,
|
||||
val.into_struct_value(),
|
||||
@ -166,7 +166,7 @@ fn build_hash_struct<'a, 'ctx, 'env>(
|
||||
let block = env.builder.get_insert_block().expect("to be in a function");
|
||||
let di_location = env.builder.get_current_debug_location().unwrap();
|
||||
|
||||
let struct_layout = Layout::Struct(field_layouts);
|
||||
let struct_layout = Layout::struct_no_name_order(field_layouts);
|
||||
|
||||
let symbol = Symbol::GENERIC_HASH;
|
||||
let fn_name = layout_ids
|
||||
@ -248,7 +248,7 @@ fn hash_struct<'a, 'ctx, 'env>(
|
||||
) -> IntValue<'ctx> {
|
||||
let ptr_bytes = env.target_info;
|
||||
|
||||
let layout = Layout::Struct(field_layouts);
|
||||
let layout = Layout::struct_no_name_order(field_layouts);
|
||||
|
||||
// Optimization: if the bit representation of equal values is the same
|
||||
// just hash the bits. Caveat here is tags: e.g. `Nothing` in `Just a`
|
||||
@ -818,7 +818,7 @@ fn hash_ptr_to_struct<'a, 'ctx, 'env>(
|
||||
.build_struct_gep(wrapper_ptr, TAG_DATA_INDEX, "get_tag_data")
|
||||
.unwrap();
|
||||
|
||||
let struct_layout = Layout::Struct(field_layouts);
|
||||
let struct_layout = Layout::struct_no_name_order(field_layouts);
|
||||
let struct_type = basic_type_from_layout(env, &struct_layout);
|
||||
let struct_ptr = env
|
||||
.builder
|
||||
|
@ -161,10 +161,10 @@ fn build_eq<'a, 'ctx, 'env>(
|
||||
build_eq_builtin(env, layout_ids, lhs_val, rhs_val, builtin, when_recursive)
|
||||
}
|
||||
|
||||
Layout::Struct(fields) => build_struct_eq(
|
||||
Layout::Struct { field_layouts, .. } => build_struct_eq(
|
||||
env,
|
||||
layout_ids,
|
||||
fields,
|
||||
field_layouts,
|
||||
when_recursive,
|
||||
lhs_val.into_struct_value(),
|
||||
rhs_val.into_struct_value(),
|
||||
@ -330,11 +330,11 @@ fn build_neq<'a, 'ctx, 'env>(
|
||||
build_neq_builtin(env, layout_ids, lhs_val, rhs_val, builtin, when_recursive)
|
||||
}
|
||||
|
||||
Layout::Struct(fields) => {
|
||||
Layout::Struct { field_layouts, .. } => {
|
||||
let is_equal = build_struct_eq(
|
||||
env,
|
||||
layout_ids,
|
||||
fields,
|
||||
field_layouts,
|
||||
when_recursive,
|
||||
lhs_val.into_struct_value(),
|
||||
rhs_val.into_struct_value(),
|
||||
@ -587,7 +587,7 @@ fn build_struct_eq<'a, 'ctx, 'env>(
|
||||
let block = env.builder.get_insert_block().expect("to be in a function");
|
||||
let di_location = env.builder.get_current_debug_location().unwrap();
|
||||
|
||||
let struct_layout = Layout::Struct(field_layouts);
|
||||
let struct_layout = Layout::struct_no_name_order(field_layouts);
|
||||
|
||||
let symbol = Symbol::GENERIC_EQ;
|
||||
let fn_name = layout_ids
|
||||
@ -1208,7 +1208,7 @@ fn eq_ptr_to_struct<'a, 'ctx, 'env>(
|
||||
tag1: PointerValue<'ctx>,
|
||||
tag2: PointerValue<'ctx>,
|
||||
) -> IntValue<'ctx> {
|
||||
let struct_layout = Layout::Struct(field_layouts);
|
||||
let struct_layout = Layout::struct_no_name_order(field_layouts);
|
||||
|
||||
let wrapper_type = basic_type_from_layout(env, &struct_layout);
|
||||
debug_assert!(wrapper_type.is_struct_type());
|
||||
|
@ -28,7 +28,10 @@ pub fn basic_type_from_layout<'a, 'ctx, 'env>(
|
||||
use Layout::*;
|
||||
|
||||
match layout {
|
||||
Struct(sorted_fields) => basic_type_from_record(env, sorted_fields),
|
||||
Struct {
|
||||
field_layouts: sorted_fields,
|
||||
..
|
||||
} => basic_type_from_record(env, sorted_fields),
|
||||
LambdaSet(lambda_set) => basic_type_from_layout(env, &lambda_set.runtime_representation()),
|
||||
Union(union_layout) => {
|
||||
use UnionLayout::*;
|
||||
@ -86,7 +89,10 @@ pub fn basic_type_from_layout_1<'a, 'ctx, 'env>(
|
||||
use Layout::*;
|
||||
|
||||
match layout {
|
||||
Struct(sorted_fields) => basic_type_from_record(env, sorted_fields),
|
||||
Struct {
|
||||
field_layouts: sorted_fields,
|
||||
..
|
||||
} => basic_type_from_record(env, sorted_fields),
|
||||
LambdaSet(lambda_set) => {
|
||||
basic_type_from_layout_1(env, &lambda_set.runtime_representation())
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ fn modify_refcount_struct<'a, 'ctx, 'env>(
|
||||
let block = env.builder.get_insert_block().expect("to be in a function");
|
||||
let di_location = env.builder.get_current_debug_location().unwrap();
|
||||
|
||||
let layout = Layout::Struct(layouts);
|
||||
let layout = Layout::struct_no_name_order(layouts);
|
||||
|
||||
let (_, fn_name) = function_name_from_mode(
|
||||
layout_ids,
|
||||
@ -440,7 +440,7 @@ fn modify_refcount_builtin<'a, 'ctx, 'env>(
|
||||
}
|
||||
Set(element_layout) => {
|
||||
let key_layout = element_layout;
|
||||
let value_layout = &Layout::Struct(&[]);
|
||||
let value_layout = &Layout::UNIT;
|
||||
|
||||
let function = modify_refcount_dict(
|
||||
env,
|
||||
@ -619,8 +619,9 @@ fn modify_refcount_layout_build_function<'a, 'ctx, 'env>(
|
||||
}
|
||||
}
|
||||
|
||||
Struct(layouts) => {
|
||||
let function = modify_refcount_struct(env, layout_ids, layouts, mode, when_recursive);
|
||||
Struct { field_layouts, .. } => {
|
||||
let function =
|
||||
modify_refcount_struct(env, layout_ids, field_layouts, mode, when_recursive);
|
||||
|
||||
Some(function)
|
||||
}
|
||||
@ -1312,7 +1313,8 @@ fn build_rec_union_recursive_decrement<'a, 'ctx, 'env>(
|
||||
|
||||
env.builder.position_at_end(block);
|
||||
|
||||
let wrapper_type = basic_type_from_layout(env, &Layout::Struct(field_layouts));
|
||||
let wrapper_type =
|
||||
basic_type_from_layout(env, &Layout::struct_no_name_order(field_layouts));
|
||||
|
||||
// cast the opaque pointer to a pointer of the correct shape
|
||||
let struct_ptr = env
|
||||
@ -1720,7 +1722,8 @@ fn modify_refcount_union_help<'a, 'ctx, 'env>(
|
||||
let block = env.context.append_basic_block(parent, "tag_id_modify");
|
||||
env.builder.position_at_end(block);
|
||||
|
||||
let wrapper_type = basic_type_from_layout(env, &Layout::Struct(field_layouts));
|
||||
let wrapper_type =
|
||||
basic_type_from_layout(env, &Layout::struct_no_name_order(field_layouts));
|
||||
|
||||
debug_assert!(wrapper_type.is_struct_type());
|
||||
let opaque_tag_data_ptr = env
|
||||
|
@ -884,7 +884,7 @@ impl<'a> WasmBackend<'a> {
|
||||
storage: &StoredValue,
|
||||
fields: &'a [Symbol],
|
||||
) {
|
||||
if matches!(layout, Layout::Struct(_)) {
|
||||
if matches!(layout, Layout::Struct { .. }) {
|
||||
match storage {
|
||||
StoredValue::StackMemory { location, size, .. } => {
|
||||
if *size > 0 {
|
||||
|
@ -88,7 +88,7 @@ impl WasmLayout {
|
||||
},
|
||||
|
||||
Layout::Builtin(Str | Dict(_, _) | Set(_) | List(_))
|
||||
| Layout::Struct(_)
|
||||
| Layout::Struct { .. }
|
||||
| Layout::LambdaSet(_)
|
||||
| Layout::Union(NonRecursive(_)) => Self::StackMemory {
|
||||
size,
|
||||
|
@ -212,7 +212,7 @@ impl<'a> LowLevelCall<'a> {
|
||||
}
|
||||
StrToNum => {
|
||||
let number_layout = match self.ret_layout {
|
||||
Layout::Struct(fields) => fields[0],
|
||||
Layout::Struct { field_layouts, .. } => field_layouts[0],
|
||||
_ => {
|
||||
internal_error!("Unexpected mono layout {:?} for StrToNum", self.ret_layout)
|
||||
}
|
||||
@ -711,7 +711,7 @@ impl<'a> LowLevelCall<'a> {
|
||||
|
||||
// Empty record is always equal to empty record.
|
||||
// There are no runtime arguments to check, so just emit true or false.
|
||||
Layout::Struct(fields) if fields.is_empty() => {
|
||||
Layout::Struct { field_layouts, .. } if field_layouts.is_empty() => {
|
||||
backend.code_builder.i32_const(!invert_result as i32);
|
||||
}
|
||||
|
||||
@ -722,7 +722,7 @@ impl<'a> LowLevelCall<'a> {
|
||||
}
|
||||
|
||||
Layout::Builtin(Builtin::Dict(_, _) | Builtin::Set(_) | Builtin::List(_))
|
||||
| Layout::Struct(_)
|
||||
| Layout::Struct { .. }
|
||||
| Layout::Union(_)
|
||||
| Layout::LambdaSet(_) => {
|
||||
// Don't want Zig calling convention here, we're calling internal Roc functions
|
||||
|
@ -2101,7 +2101,7 @@ fn finish_specialization(
|
||||
EntryPoint {
|
||||
layout: roc_mono::ir::ProcLayout {
|
||||
arguments: &[],
|
||||
result: Layout::Struct(&[]),
|
||||
result: Layout::struct_no_name_order(&[]),
|
||||
},
|
||||
symbol,
|
||||
}
|
||||
|
@ -308,7 +308,7 @@ fn build_entry_point(
|
||||
|
||||
let block = builder.add_block();
|
||||
|
||||
let type_id = layout_spec(&mut builder, &Layout::Struct(layouts))?;
|
||||
let type_id = layout_spec(&mut builder, &Layout::struct_no_name_order(layouts))?;
|
||||
|
||||
let argument = builder.add_unknown_with(block, &[], type_id)?;
|
||||
|
||||
@ -349,7 +349,10 @@ fn proc_spec<'a>(proc: &Proc<'a>) -> Result<(FuncDef, MutSet<UnionLayout<'a>>)>
|
||||
let value_id = stmt_spec(&mut builder, &mut env, block, &proc.ret_layout, &proc.body)?;
|
||||
|
||||
let root = BlockExpr(block, value_id);
|
||||
let arg_type_id = layout_spec(&mut builder, &Layout::Struct(&argument_layouts))?;
|
||||
let arg_type_id = layout_spec(
|
||||
&mut builder,
|
||||
&Layout::struct_no_name_order(&argument_layouts),
|
||||
)?;
|
||||
let ret_type_id = layout_spec(&mut builder, &proc.ret_layout)?;
|
||||
|
||||
let spec = builder.build(arg_type_id, ret_type_id, root)?;
|
||||
@ -1135,7 +1138,7 @@ fn call_spec(
|
||||
|
||||
// ListFindUnsafe returns { value: v, found: Bool=Int1 }
|
||||
let output_layouts = vec![argument_layouts[0], Layout::Builtin(Builtin::Bool)];
|
||||
let output_layout = Layout::Struct(&output_layouts);
|
||||
let output_layout = Layout::struct_no_name_order(&output_layouts);
|
||||
let output_type = layout_spec(builder, &output_layout)?;
|
||||
|
||||
let loop_body = |builder: &mut FuncDefBuilder, block, output| {
|
||||
@ -1672,7 +1675,9 @@ fn layout_spec_help(
|
||||
|
||||
match layout {
|
||||
Builtin(builtin) => builtin_spec(builder, builtin, when_recursive),
|
||||
Struct(fields) => build_recursive_tuple_type(builder, fields, when_recursive),
|
||||
Struct { field_layouts, .. } => {
|
||||
build_recursive_tuple_type(builder, field_layouts, when_recursive)
|
||||
}
|
||||
LambdaSet(lambda_set) => layout_spec_help(
|
||||
builder,
|
||||
&lambda_set.runtime_representation(),
|
||||
|
@ -32,7 +32,7 @@ pub fn eq_generic<'a>(
|
||||
}
|
||||
Layout::Builtin(Builtin::Dict(_, _) | Builtin::Set(_)) => eq_todo(),
|
||||
Layout::Builtin(Builtin::List(elem_layout)) => eq_list(root, ident_ids, ctx, elem_layout),
|
||||
Layout::Struct(field_layouts) => eq_struct(root, ident_ids, ctx, field_layouts),
|
||||
Layout::Struct { field_layouts, .. } => eq_struct(root, ident_ids, ctx, field_layouts),
|
||||
Layout::Union(union_layout) => eq_tag_union(root, ident_ids, ctx, union_layout),
|
||||
Layout::LambdaSet(_) => unreachable!("`==` is not defined on functions"),
|
||||
Layout::RecursivePointer => {
|
||||
|
@ -15,7 +15,7 @@ mod equality;
|
||||
mod refcount;
|
||||
|
||||
const LAYOUT_BOOL: Layout = Layout::Builtin(Builtin::Bool);
|
||||
const LAYOUT_UNIT: Layout = Layout::Struct(&[]);
|
||||
const LAYOUT_UNIT: Layout = Layout::UNIT;
|
||||
|
||||
const ARG_1: Symbol = Symbol::ARG_1;
|
||||
const ARG_2: Symbol = Symbol::ARG_2;
|
||||
@ -354,9 +354,15 @@ impl<'a> CodeGenHelp<'a> {
|
||||
|
||||
Layout::Builtin(_) => layout,
|
||||
|
||||
Layout::Struct(fields) => {
|
||||
let new_fields_iter = fields.iter().map(|f| self.replace_rec_ptr(ctx, *f));
|
||||
Layout::Struct(self.arena.alloc_slice_fill_iter(new_fields_iter))
|
||||
Layout::Struct {
|
||||
field_layouts,
|
||||
field_order_hash,
|
||||
} => {
|
||||
let new_fields_iter = field_layouts.iter().map(|f| self.replace_rec_ptr(ctx, *f));
|
||||
Layout::Struct {
|
||||
field_layouts: self.arena.alloc_slice_fill_iter(new_fields_iter),
|
||||
field_order_hash,
|
||||
}
|
||||
}
|
||||
|
||||
Layout::Union(UnionLayout::NonRecursive(tags)) => {
|
||||
@ -462,7 +468,7 @@ fn layout_needs_helper_proc(layout: &Layout, op: HelperOp) -> bool {
|
||||
|
||||
Layout::Builtin(Builtin::Dict(_, _) | Builtin::Set(_) | Builtin::List(_)) => true,
|
||||
|
||||
Layout::Struct(fields) => !fields.is_empty(),
|
||||
Layout::Struct { field_layouts, .. } => !field_layouts.is_empty(),
|
||||
|
||||
Layout::Union(UnionLayout::NonRecursive(tags)) => !tags.is_empty(),
|
||||
|
||||
|
@ -12,7 +12,7 @@ use crate::layout::{Builtin, Layout, TagIdIntType, UnionLayout};
|
||||
use super::{CodeGenHelp, Context, HelperOp};
|
||||
|
||||
const LAYOUT_BOOL: Layout = Layout::Builtin(Builtin::Bool);
|
||||
const LAYOUT_UNIT: Layout = Layout::Struct(&[]);
|
||||
const LAYOUT_UNIT: Layout = Layout::UNIT;
|
||||
const LAYOUT_PTR: Layout = Layout::RecursivePointer;
|
||||
const LAYOUT_U32: Layout = Layout::Builtin(Builtin::Int(IntWidth::U32));
|
||||
|
||||
@ -69,7 +69,7 @@ pub fn refcount_stmt<'a>(
|
||||
}
|
||||
|
||||
// Struct and non-recursive Unions are stack-only, so DecRef is a no-op
|
||||
Layout::Struct(_) => following,
|
||||
Layout::Struct { .. } => following,
|
||||
Layout::Union(UnionLayout::NonRecursive(_)) => following,
|
||||
|
||||
// Inline the refcounting code instead of making a function. Don't iterate fields,
|
||||
@ -111,7 +111,7 @@ pub fn refcount_generic<'a>(
|
||||
refcount_list(root, ident_ids, ctx, &layout, elem_layout, structure)
|
||||
}
|
||||
Layout::Builtin(Builtin::Dict(_, _) | Builtin::Set(_)) => rc_todo(),
|
||||
Layout::Struct(field_layouts) => {
|
||||
Layout::Struct { field_layouts, .. } => {
|
||||
refcount_struct(root, ident_ids, ctx, field_layouts, structure)
|
||||
}
|
||||
Layout::Union(union_layout) => {
|
||||
@ -135,7 +135,7 @@ pub fn is_rc_implemented_yet(layout: &Layout) -> bool {
|
||||
Layout::Builtin(Builtin::Dict(..) | Builtin::Set(_)) => false,
|
||||
Layout::Builtin(Builtin::List(elem_layout)) => is_rc_implemented_yet(elem_layout),
|
||||
Layout::Builtin(_) => true,
|
||||
Layout::Struct(fields) => fields.iter().all(is_rc_implemented_yet),
|
||||
Layout::Struct { field_layouts, .. } => field_layouts.iter().all(is_rc_implemented_yet),
|
||||
Layout::Union(union_layout) => match union_layout {
|
||||
NonRecursive(tags) => tags
|
||||
.iter()
|
||||
|
@ -747,7 +747,11 @@ fn to_relevant_branch_help<'a>(
|
||||
|
||||
// the test matches the constructor of this pattern
|
||||
match layout {
|
||||
UnionLayout::NonRecursive([[Layout::Struct([_])]]) => {
|
||||
UnionLayout::NonRecursive(
|
||||
[[Layout::Struct {
|
||||
field_layouts: [_], ..
|
||||
}]],
|
||||
) => {
|
||||
// a one-element record equivalent
|
||||
// Theory: Unbox doesn't have any value for us
|
||||
debug_assert_eq!(arguments.len(), 1);
|
||||
@ -1235,7 +1239,7 @@ fn path_to_expr_help<'a>(
|
||||
layout = inner_layout;
|
||||
}
|
||||
|
||||
Layout::Struct(field_layouts) => {
|
||||
Layout::Struct { field_layouts, .. } => {
|
||||
debug_assert!(field_layouts.len() > 1);
|
||||
|
||||
let inner_expr = Expr::StructAtIndex {
|
||||
|
@ -1125,7 +1125,7 @@ impl<'a> Param<'a> {
|
||||
pub const EMPTY: Self = Param {
|
||||
symbol: Symbol::EMPTY_PARAM,
|
||||
borrow: false,
|
||||
layout: Layout::Struct(&[]),
|
||||
layout: Layout::UNIT,
|
||||
};
|
||||
}
|
||||
|
||||
@ -1725,11 +1725,11 @@ impl<'a> Stmt<'a> {
|
||||
use Stmt::*;
|
||||
|
||||
match self {
|
||||
Let(symbol, expr, _layout, cont) => alloc
|
||||
Let(symbol, expr, layout, cont) => alloc
|
||||
.text("let ")
|
||||
.append(symbol_to_doc(alloc, *symbol))
|
||||
.append(" : ")
|
||||
.append(alloc.text(format!("{:?}", _layout)))
|
||||
.append(layout.to_doc(alloc, Parens::NotNeeded))
|
||||
.append(" = ")
|
||||
.append(expr.to_doc(alloc))
|
||||
.append(";")
|
||||
@ -2436,7 +2436,7 @@ fn specialize_external<'a>(
|
||||
|
||||
let closure_data_layout = match opt_closure_layout {
|
||||
Some(lambda_set) => Layout::LambdaSet(lambda_set),
|
||||
None => Layout::Struct(&[]),
|
||||
None => Layout::UNIT,
|
||||
};
|
||||
|
||||
// I'm not sure how to handle the closure case, does it ever occur?
|
||||
@ -3985,7 +3985,7 @@ pub fn with_hole<'a>(
|
||||
.unwrap_or_else(|err| panic!("TODO turn fn_var into a RuntimeError {:?}", err));
|
||||
|
||||
let field_layouts = match &record_layout {
|
||||
Layout::Struct(layouts) => *layouts,
|
||||
Layout::Struct { field_layouts, .. } => *field_layouts,
|
||||
other => arena.alloc([*other]),
|
||||
};
|
||||
|
||||
@ -4701,7 +4701,7 @@ fn construct_closure_data<'a>(
|
||||
Vec::from_iter_in(combined.iter().map(|(_, b)| **b), env.arena).into_bump_slice();
|
||||
|
||||
debug_assert_eq!(
|
||||
Layout::Struct(field_layouts),
|
||||
Layout::struct_no_name_order(field_layouts),
|
||||
lambda_set.runtime_representation()
|
||||
);
|
||||
|
||||
@ -4785,9 +4785,7 @@ fn convert_tag_union<'a>(
|
||||
"The `[]` type has no constructors, source var {:?}",
|
||||
variant_var
|
||||
),
|
||||
Unit | UnitWithArguments => {
|
||||
Stmt::Let(assigned, Expr::Struct(&[]), Layout::Struct(&[]), hole)
|
||||
}
|
||||
Unit | UnitWithArguments => Stmt::Let(assigned, Expr::Struct(&[]), Layout::UNIT, hole),
|
||||
BoolUnion { ttrue, .. } => Stmt::Let(
|
||||
assigned,
|
||||
Expr::Literal(Literal::Bool(tag_name == ttrue)),
|
||||
@ -5096,7 +5094,7 @@ fn sorted_field_symbols<'a>(
|
||||
// Note it does not catch the use of `[]` currently.
|
||||
use roc_can::expr::Expr;
|
||||
arg.value = Expr::RuntimeError(RuntimeError::VoidValue);
|
||||
Layout::Struct(&[])
|
||||
Layout::UNIT
|
||||
}
|
||||
Err(LayoutProblem::Erroneous) => {
|
||||
// something went very wrong
|
||||
@ -5191,7 +5189,10 @@ fn register_capturing_closure<'a>(
|
||||
Content::Structure(FlatType::Func(_, closure_var, _)) => {
|
||||
match LambdaSet::from_var(env.arena, env.subs, closure_var, env.target_info) {
|
||||
Ok(lambda_set) => {
|
||||
if let Layout::Struct(&[]) = lambda_set.runtime_representation() {
|
||||
if let Layout::Struct {
|
||||
field_layouts: &[], ..
|
||||
} = lambda_set.runtime_representation()
|
||||
{
|
||||
CapturedSymbols::None
|
||||
} else {
|
||||
let mut temp = Vec::from_iter_in(captured_symbols, env.arena);
|
||||
@ -6255,7 +6256,7 @@ fn store_pattern_help<'a>(
|
||||
let mut fields = Vec::with_capacity_in(arguments.len(), env.arena);
|
||||
fields.extend(arguments.iter().map(|x| x.1));
|
||||
|
||||
let layout = Layout::Struct(fields.into_bump_slice());
|
||||
let layout = Layout::struct_no_name_order(fields.into_bump_slice());
|
||||
|
||||
return store_newtype_pattern(
|
||||
env,
|
||||
@ -6676,7 +6677,7 @@ fn force_thunk<'a>(
|
||||
}
|
||||
|
||||
fn let_empty_struct<'a>(assigned: Symbol, hole: &'a Stmt<'a>) -> Stmt<'a> {
|
||||
Stmt::Let(assigned, Expr::Struct(&[]), Layout::Struct(&[]), hole)
|
||||
Stmt::Let(assigned, Expr::Struct(&[]), Layout::UNIT, hole)
|
||||
}
|
||||
|
||||
/// If the symbol is a function, make sure it is properly specialized
|
||||
@ -8457,7 +8458,7 @@ where
|
||||
env.arena.alloc(result),
|
||||
)
|
||||
}
|
||||
Layout::Struct(_) => match lambda_set.set.get(0) {
|
||||
Layout::Struct { .. } => match lambda_set.set.get(0) {
|
||||
Some((function_symbol, _)) => {
|
||||
let call_spec_id = env.next_call_specialization_id();
|
||||
let update_mode = env.next_update_mode_id();
|
||||
@ -8630,7 +8631,10 @@ fn match_on_lambda_set<'a>(
|
||||
env.arena.alloc(result),
|
||||
)
|
||||
}
|
||||
Layout::Struct(fields) => {
|
||||
Layout::Struct {
|
||||
field_layouts,
|
||||
field_order_hash,
|
||||
} => {
|
||||
let function_symbol = lambda_set.set[0].0;
|
||||
|
||||
union_lambda_set_branch_help(
|
||||
@ -8638,7 +8642,10 @@ fn match_on_lambda_set<'a>(
|
||||
function_symbol,
|
||||
lambda_set,
|
||||
closure_data_symbol,
|
||||
Layout::Struct(fields),
|
||||
Layout::Struct {
|
||||
field_layouts,
|
||||
field_order_hash,
|
||||
},
|
||||
argument_symbols,
|
||||
argument_layouts,
|
||||
return_layout,
|
||||
@ -8797,7 +8804,9 @@ fn union_lambda_set_branch_help<'a>(
|
||||
hole: &'a Stmt<'a>,
|
||||
) -> Stmt<'a> {
|
||||
let (argument_layouts, argument_symbols) = match closure_data_layout {
|
||||
Layout::Struct(&[])
|
||||
Layout::Struct {
|
||||
field_layouts: &[], ..
|
||||
}
|
||||
| Layout::Builtin(Builtin::Bool)
|
||||
| Layout::Builtin(Builtin::Int(IntWidth::U8)) => {
|
||||
(argument_layouts_slice, argument_symbols_slice)
|
||||
@ -8924,7 +8933,9 @@ fn enum_lambda_set_branch<'a>(
|
||||
let assigned = result_symbol;
|
||||
|
||||
let (argument_layouts, argument_symbols) = match closure_data_layout {
|
||||
Layout::Struct(&[])
|
||||
Layout::Struct {
|
||||
field_layouts: &[], ..
|
||||
}
|
||||
| Layout::Builtin(Builtin::Bool)
|
||||
| Layout::Builtin(Builtin::Int(IntWidth::U8)) => {
|
||||
(argument_layouts_slice, argument_symbols_slice)
|
||||
|
@ -11,8 +11,9 @@ use roc_types::subs::{
|
||||
Content, FlatType, RecordFields, Subs, UnionTags, UnsortedUnionTags, Variable,
|
||||
};
|
||||
use roc_types::types::{gather_fields_unsorted_iter, RecordField};
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::collections::hash_map::{DefaultHasher, Entry};
|
||||
use std::collections::HashMap;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use ven_pretty::{DocAllocator, DocBuilder};
|
||||
|
||||
// if your changes cause this number to go down, great!
|
||||
@ -201,14 +202,44 @@ impl<'a> RawFunctionLayout<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
pub struct FieldOrderHash(u64);
|
||||
|
||||
impl FieldOrderHash {
|
||||
// NB: This should really be a proper "zero" hash via `DefaultHasher::new().finish()`, but Rust
|
||||
// stdlib hashers are not (yet) compile-time-computable.
|
||||
const ZERO_FIELD_HASH: Self = Self(0);
|
||||
const IRRELEVANT_NON_ZERO_FIELD_HASH: Self = Self(1);
|
||||
|
||||
pub fn from_ordered_fields(fields: &[&Lowercase]) -> Self {
|
||||
if fields.is_empty() {
|
||||
// HACK: we must make sure this is always equivalent to a `ZERO_FIELD_HASH`.
|
||||
return Self::ZERO_FIELD_HASH;
|
||||
}
|
||||
|
||||
let mut hasher = DefaultHasher::new();
|
||||
fields.iter().for_each(|field| field.hash(&mut hasher));
|
||||
Self(hasher.finish())
|
||||
}
|
||||
}
|
||||
|
||||
/// Types for code gen must be monomorphic. No type variables allowed!
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
pub enum Layout<'a> {
|
||||
Builtin(Builtin<'a>),
|
||||
/// A layout that is empty (turns into the empty struct in LLVM IR
|
||||
/// but for our purposes, not zero-sized, so it does not get dropped from data structures
|
||||
/// this is important for closures that capture zero-sized values
|
||||
Struct(&'a [Layout<'a>]),
|
||||
Struct {
|
||||
/// Two different struct types can have the same layout, for example
|
||||
/// { a: U8, b: I64 }
|
||||
/// { a: I64, b: U8 }
|
||||
/// both have the layout {I64, U8}. Not distinguishing the order of record fields can cause
|
||||
/// us problems during monomorphization when we specialize the same type in different ways,
|
||||
/// so keep a hash of the record order for disambiguation. This still of course may result
|
||||
/// in collisions, but it's unlikely.
|
||||
///
|
||||
/// See also https://github.com/rtfeldman/roc/issues/2535.
|
||||
field_order_hash: FieldOrderHash,
|
||||
field_layouts: &'a [Layout<'a>],
|
||||
},
|
||||
Union(UnionLayout<'a>),
|
||||
LambdaSet(LambdaSet<'a>),
|
||||
RecursivePointer,
|
||||
@ -417,7 +448,9 @@ impl<'a> UnionLayout<'a> {
|
||||
|
||||
fn tags_alignment_bytes(tags: &[&[Layout]], target_info: TargetInfo) -> u32 {
|
||||
tags.iter()
|
||||
.map(|fields| Layout::Struct(fields).alignment_bytes(target_info))
|
||||
.map(|field_layouts| {
|
||||
Layout::struct_no_name_order(field_layouts).alignment_bytes(target_info)
|
||||
})
|
||||
.max()
|
||||
.unwrap_or(0)
|
||||
}
|
||||
@ -426,14 +459,14 @@ impl<'a> UnionLayout<'a> {
|
||||
let allocation = match self {
|
||||
UnionLayout::NonRecursive(_) => unreachable!("not heap-allocated"),
|
||||
UnionLayout::Recursive(tags) => Self::tags_alignment_bytes(tags, target_info),
|
||||
UnionLayout::NonNullableUnwrapped(fields) => {
|
||||
Layout::Struct(fields).alignment_bytes(target_info)
|
||||
UnionLayout::NonNullableUnwrapped(field_layouts) => {
|
||||
Layout::struct_no_name_order(field_layouts).alignment_bytes(target_info)
|
||||
}
|
||||
UnionLayout::NullableWrapped { other_tags, .. } => {
|
||||
Self::tags_alignment_bytes(other_tags, target_info)
|
||||
}
|
||||
UnionLayout::NullableUnwrapped { other_fields, .. } => {
|
||||
Layout::Struct(other_fields).alignment_bytes(target_info)
|
||||
Layout::struct_no_name_order(other_fields).alignment_bytes(target_info)
|
||||
}
|
||||
};
|
||||
|
||||
@ -495,12 +528,12 @@ impl<'a> UnionLayout<'a> {
|
||||
let mut alignment_bytes = 0;
|
||||
|
||||
for field_layouts in variant_field_layouts {
|
||||
let mut data = Layout::Struct(field_layouts);
|
||||
let mut data = Layout::struct_no_name_order(field_layouts);
|
||||
|
||||
let fields_and_id;
|
||||
if let Some(id_layout) = id_data_layout {
|
||||
fields_and_id = [data, id_layout];
|
||||
data = Layout::Struct(&fields_and_id);
|
||||
data = Layout::struct_no_name_order(&fields_and_id);
|
||||
}
|
||||
|
||||
let (variant_size, variant_alignment) = data.stack_size_and_alignment(target_info);
|
||||
@ -590,7 +623,10 @@ impl<'a> LambdaSet<'a> {
|
||||
}
|
||||
|
||||
pub fn is_represented(&self) -> Option<Layout<'a>> {
|
||||
if let Layout::Struct(&[]) = self.representation {
|
||||
if let Layout::Struct {
|
||||
field_layouts: &[], ..
|
||||
} = self.representation
|
||||
{
|
||||
None
|
||||
} else {
|
||||
Some(*self.representation)
|
||||
@ -648,7 +684,7 @@ impl<'a> LambdaSet<'a> {
|
||||
} => todo!("recursive closures"),
|
||||
}
|
||||
}
|
||||
Layout::Struct(_) => {
|
||||
Layout::Struct { .. } => {
|
||||
// get the fields from the set, where they are sorted in alphabetic order
|
||||
// (and not yet sorted by their alignment)
|
||||
let (_, fields) = self
|
||||
@ -673,7 +709,9 @@ impl<'a> LambdaSet<'a> {
|
||||
argument_layouts
|
||||
} else {
|
||||
match self.representation {
|
||||
Layout::Struct(&[]) => {
|
||||
Layout::Struct {
|
||||
field_layouts: &[], ..
|
||||
} => {
|
||||
// this function does not have anything in its closure, and the lambda set is a
|
||||
// singleton, so we pass no extra argument
|
||||
argument_layouts
|
||||
@ -769,7 +807,7 @@ impl<'a> LambdaSet<'a> {
|
||||
}
|
||||
Newtype {
|
||||
arguments: layouts, ..
|
||||
} => Layout::Struct(layouts.into_bump_slice()),
|
||||
} => Layout::struct_no_name_order(layouts.into_bump_slice()),
|
||||
Wrapped(variant) => {
|
||||
use WrappedVariant::*;
|
||||
|
||||
@ -865,7 +903,10 @@ pub const fn round_up_to_alignment(width: u32, alignment: u32) -> u32 {
|
||||
|
||||
impl<'a> Layout<'a> {
|
||||
pub const VOID: Self = Layout::Union(UnionLayout::NonRecursive(&[]));
|
||||
pub const UNIT: Self = Layout::Struct(&[]);
|
||||
pub const UNIT: Self = Layout::Struct {
|
||||
field_layouts: &[],
|
||||
field_order_hash: FieldOrderHash::ZERO_FIELD_HASH,
|
||||
};
|
||||
|
||||
fn new_help<'b>(
|
||||
env: &mut Env<'a, 'b>,
|
||||
@ -926,7 +967,7 @@ impl<'a> Layout<'a> {
|
||||
|
||||
match self {
|
||||
Builtin(builtin) => builtin.safe_to_memcpy(),
|
||||
Struct(fields) => fields
|
||||
Struct { field_layouts, .. } => field_layouts
|
||||
.iter()
|
||||
.all(|field_layout| field_layout.safe_to_memcpy()),
|
||||
Union(variant) => {
|
||||
@ -990,10 +1031,10 @@ impl<'a> Layout<'a> {
|
||||
|
||||
match self {
|
||||
Builtin(builtin) => builtin.stack_size(target_info),
|
||||
Struct(fields) => {
|
||||
Struct { field_layouts, .. } => {
|
||||
let mut sum = 0;
|
||||
|
||||
for field_layout in *fields {
|
||||
for field_layout in *field_layouts {
|
||||
sum += field_layout.stack_size(target_info);
|
||||
}
|
||||
|
||||
@ -1020,7 +1061,7 @@ impl<'a> Layout<'a> {
|
||||
|
||||
pub fn alignment_bytes(&self, target_info: TargetInfo) -> u32 {
|
||||
match self {
|
||||
Layout::Struct(fields) => fields
|
||||
Layout::Struct { field_layouts, .. } => field_layouts
|
||||
.iter()
|
||||
.map(|x| x.alignment_bytes(target_info))
|
||||
.max()
|
||||
@ -1069,7 +1110,7 @@ impl<'a> Layout<'a> {
|
||||
pub fn allocation_alignment_bytes(&self, target_info: TargetInfo) -> u32 {
|
||||
match self {
|
||||
Layout::Builtin(builtin) => builtin.allocation_alignment_bytes(target_info),
|
||||
Layout::Struct(_) => unreachable!("not heap-allocated"),
|
||||
Layout::Struct { .. } => unreachable!("not heap-allocated"),
|
||||
Layout::Union(union_layout) => union_layout.allocation_alignment_bytes(target_info),
|
||||
Layout::LambdaSet(lambda_set) => lambda_set
|
||||
.runtime_representation()
|
||||
@ -1103,7 +1144,7 @@ impl<'a> Layout<'a> {
|
||||
|
||||
match self {
|
||||
Builtin(builtin) => builtin.is_refcounted(),
|
||||
Struct(fields) => fields.iter().any(|f| f.contains_refcounted()),
|
||||
Struct { field_layouts, .. } => field_layouts.iter().any(|f| f.contains_refcounted()),
|
||||
Union(variant) => {
|
||||
use UnionLayout::*;
|
||||
|
||||
@ -1134,8 +1175,8 @@ impl<'a> Layout<'a> {
|
||||
|
||||
match self {
|
||||
Builtin(builtin) => builtin.to_doc(alloc, parens),
|
||||
Struct(fields) => {
|
||||
let fields_doc = fields.iter().map(|x| x.to_doc(alloc, parens));
|
||||
Struct { field_layouts, .. } => {
|
||||
let fields_doc = field_layouts.iter().map(|x| x.to_doc(alloc, parens));
|
||||
|
||||
alloc
|
||||
.text("{")
|
||||
@ -1147,6 +1188,18 @@ impl<'a> Layout<'a> {
|
||||
RecursivePointer => alloc.text("*self"),
|
||||
}
|
||||
}
|
||||
|
||||
/// Used to build a `Layout::Struct` where the field name order is irrelevant.
|
||||
pub fn struct_no_name_order(field_layouts: &'a [Layout]) -> Self {
|
||||
if field_layouts.is_empty() {
|
||||
Self::UNIT
|
||||
} else {
|
||||
Self::Struct {
|
||||
field_layouts,
|
||||
field_order_hash: FieldOrderHash::IRRELEVANT_NON_ZERO_FIELD_HASH,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Avoid recomputing Layout from Variable multiple times.
|
||||
@ -1590,6 +1643,11 @@ fn layout_from_flat_type<'a>(
|
||||
size2.cmp(&size1).then(label1.cmp(label2))
|
||||
});
|
||||
|
||||
let ordered_field_names =
|
||||
Vec::from_iter_in(pairs.iter().map(|(label, _)| *label), arena);
|
||||
let field_order_hash =
|
||||
FieldOrderHash::from_ordered_fields(ordered_field_names.as_slice());
|
||||
|
||||
let mut layouts = Vec::from_iter_in(pairs.into_iter().map(|t| t.1), arena);
|
||||
|
||||
if layouts.len() == 1 {
|
||||
@ -1597,7 +1655,10 @@ fn layout_from_flat_type<'a>(
|
||||
// unwrap it.
|
||||
Ok(layouts.pop().unwrap())
|
||||
} else {
|
||||
Ok(Layout::Struct(layouts.into_bump_slice()))
|
||||
Ok(Layout::Struct {
|
||||
field_order_hash,
|
||||
field_layouts: layouts.into_bump_slice(),
|
||||
})
|
||||
}
|
||||
}
|
||||
TagUnion(tags, ext_var) => {
|
||||
@ -2430,7 +2491,7 @@ fn layout_from_tag_union<'a>(
|
||||
let answer1 = if field_layouts.len() == 1 {
|
||||
field_layouts[0]
|
||||
} else {
|
||||
Layout::Struct(field_layouts.into_bump_slice())
|
||||
Layout::struct_no_name_order(field_layouts.into_bump_slice())
|
||||
};
|
||||
|
||||
answer1
|
||||
|
@ -13,6 +13,9 @@ use crate::helpers::wasm::assert_evals_to;
|
||||
// use crate::assert_wasm_evals_to as assert_evals_to;
|
||||
use indoc::indoc;
|
||||
|
||||
#[cfg(test)]
|
||||
use roc_std::RocList;
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))]
|
||||
fn basic_record() {
|
||||
@ -1007,6 +1010,31 @@ fn both_have_unique_fields() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
// TODO(brian-carroll): enable wasm (https://github.com/rtfeldman/roc/issues/2549)
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
// https://github.com/rtfeldman/roc/issues/2535
|
||||
fn different_proc_types_specialized_to_same_layout() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [ nums ] to "./platform"
|
||||
|
||||
alpha = { a: 1, b: 2 }
|
||||
|
||||
nums : List U8
|
||||
nums =
|
||||
[
|
||||
alpha.a,
|
||||
alpha.b,
|
||||
]
|
||||
"#
|
||||
),
|
||||
RocList::from_slice(&[1, 2]),
|
||||
RocList<u8>
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
#[should_panic(
|
||||
|
@ -1,3 +1,3 @@
|
||||
procedure Test.0 ():
|
||||
let Test.3 : Builtin(Int(I64)) = 3i64;
|
||||
let Test.3 : I64 = 3i64;
|
||||
ret Test.3;
|
||||
|
@ -1,3 +1,3 @@
|
||||
procedure Test.0 ():
|
||||
let Test.2 : Builtin(Int(I64)) = 5i64;
|
||||
let Test.2 : I64 = 5i64;
|
||||
ret Test.2;
|
||||
|
@ -1,17 +1,17 @@
|
||||
procedure Test.2 (Test.6, #Attr.12):
|
||||
let Test.1 : Builtin(Int(U8)) = StructAtIndex 0 #Attr.12;
|
||||
let Test.11 : LambdaSet(LambdaSet { set: [( Test.4, [Builtin(Int(U8))])], representation: Struct([Builtin(Int(U8))]) }) = Struct {Test.1};
|
||||
let Test.1 : U8 = StructAtIndex 0 #Attr.12;
|
||||
let Test.11 : {U8} = Struct {Test.1};
|
||||
ret Test.11;
|
||||
|
||||
procedure Test.4 (Test.5, #Attr.12):
|
||||
let Test.1 : Builtin(Int(U8)) = StructAtIndex 0 #Attr.12;
|
||||
let Test.1 : U8 = StructAtIndex 0 #Attr.12;
|
||||
ret Test.1;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.1 : Builtin(Int(U8)) = 1i64;
|
||||
let Test.8 : Struct([]) = Struct {};
|
||||
let Test.10 : Struct([]) = Struct {};
|
||||
let Test.14 : LambdaSet(LambdaSet { set: [( Test.2, [Builtin(Int(U8))])], representation: Struct([Builtin(Int(U8))]) }) = Struct {Test.1};
|
||||
let Test.9 : LambdaSet(LambdaSet { set: [( Test.4, [Builtin(Int(U8))])], representation: Struct([Builtin(Int(U8))]) }) = CallByName Test.2 Test.10 Test.14;
|
||||
let Test.7 : Builtin(Int(U8)) = CallByName Test.4 Test.8 Test.9;
|
||||
let Test.1 : U8 = 1i64;
|
||||
let Test.8 : {} = Struct {};
|
||||
let Test.10 : {} = Struct {};
|
||||
let Test.14 : {U8} = Struct {Test.1};
|
||||
let Test.9 : {U8} = CallByName Test.2 Test.10 Test.14;
|
||||
let Test.7 : U8 = CallByName Test.4 Test.8 Test.9;
|
||||
ret Test.7;
|
||||
|
@ -1,9 +1,9 @@
|
||||
procedure Test.0 ():
|
||||
let Test.2 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.5 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.6 : Builtin(Bool) = lowlevel Eq Test.5 Test.2;
|
||||
let Test.2 : I64 = 0i64;
|
||||
let Test.5 : I64 = 1i64;
|
||||
let Test.6 : Int1 = lowlevel Eq Test.5 Test.2;
|
||||
if Test.6 then
|
||||
let Test.3 : Builtin(Int(I64)) = 12i64;
|
||||
let Test.3 : I64 = 12i64;
|
||||
ret Test.3;
|
||||
else
|
||||
ret Test.2;
|
||||
|
@ -1,21 +1,21 @@
|
||||
procedure List.7 (#Attr.2):
|
||||
let Test.8 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
||||
let Test.8 : U64 = lowlevel ListLen #Attr.2;
|
||||
ret Test.8;
|
||||
|
||||
procedure Test.1 (Test.5):
|
||||
let Test.2 : Builtin(Int(I64)) = 41i64;
|
||||
let Test.12 : LambdaSet(LambdaSet { set: [( Test.3, [Builtin(Int(I64))])], representation: Struct([Builtin(Int(I64))]) }) = Struct {Test.2};
|
||||
let Test.11 : Builtin(List(LambdaSet(LambdaSet { set: [( Test.3, [Builtin(Int(I64))])], representation: Struct([Builtin(Int(I64))]) }))) = Array [Test.12];
|
||||
let Test.2 : I64 = 41i64;
|
||||
let Test.12 : {I64} = Struct {Test.2};
|
||||
let Test.11 : List {I64} = Array [Test.12];
|
||||
ret Test.11;
|
||||
|
||||
procedure Test.3 (Test.10, #Attr.12):
|
||||
let Test.2 : Builtin(Int(I64)) = StructAtIndex 0 #Attr.12;
|
||||
let Test.2 : Builtin(Int(I64)) = 41i64;
|
||||
let Test.2 : I64 = StructAtIndex 0 #Attr.12;
|
||||
let Test.2 : I64 = 41i64;
|
||||
ret Test.2;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.9 : Struct([]) = Struct {};
|
||||
let Test.7 : Builtin(List(LambdaSet(LambdaSet { set: [( Test.3, [Builtin(Int(I64))])], representation: Struct([Builtin(Int(I64))]) }))) = CallByName Test.1 Test.9;
|
||||
let Test.6 : Builtin(Int(U64)) = CallByName List.7 Test.7;
|
||||
let Test.9 : {} = Struct {};
|
||||
let Test.7 : List {I64} = CallByName Test.1 Test.9;
|
||||
let Test.6 : U64 = CallByName List.7 Test.7;
|
||||
dec Test.7;
|
||||
ret Test.6;
|
||||
|
@ -1,13 +1,13 @@
|
||||
procedure Dict.2 ():
|
||||
let Test.4 : Builtin(Dict(Union(NonRecursive([])), Union(NonRecursive([])))) = lowlevel DictEmpty ;
|
||||
let Test.4 : Dict [] [] = lowlevel DictEmpty ;
|
||||
ret Test.4;
|
||||
|
||||
procedure Dict.8 (#Attr.2):
|
||||
let Test.3 : Builtin(Int(U64)) = lowlevel DictSize #Attr.2;
|
||||
let Test.3 : U64 = lowlevel DictSize #Attr.2;
|
||||
dec #Attr.2;
|
||||
ret Test.3;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.2 : Builtin(Dict(Union(NonRecursive([])), Union(NonRecursive([])))) = CallByName Dict.2;
|
||||
let Test.1 : Builtin(Int(U64)) = CallByName Dict.8 Test.2;
|
||||
let Test.2 : Dict [] [] = CallByName Dict.2;
|
||||
let Test.1 : U64 = CallByName Dict.8 Test.2;
|
||||
ret Test.1;
|
||||
|
@ -1,42 +1,42 @@
|
||||
procedure List.3 (#Attr.2, #Attr.3):
|
||||
let Test.20 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
||||
let Test.17 : Builtin(Bool) = lowlevel NumLt #Attr.3 Test.20;
|
||||
let Test.20 : U64 = lowlevel ListLen #Attr.2;
|
||||
let Test.17 : Int1 = lowlevel NumLt #Attr.3 Test.20;
|
||||
if Test.17 then
|
||||
let Test.19 : LambdaSet(LambdaSet { set: [( Test.2, [])], representation: Struct([]) }) = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
|
||||
let Test.18 : Union(NonRecursive([[Struct([])], [LambdaSet(LambdaSet { set: [( Test.2, [])], representation: Struct([]) })]])) = Ok Test.19;
|
||||
let Test.19 : {} = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
|
||||
let Test.18 : [C {}, C {}] = Ok Test.19;
|
||||
ret Test.18;
|
||||
else
|
||||
let Test.16 : Struct([]) = Struct {};
|
||||
let Test.15 : Union(NonRecursive([[Struct([])], [LambdaSet(LambdaSet { set: [( Test.2, [])], representation: Struct([]) })]])) = Err Test.16;
|
||||
let Test.16 : {} = Struct {};
|
||||
let Test.15 : [C {}, C {}] = Err Test.16;
|
||||
ret Test.15;
|
||||
|
||||
procedure Test.2 (Test.6):
|
||||
let Test.24 : Builtin(Str) = "bar";
|
||||
let Test.24 : Str = "bar";
|
||||
ret Test.24;
|
||||
|
||||
procedure Test.0 ():
|
||||
joinpoint Test.22 Test.3:
|
||||
let Test.14 : Builtin(Int(U64)) = 0i64;
|
||||
let Test.7 : Union(NonRecursive([[Struct([])], [LambdaSet(LambdaSet { set: [( Test.2, [])], representation: Struct([]) })]])) = CallByName List.3 Test.3 Test.14;
|
||||
let Test.14 : U64 = 0i64;
|
||||
let Test.7 : [C {}, C {}] = CallByName List.3 Test.3 Test.14;
|
||||
dec Test.3;
|
||||
let Test.11 : Builtin(Int(U8)) = 1i64;
|
||||
let Test.12 : Builtin(Int(U8)) = GetTagId Test.7;
|
||||
let Test.13 : Builtin(Bool) = lowlevel Eq Test.11 Test.12;
|
||||
let Test.11 : U8 = 1i64;
|
||||
let Test.12 : U8 = GetTagId Test.7;
|
||||
let Test.13 : Int1 = lowlevel Eq Test.11 Test.12;
|
||||
if Test.13 then
|
||||
let Test.5 : LambdaSet(LambdaSet { set: [( Test.2, [])], representation: Struct([]) }) = UnionAtIndex (Id 1) (Index 0) Test.7;
|
||||
let Test.9 : Builtin(Str) = "foo";
|
||||
let Test.8 : Builtin(Str) = CallByName Test.2 Test.9;
|
||||
let Test.5 : {} = UnionAtIndex (Id 1) (Index 0) Test.7;
|
||||
let Test.9 : Str = "foo";
|
||||
let Test.8 : Str = CallByName Test.2 Test.9;
|
||||
dec Test.9;
|
||||
ret Test.8;
|
||||
else
|
||||
let Test.10 : Builtin(Str) = "bad!";
|
||||
let Test.10 : Str = "bad!";
|
||||
ret Test.10;
|
||||
in
|
||||
let Test.25 : Builtin(Bool) = false;
|
||||
let Test.25 : Int1 = false;
|
||||
if Test.25 then
|
||||
let Test.1 : Builtin(List(LambdaSet(LambdaSet { set: [( Test.2, [])], representation: Struct([]) }))) = Array [];
|
||||
let Test.1 : List {} = Array [];
|
||||
jump Test.22 Test.1;
|
||||
else
|
||||
let Test.23 : LambdaSet(LambdaSet { set: [( Test.2, [])], representation: Struct([]) }) = Struct {};
|
||||
let Test.21 : Builtin(List(LambdaSet(LambdaSet { set: [( Test.2, [])], representation: Struct([]) }))) = Array [Test.23];
|
||||
let Test.23 : {} = Struct {};
|
||||
let Test.21 : List {} = Array [Test.23];
|
||||
jump Test.22 Test.21;
|
||||
|
@ -1,27 +1,27 @@
|
||||
procedure Num.23 (#Attr.2, #Attr.3):
|
||||
let Test.14 : Builtin(Int(I64)) = lowlevel NumSub #Attr.2 #Attr.3;
|
||||
let Test.14 : I64 = lowlevel NumSub #Attr.2 #Attr.3;
|
||||
ret Test.14;
|
||||
|
||||
procedure Num.24 (#Attr.2, #Attr.3):
|
||||
let Test.12 : Builtin(Int(I64)) = lowlevel NumMul #Attr.2 #Attr.3;
|
||||
let Test.12 : I64 = lowlevel NumMul #Attr.2 #Attr.3;
|
||||
ret Test.12;
|
||||
|
||||
procedure Test.1 (Test.17, Test.18):
|
||||
joinpoint Test.7 Test.2 Test.3:
|
||||
let Test.15 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.16 : Builtin(Bool) = lowlevel Eq Test.15 Test.2;
|
||||
let Test.15 : I64 = 0i64;
|
||||
let Test.16 : Int1 = lowlevel Eq Test.15 Test.2;
|
||||
if Test.16 then
|
||||
ret Test.3;
|
||||
else
|
||||
let Test.13 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.10 : Builtin(Int(I64)) = CallByName Num.23 Test.2 Test.13;
|
||||
let Test.11 : Builtin(Int(I64)) = CallByName Num.24 Test.2 Test.3;
|
||||
let Test.13 : I64 = 1i64;
|
||||
let Test.10 : I64 = CallByName Num.23 Test.2 Test.13;
|
||||
let Test.11 : I64 = CallByName Num.24 Test.2 Test.3;
|
||||
jump Test.7 Test.10 Test.11;
|
||||
in
|
||||
jump Test.7 Test.17 Test.18;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.5 : Builtin(Int(I64)) = 10i64;
|
||||
let Test.6 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.4 : Builtin(Int(I64)) = CallByName Test.1 Test.5 Test.6;
|
||||
let Test.5 : I64 = 10i64;
|
||||
let Test.6 : I64 = 1i64;
|
||||
let Test.4 : I64 = CallByName Test.1 Test.5 Test.6;
|
||||
ret Test.4;
|
||||
|
@ -3,9 +3,9 @@ procedure Test.1 (Test.2, Test.3):
|
||||
ret Test.2;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.5 : Builtin(List(Builtin(Int(I64)))) = Array [1i64, 2i64, 3i64];
|
||||
let Test.6 : Builtin(List(Builtin(Int(I64)))) = Array [3i64, 2i64, 1i64];
|
||||
let Test.4 : Builtin(List(Builtin(Int(I64)))) = CallByName Test.1 Test.5 Test.6;
|
||||
let Test.5 : List I64 = Array [1i64, 2i64, 3i64];
|
||||
let Test.6 : List I64 = Array [3i64, 2i64, 1i64];
|
||||
let Test.4 : List I64 = CallByName Test.1 Test.5 Test.6;
|
||||
dec Test.6;
|
||||
dec Test.5;
|
||||
ret Test.4;
|
||||
|
@ -1,25 +1,25 @@
|
||||
procedure Test.1 (Test.3):
|
||||
let Test.6 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.6 : I64 = 2i64;
|
||||
joinpoint Test.11:
|
||||
let Test.10 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.10 : I64 = 0i64;
|
||||
ret Test.10;
|
||||
in
|
||||
let Test.13 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.14 : Builtin(Bool) = lowlevel Eq Test.13 Test.6;
|
||||
let Test.13 : I64 = 2i64;
|
||||
let Test.14 : Int1 = lowlevel Eq Test.13 Test.6;
|
||||
if Test.14 then
|
||||
joinpoint Test.8 Test.12:
|
||||
if Test.12 then
|
||||
let Test.7 : Builtin(Int(I64)) = 42i64;
|
||||
let Test.7 : I64 = 42i64;
|
||||
ret Test.7;
|
||||
else
|
||||
jump Test.11;
|
||||
in
|
||||
let Test.9 : Builtin(Bool) = false;
|
||||
let Test.9 : Int1 = false;
|
||||
jump Test.8 Test.9;
|
||||
else
|
||||
jump Test.11;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.5 : Struct([]) = Struct {};
|
||||
let Test.4 : Builtin(Int(I64)) = CallByName Test.1 Test.5;
|
||||
let Test.5 : {} = Struct {};
|
||||
let Test.4 : I64 = CallByName Test.1 Test.5;
|
||||
ret Test.4;
|
||||
|
@ -1,30 +1,30 @@
|
||||
procedure Test.3 (Test.29):
|
||||
joinpoint Test.13 Test.4:
|
||||
let Test.23 : Builtin(Bool) = 1i64;
|
||||
let Test.24 : Builtin(Bool) = GetTagId Test.4;
|
||||
let Test.25 : Builtin(Bool) = lowlevel Eq Test.23 Test.24;
|
||||
let Test.23 : Int1 = 1i64;
|
||||
let Test.24 : Int1 = GetTagId Test.4;
|
||||
let Test.25 : Int1 = lowlevel Eq Test.23 Test.24;
|
||||
if Test.25 then
|
||||
let Test.14 : Builtin(Bool) = false;
|
||||
let Test.14 : Int1 = false;
|
||||
ret Test.14;
|
||||
else
|
||||
let Test.19 : Union(NonRecursive([[Builtin(Int(I64))], []])) = UnionAtIndex (Id 0) (Index 0) Test.4;
|
||||
let Test.20 : Builtin(Int(U8)) = 1i64;
|
||||
let Test.21 : Builtin(Int(U8)) = GetTagId Test.19;
|
||||
let Test.22 : Builtin(Bool) = lowlevel Eq Test.20 Test.21;
|
||||
let Test.19 : [C I64, C ] = UnionAtIndex (Id 0) (Index 0) Test.4;
|
||||
let Test.20 : U8 = 1i64;
|
||||
let Test.21 : U8 = GetTagId Test.19;
|
||||
let Test.22 : Int1 = lowlevel Eq Test.20 Test.21;
|
||||
if Test.22 then
|
||||
let Test.15 : Builtin(Bool) = true;
|
||||
let Test.15 : Int1 = true;
|
||||
ret Test.15;
|
||||
else
|
||||
let Test.7 : Union(NullableUnwrapped { nullable_id: true, other_fields: [Union(NonRecursive([[Builtin(Int(I64))], []])), RecursivePointer] }) = UnionAtIndex (Id 0) (Index 1) Test.4;
|
||||
let Test.7 : TODO = UnionAtIndex (Id 0) (Index 1) Test.4;
|
||||
jump Test.13 Test.7;
|
||||
in
|
||||
jump Test.13 Test.29;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.28 : Builtin(Int(I64)) = 3i64;
|
||||
let Test.26 : Union(NonRecursive([[Builtin(Int(I64))], []])) = Just Test.28;
|
||||
let Test.27 : Union(NullableUnwrapped { nullable_id: true, other_fields: [Union(NonRecursive([[Builtin(Int(I64))], []])), RecursivePointer] }) = Nil ;
|
||||
let Test.12 : Union(NullableUnwrapped { nullable_id: true, other_fields: [Union(NonRecursive([[Builtin(Int(I64))], []])), RecursivePointer] }) = Cons Test.26 Test.27;
|
||||
let Test.11 : Builtin(Bool) = CallByName Test.3 Test.12;
|
||||
let Test.28 : I64 = 3i64;
|
||||
let Test.26 : [C I64, C ] = Just Test.28;
|
||||
let Test.27 : TODO = Nil ;
|
||||
let Test.12 : TODO = Cons Test.26 Test.27;
|
||||
let Test.11 : Int1 = CallByName Test.3 Test.12;
|
||||
dec Test.12;
|
||||
ret Test.11;
|
||||
|
@ -1,22 +1,22 @@
|
||||
procedure Bool.7 (#Attr.2, #Attr.3):
|
||||
let Test.11 : Builtin(Bool) = lowlevel Eq #Attr.2 #Attr.3;
|
||||
let Test.11 : Int1 = lowlevel Eq #Attr.2 #Attr.3;
|
||||
ret Test.11;
|
||||
|
||||
procedure Test.1 (Test.3):
|
||||
let Test.6 : Builtin(Int(I64)) = 10i64;
|
||||
let Test.6 : I64 = 10i64;
|
||||
joinpoint Test.8 Test.13:
|
||||
if Test.13 then
|
||||
let Test.7 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.7 : I64 = 0i64;
|
||||
ret Test.7;
|
||||
else
|
||||
let Test.12 : Builtin(Int(I64)) = 42i64;
|
||||
let Test.12 : I64 = 42i64;
|
||||
ret Test.12;
|
||||
in
|
||||
let Test.10 : Builtin(Int(I64)) = 5i64;
|
||||
let Test.9 : Builtin(Bool) = CallByName Bool.7 Test.6 Test.10;
|
||||
let Test.10 : I64 = 5i64;
|
||||
let Test.9 : Int1 = CallByName Bool.7 Test.6 Test.10;
|
||||
jump Test.8 Test.9;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.5 : Struct([]) = Struct {};
|
||||
let Test.4 : Builtin(Int(I64)) = CallByName Test.1 Test.5;
|
||||
let Test.5 : {} = Struct {};
|
||||
let Test.4 : I64 = CallByName Test.1 Test.5;
|
||||
ret Test.4;
|
||||
|
@ -1,13 +1,13 @@
|
||||
procedure Test.0 ():
|
||||
let Test.6 : Builtin(Bool) = true;
|
||||
let Test.6 : Int1 = true;
|
||||
if Test.6 then
|
||||
let Test.7 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.7 : I64 = 1i64;
|
||||
ret Test.7;
|
||||
else
|
||||
let Test.4 : Builtin(Bool) = false;
|
||||
let Test.4 : Int1 = false;
|
||||
if Test.4 then
|
||||
let Test.5 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.5 : I64 = 2i64;
|
||||
ret Test.5;
|
||||
else
|
||||
let Test.3 : Builtin(Int(I64)) = 3i64;
|
||||
let Test.3 : I64 = 3i64;
|
||||
ret Test.3;
|
||||
|
@ -1,3 +1,3 @@
|
||||
procedure Test.0 ():
|
||||
let Test.1 : Builtin(Int(I64)) = 5i64;
|
||||
let Test.1 : I64 = 5i64;
|
||||
ret Test.1;
|
||||
|
@ -1,19 +1,19 @@
|
||||
procedure List.7 (#Attr.2):
|
||||
let Test.7 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
||||
let Test.7 : U64 = lowlevel ListLen #Attr.2;
|
||||
ret Test.7;
|
||||
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.5 : Builtin(Int(U64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.5 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.5;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.10 : Builtin(Int(U64)) = 5i64;
|
||||
let Test.11 : Builtin(Int(U64)) = 4i64;
|
||||
let Test.8 : Builtin(Int(U64)) = CallByName Num.22 Test.10 Test.11;
|
||||
let Test.9 : Builtin(Int(U64)) = 3i64;
|
||||
let Test.3 : Builtin(Int(U64)) = CallByName Num.22 Test.8 Test.9;
|
||||
let Test.6 : Builtin(List(Builtin(Int(I64)))) = Array [1i64, 2i64];
|
||||
let Test.4 : Builtin(Int(U64)) = CallByName List.7 Test.6;
|
||||
let Test.10 : U64 = 5i64;
|
||||
let Test.11 : U64 = 4i64;
|
||||
let Test.8 : U64 = CallByName Num.22 Test.10 Test.11;
|
||||
let Test.9 : U64 = 3i64;
|
||||
let Test.3 : U64 = CallByName Num.22 Test.8 Test.9;
|
||||
let Test.6 : List I64 = Array [1i64, 2i64];
|
||||
let Test.4 : U64 = CallByName List.7 Test.6;
|
||||
dec Test.6;
|
||||
let Test.2 : Builtin(Int(U64)) = CallByName Num.22 Test.3 Test.4;
|
||||
let Test.2 : U64 = CallByName Num.22 Test.3 Test.4;
|
||||
ret Test.2;
|
||||
|
@ -1,3 +1,3 @@
|
||||
procedure Test.0 ():
|
||||
let Test.1 : Builtin(Int(I64)) = 5i64;
|
||||
let Test.1 : I64 = 5i64;
|
||||
ret Test.1;
|
||||
|
@ -1,9 +1,9 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.4 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.4 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.4;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.2 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.3 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.1 : Builtin(Int(I64)) = CallByName Num.22 Test.2 Test.3;
|
||||
let Test.2 : I64 = 1i64;
|
||||
let Test.3 : I64 = 2i64;
|
||||
let Test.1 : I64 = CallByName Num.22 Test.2 Test.3;
|
||||
ret Test.1;
|
||||
|
@ -1,8 +1,8 @@
|
||||
procedure Num.45 (#Attr.2):
|
||||
let Test.3 : Builtin(Int(I64)) = lowlevel NumRound #Attr.2;
|
||||
let Test.3 : I64 = lowlevel NumRound #Attr.2;
|
||||
ret Test.3;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.2 : Builtin(Float(F64)) = 3.6f64;
|
||||
let Test.1 : Builtin(Int(I64)) = CallByName Num.45 Test.2;
|
||||
let Test.2 : Float64 = 3.6f64;
|
||||
let Test.1 : I64 = CallByName Num.45 Test.2;
|
||||
ret Test.1;
|
||||
|
@ -1,9 +1,9 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.6 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.6 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.6;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.4 : Builtin(Int(I64)) = 3i64;
|
||||
let Test.5 : Builtin(Int(I64)) = 4i64;
|
||||
let Test.3 : Builtin(Int(I64)) = CallByName Num.22 Test.4 Test.5;
|
||||
let Test.4 : I64 = 3i64;
|
||||
let Test.5 : I64 = 4i64;
|
||||
let Test.3 : I64 = CallByName Num.22 Test.4 Test.5;
|
||||
ret Test.3;
|
||||
|
@ -1,25 +1,25 @@
|
||||
procedure Num.40 (#Attr.2, #Attr.3):
|
||||
let Test.15 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.12 : Builtin(Bool) = lowlevel NotEq #Attr.3 Test.15;
|
||||
let Test.15 : I64 = 0i64;
|
||||
let Test.12 : Int1 = lowlevel NotEq #Attr.3 Test.15;
|
||||
if Test.12 then
|
||||
let Test.14 : Builtin(Int(I64)) = lowlevel NumDivUnchecked #Attr.2 #Attr.3;
|
||||
let Test.13 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = Ok Test.14;
|
||||
let Test.14 : I64 = lowlevel NumDivUnchecked #Attr.2 #Attr.3;
|
||||
let Test.13 : [C {}, C I64] = Ok Test.14;
|
||||
ret Test.13;
|
||||
else
|
||||
let Test.11 : Struct([]) = Struct {};
|
||||
let Test.10 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = Err Test.11;
|
||||
let Test.11 : {} = Struct {};
|
||||
let Test.10 : [C {}, C I64] = Err Test.11;
|
||||
ret Test.10;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.8 : Builtin(Int(I64)) = 1000i64;
|
||||
let Test.9 : Builtin(Int(I64)) = 10i64;
|
||||
let Test.2 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = CallByName Num.40 Test.8 Test.9;
|
||||
let Test.5 : Builtin(Int(U8)) = 1i64;
|
||||
let Test.6 : Builtin(Int(U8)) = GetTagId Test.2;
|
||||
let Test.7 : Builtin(Bool) = lowlevel Eq Test.5 Test.6;
|
||||
let Test.8 : I64 = 1000i64;
|
||||
let Test.9 : I64 = 10i64;
|
||||
let Test.2 : [C {}, C I64] = CallByName Num.40 Test.8 Test.9;
|
||||
let Test.5 : U8 = 1i64;
|
||||
let Test.6 : U8 = GetTagId Test.2;
|
||||
let Test.7 : Int1 = lowlevel Eq Test.5 Test.6;
|
||||
if Test.7 then
|
||||
let Test.1 : Builtin(Int(I64)) = UnionAtIndex (Id 1) (Index 0) Test.2;
|
||||
let Test.1 : I64 = UnionAtIndex (Id 1) (Index 0) Test.2;
|
||||
ret Test.1;
|
||||
else
|
||||
let Test.4 : Builtin(Int(I64)) = -1i64;
|
||||
let Test.4 : I64 = -1i64;
|
||||
ret Test.4;
|
||||
|
@ -1,18 +1,18 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.6 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.6 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.6;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.11 : Builtin(Int(I64)) = 41i64;
|
||||
let Test.1 : Union(NonRecursive([[Builtin(Int(I64))], []])) = Just Test.11;
|
||||
let Test.8 : Builtin(Int(U8)) = 0i64;
|
||||
let Test.9 : Builtin(Int(U8)) = GetTagId Test.1;
|
||||
let Test.10 : Builtin(Bool) = lowlevel Eq Test.8 Test.9;
|
||||
let Test.11 : I64 = 41i64;
|
||||
let Test.1 : [C I64, C ] = Just Test.11;
|
||||
let Test.8 : U8 = 0i64;
|
||||
let Test.9 : U8 = GetTagId Test.1;
|
||||
let Test.10 : Int1 = lowlevel Eq Test.8 Test.9;
|
||||
if Test.10 then
|
||||
let Test.3 : Builtin(Int(I64)) = UnionAtIndex (Id 0) (Index 0) Test.1;
|
||||
let Test.5 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.4 : Builtin(Int(I64)) = CallByName Num.22 Test.3 Test.5;
|
||||
let Test.3 : I64 = UnionAtIndex (Id 0) (Index 0) Test.1;
|
||||
let Test.5 : I64 = 1i64;
|
||||
let Test.4 : I64 = CallByName Num.22 Test.3 Test.5;
|
||||
ret Test.4;
|
||||
else
|
||||
let Test.7 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.7 : I64 = 1i64;
|
||||
ret Test.7;
|
||||
|
@ -1,12 +1,12 @@
|
||||
procedure Test.0 ():
|
||||
let Test.9 : Builtin(Int(I64)) = 3i64;
|
||||
let Test.3 : Union(NonRecursive([[Builtin(Int(I64))], []])) = Just Test.9;
|
||||
let Test.6 : Builtin(Int(U8)) = 0i64;
|
||||
let Test.7 : Builtin(Int(U8)) = GetTagId Test.3;
|
||||
let Test.8 : Builtin(Bool) = lowlevel Eq Test.6 Test.7;
|
||||
let Test.9 : I64 = 3i64;
|
||||
let Test.3 : [C I64, C ] = Just Test.9;
|
||||
let Test.6 : U8 = 0i64;
|
||||
let Test.7 : U8 = GetTagId Test.3;
|
||||
let Test.8 : Int1 = lowlevel Eq Test.6 Test.7;
|
||||
if Test.8 then
|
||||
let Test.2 : Builtin(Int(I64)) = UnionAtIndex (Id 0) (Index 0) Test.3;
|
||||
let Test.2 : I64 = UnionAtIndex (Id 0) (Index 0) Test.3;
|
||||
ret Test.2;
|
||||
else
|
||||
let Test.5 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.5 : I64 = 0i64;
|
||||
ret Test.5;
|
||||
|
@ -1,6 +1,6 @@
|
||||
procedure Test.0 ():
|
||||
let Test.4 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.5 : Builtin(Float(F64)) = 3.14f64;
|
||||
let Test.2 : Struct([Builtin(Int(I64)), Builtin(Float(F64))]) = Struct {Test.4, Test.5};
|
||||
let Test.1 : Builtin(Int(I64)) = StructAtIndex 0 Test.2;
|
||||
let Test.4 : I64 = 1i64;
|
||||
let Test.5 : Float64 = 3.14f64;
|
||||
let Test.2 : {I64, Float64} = Struct {Test.4, Test.5};
|
||||
let Test.1 : I64 = StructAtIndex 0 Test.2;
|
||||
ret Test.1;
|
||||
|
@ -1,18 +1,18 @@
|
||||
procedure Test.0 ():
|
||||
let Test.10 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.11 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.5 : Union(NonRecursive([[Builtin(Int(I64))], [Builtin(Int(I64)), Builtin(Int(I64))], [Builtin(Int(I64))]])) = These Test.10 Test.11;
|
||||
let Test.9 : Builtin(Int(U8)) = GetTagId Test.5;
|
||||
let Test.10 : I64 = 1i64;
|
||||
let Test.11 : I64 = 2i64;
|
||||
let Test.5 : [C I64, C I64 I64, C I64] = These Test.10 Test.11;
|
||||
let Test.9 : U8 = GetTagId Test.5;
|
||||
switch Test.9:
|
||||
case 2:
|
||||
let Test.2 : Builtin(Int(I64)) = UnionAtIndex (Id 2) (Index 0) Test.5;
|
||||
let Test.2 : I64 = UnionAtIndex (Id 2) (Index 0) Test.5;
|
||||
ret Test.2;
|
||||
|
||||
case 0:
|
||||
let Test.3 : Builtin(Int(I64)) = UnionAtIndex (Id 0) (Index 0) Test.5;
|
||||
let Test.3 : I64 = UnionAtIndex (Id 0) (Index 0) Test.5;
|
||||
ret Test.3;
|
||||
|
||||
default:
|
||||
let Test.4 : Builtin(Int(I64)) = UnionAtIndex (Id 1) (Index 0) Test.5;
|
||||
let Test.4 : I64 = UnionAtIndex (Id 1) (Index 0) Test.5;
|
||||
ret Test.4;
|
||||
|
||||
|
@ -1,18 +1,18 @@
|
||||
procedure Test.2 (Test.3):
|
||||
let Test.12 : Builtin(Bool) = 1i64;
|
||||
let Test.13 : Builtin(Bool) = GetTagId Test.3;
|
||||
let Test.14 : Builtin(Bool) = lowlevel Eq Test.12 Test.13;
|
||||
let Test.12 : Int1 = 1i64;
|
||||
let Test.13 : Int1 = GetTagId Test.3;
|
||||
let Test.14 : Int1 = lowlevel Eq Test.12 Test.13;
|
||||
if Test.14 then
|
||||
let Test.10 : Builtin(Bool) = true;
|
||||
let Test.10 : Int1 = true;
|
||||
ret Test.10;
|
||||
else
|
||||
let Test.11 : Builtin(Bool) = false;
|
||||
let Test.11 : Int1 = false;
|
||||
ret Test.11;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.15 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.16 : Union(NullableUnwrapped { nullable_id: true, other_fields: [Builtin(Int(I64)), RecursivePointer] }) = Nil ;
|
||||
let Test.9 : Union(NullableUnwrapped { nullable_id: true, other_fields: [Builtin(Int(I64)), RecursivePointer] }) = Cons Test.15 Test.16;
|
||||
let Test.8 : Builtin(Bool) = CallByName Test.2 Test.9;
|
||||
let Test.15 : I64 = 2i64;
|
||||
let Test.16 : TODO = Nil ;
|
||||
let Test.9 : TODO = Cons Test.15 Test.16;
|
||||
let Test.8 : Int1 = CallByName Test.2 Test.9;
|
||||
dec Test.9;
|
||||
ret Test.8;
|
||||
|
@ -0,0 +1,19 @@
|
||||
procedure Test.1 ():
|
||||
let Test.11 : I64 = 2i64;
|
||||
let Test.12 : U8 = 1i64;
|
||||
let Test.10 : {I64, U8} = Struct {Test.11, Test.12};
|
||||
ret Test.10;
|
||||
|
||||
procedure Test.1 ():
|
||||
let Test.7 : I64 = 1i64;
|
||||
let Test.8 : U8 = 2i64;
|
||||
let Test.6 : {I64, U8} = Struct {Test.7, Test.8};
|
||||
ret Test.6;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.9 : {I64, U8} = CallByName Test.1;
|
||||
let Test.3 : U8 = StructAtIndex 1 Test.9;
|
||||
let Test.5 : {I64, U8} = CallByName Test.1;
|
||||
let Test.4 : U8 = StructAtIndex 1 Test.5;
|
||||
let Test.2 : List U8 = Array [Test.3, Test.4];
|
||||
ret Test.2;
|
@ -1,6 +1,6 @@
|
||||
procedure Test.0 ():
|
||||
let Test.4 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.5 : Builtin(Float(F64)) = 3.14f64;
|
||||
let Test.3 : Struct([Builtin(Int(I64)), Builtin(Float(F64))]) = Struct {Test.4, Test.5};
|
||||
let Test.1 : Builtin(Int(I64)) = StructAtIndex 0 Test.3;
|
||||
let Test.4 : I64 = 2i64;
|
||||
let Test.5 : Float64 = 3.14f64;
|
||||
let Test.3 : {I64, Float64} = Struct {Test.4, Test.5};
|
||||
let Test.1 : I64 = StructAtIndex 0 Test.3;
|
||||
ret Test.1;
|
||||
|
@ -1,8 +1,8 @@
|
||||
procedure Test.0 ():
|
||||
let Test.4 : Builtin(List(Builtin(Int(I64)))) = Array [1i64, 3i64, 4i64];
|
||||
let Test.5 : Builtin(Float(F64)) = 3.14f64;
|
||||
let Test.3 : Struct([Builtin(List(Builtin(Int(I64)))), Builtin(Float(F64))]) = Struct {Test.4, Test.5};
|
||||
let Test.1 : Builtin(List(Builtin(Int(I64)))) = StructAtIndex 0 Test.3;
|
||||
let Test.4 : List I64 = Array [1i64, 3i64, 4i64];
|
||||
let Test.5 : Float64 = 3.14f64;
|
||||
let Test.3 : {List I64, Float64} = Struct {Test.4, Test.5};
|
||||
let Test.1 : List I64 = StructAtIndex 0 Test.3;
|
||||
inc Test.1;
|
||||
dec Test.3;
|
||||
ret Test.1;
|
||||
|
@ -1,3 +1,3 @@
|
||||
procedure Test.0 ():
|
||||
let Test.2 : Builtin(Int(I64)) = 1337i64;
|
||||
let Test.2 : I64 = 1337i64;
|
||||
ret Test.2;
|
||||
|
@ -1,6 +1,6 @@
|
||||
procedure Test.0 ():
|
||||
let Test.2 : Builtin(Int(I64)) = 1337i64;
|
||||
let Test.3 : Builtin(Int(I64)) = 17i64;
|
||||
let Test.7 : Struct([Builtin(Int(I64)), Builtin(Int(I64))]) = Struct {Test.2, Test.3};
|
||||
let Test.6 : Builtin(Int(I64)) = StructAtIndex 0 Test.7;
|
||||
let Test.2 : I64 = 1337i64;
|
||||
let Test.3 : I64 = 17i64;
|
||||
let Test.7 : {I64, I64} = Struct {Test.2, Test.3};
|
||||
let Test.6 : I64 = StructAtIndex 0 Test.7;
|
||||
ret Test.6;
|
||||
|
@ -1,25 +1,25 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.10 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.10 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.10;
|
||||
|
||||
procedure Test.3 (Test.5):
|
||||
let Test.16 : Builtin(Bool) = 1i64;
|
||||
let Test.17 : Builtin(Bool) = GetTagId Test.5;
|
||||
let Test.18 : Builtin(Bool) = lowlevel Eq Test.16 Test.17;
|
||||
let Test.16 : Int1 = 1i64;
|
||||
let Test.17 : Int1 = GetTagId Test.5;
|
||||
let Test.18 : Int1 = lowlevel Eq Test.16 Test.17;
|
||||
if Test.18 then
|
||||
let Test.12 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.12 : I64 = 0i64;
|
||||
ret Test.12;
|
||||
else
|
||||
let Test.6 : Union(NullableUnwrapped { nullable_id: true, other_fields: [Builtin(Int(I64)), RecursivePointer] }) = UnionAtIndex (Id 0) (Index 1) Test.5;
|
||||
let Test.14 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.15 : Builtin(Int(I64)) = CallByName Test.3 Test.6;
|
||||
let Test.13 : Builtin(Int(I64)) = CallByName Num.22 Test.14 Test.15;
|
||||
let Test.6 : TODO = UnionAtIndex (Id 0) (Index 1) Test.5;
|
||||
let Test.14 : I64 = 1i64;
|
||||
let Test.15 : I64 = CallByName Test.3 Test.6;
|
||||
let Test.13 : I64 = CallByName Num.22 Test.14 Test.15;
|
||||
ret Test.13;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.2 : Union(NullableUnwrapped { nullable_id: true, other_fields: [Builtin(Int(I64)), RecursivePointer] }) = Nil ;
|
||||
let Test.8 : Builtin(Int(I64)) = CallByName Test.3 Test.2;
|
||||
let Test.9 : Builtin(Int(I64)) = CallByName Test.3 Test.2;
|
||||
let Test.2 : TODO = Nil ;
|
||||
let Test.8 : I64 = CallByName Test.3 Test.2;
|
||||
let Test.9 : I64 = CallByName Test.3 Test.2;
|
||||
dec Test.2;
|
||||
let Test.7 : Builtin(Int(I64)) = CallByName Num.22 Test.8 Test.9;
|
||||
let Test.7 : I64 = CallByName Num.22 Test.8 Test.9;
|
||||
ret Test.7;
|
||||
|
@ -1,9 +1,9 @@
|
||||
procedure List.5 (#Attr.2, #Attr.3):
|
||||
let Test.4 : Builtin(List(Builtin(Int(I64)))) = lowlevel ListAppend #Attr.2 #Attr.3;
|
||||
let Test.4 : List I64 = lowlevel ListAppend #Attr.2 #Attr.3;
|
||||
ret Test.4;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.2 : Builtin(List(Builtin(Int(I64)))) = Array [1i64];
|
||||
let Test.3 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.1 : Builtin(List(Builtin(Int(I64)))) = CallByName List.5 Test.2 Test.3;
|
||||
let Test.2 : List I64 = Array [1i64];
|
||||
let Test.3 : I64 = 2i64;
|
||||
let Test.1 : List I64 = CallByName List.5 Test.2 Test.3;
|
||||
ret Test.1;
|
||||
|
@ -1,13 +1,13 @@
|
||||
procedure List.5 (#Attr.2, #Attr.3):
|
||||
let Test.7 : Builtin(List(Builtin(Int(I64)))) = lowlevel ListAppend #Attr.2 #Attr.3;
|
||||
let Test.7 : List I64 = lowlevel ListAppend #Attr.2 #Attr.3;
|
||||
ret Test.7;
|
||||
|
||||
procedure Test.1 (Test.2):
|
||||
let Test.6 : Builtin(Int(I64)) = 42i64;
|
||||
let Test.5 : Builtin(List(Builtin(Int(I64)))) = CallByName List.5 Test.2 Test.6;
|
||||
let Test.6 : I64 = 42i64;
|
||||
let Test.5 : List I64 = CallByName List.5 Test.2 Test.6;
|
||||
ret Test.5;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.4 : Builtin(List(Builtin(Int(I64)))) = Array [1i64, 2i64];
|
||||
let Test.3 : Builtin(List(Builtin(Int(I64)))) = CallByName Test.1 Test.4;
|
||||
let Test.4 : List I64 = Array [1i64, 2i64];
|
||||
let Test.3 : List I64 = CallByName Test.1 Test.4;
|
||||
ret Test.3;
|
||||
|
@ -1,37 +1,37 @@
|
||||
procedure List.4 (#Attr.2, #Attr.3, #Attr.4):
|
||||
let Test.19 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
||||
let Test.17 : Builtin(Bool) = lowlevel NumLt #Attr.3 Test.19;
|
||||
let Test.19 : U64 = lowlevel ListLen #Attr.2;
|
||||
let Test.17 : Int1 = lowlevel NumLt #Attr.3 Test.19;
|
||||
if Test.17 then
|
||||
let Test.18 : Builtin(List(Builtin(Int(I64)))) = lowlevel ListSet #Attr.2 #Attr.3 #Attr.4;
|
||||
let Test.18 : List I64 = lowlevel ListSet #Attr.2 #Attr.3 #Attr.4;
|
||||
ret Test.18;
|
||||
else
|
||||
ret #Attr.2;
|
||||
|
||||
procedure List.7 (#Attr.2):
|
||||
let Test.9 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
||||
let Test.9 : U64 = lowlevel ListLen #Attr.2;
|
||||
ret Test.9;
|
||||
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.7 : Builtin(Int(U64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.7 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.7;
|
||||
|
||||
procedure Test.1 ():
|
||||
let Test.10 : Builtin(List(Builtin(Int(I64)))) = Array [1i64, 2i64, 3i64];
|
||||
let Test.10 : List I64 = Array [1i64, 2i64, 3i64];
|
||||
ret Test.10;
|
||||
|
||||
procedure Test.2 (Test.3):
|
||||
let Test.14 : Builtin(Int(U64)) = 0i64;
|
||||
let Test.15 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.13 : Builtin(List(Builtin(Int(I64)))) = CallByName List.4 Test.3 Test.14 Test.15;
|
||||
let Test.14 : U64 = 0i64;
|
||||
let Test.15 : I64 = 0i64;
|
||||
let Test.13 : List I64 = CallByName List.4 Test.3 Test.14 Test.15;
|
||||
ret Test.13;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.12 : Builtin(List(Builtin(Int(I64)))) = CallByName Test.1;
|
||||
let Test.11 : Builtin(List(Builtin(Int(I64)))) = CallByName Test.2 Test.12;
|
||||
let Test.5 : Builtin(Int(U64)) = CallByName List.7 Test.11;
|
||||
let Test.12 : List I64 = CallByName Test.1;
|
||||
let Test.11 : List I64 = CallByName Test.2 Test.12;
|
||||
let Test.5 : U64 = CallByName List.7 Test.11;
|
||||
dec Test.11;
|
||||
let Test.8 : Builtin(List(Builtin(Int(I64)))) = CallByName Test.1;
|
||||
let Test.6 : Builtin(Int(U64)) = CallByName List.7 Test.8;
|
||||
let Test.8 : List I64 = CallByName Test.1;
|
||||
let Test.6 : U64 = CallByName List.7 Test.8;
|
||||
dec Test.8;
|
||||
let Test.4 : Builtin(Int(U64)) = CallByName Num.22 Test.5 Test.6;
|
||||
let Test.4 : U64 = CallByName Num.22 Test.5 Test.6;
|
||||
ret Test.4;
|
||||
|
@ -1,23 +1,23 @@
|
||||
procedure List.3 (#Attr.2, #Attr.3):
|
||||
let Test.13 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
||||
let Test.10 : Builtin(Bool) = lowlevel NumLt #Attr.3 Test.13;
|
||||
let Test.13 : U64 = lowlevel ListLen #Attr.2;
|
||||
let Test.10 : Int1 = lowlevel NumLt #Attr.3 Test.13;
|
||||
if Test.10 then
|
||||
let Test.12 : Builtin(Int(I64)) = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
|
||||
let Test.11 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = Ok Test.12;
|
||||
let Test.12 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
|
||||
let Test.11 : [C {}, C I64] = Ok Test.12;
|
||||
ret Test.11;
|
||||
else
|
||||
let Test.9 : Struct([]) = Struct {};
|
||||
let Test.8 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = Err Test.9;
|
||||
let Test.9 : {} = Struct {};
|
||||
let Test.8 : [C {}, C I64] = Err Test.9;
|
||||
ret Test.8;
|
||||
|
||||
procedure Test.1 (Test.2):
|
||||
let Test.6 : Builtin(List(Builtin(Int(I64)))) = Array [1i64, 2i64, 3i64];
|
||||
let Test.7 : Builtin(Int(U64)) = 0i64;
|
||||
let Test.5 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = CallByName List.3 Test.6 Test.7;
|
||||
let Test.6 : List I64 = Array [1i64, 2i64, 3i64];
|
||||
let Test.7 : U64 = 0i64;
|
||||
let Test.5 : [C {}, C I64] = CallByName List.3 Test.6 Test.7;
|
||||
dec Test.6;
|
||||
ret Test.5;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.4 : Struct([]) = Struct {};
|
||||
let Test.3 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = CallByName Test.1 Test.4;
|
||||
let Test.4 : {} = Struct {};
|
||||
let Test.3 : [C {}, C I64] = CallByName Test.1 Test.4;
|
||||
ret Test.3;
|
||||
|
@ -1,21 +1,21 @@
|
||||
procedure List.7 (#Attr.2):
|
||||
let Test.10 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
||||
let Test.10 : U64 = lowlevel ListLen #Attr.2;
|
||||
ret Test.10;
|
||||
|
||||
procedure List.7 (#Attr.2):
|
||||
let Test.8 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
||||
let Test.8 : U64 = lowlevel ListLen #Attr.2;
|
||||
ret Test.8;
|
||||
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.6 : Builtin(Int(U64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.6 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.6;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.9 : Builtin(List(Builtin(Int(I64)))) = Array [1i64, 2i64, 3i64];
|
||||
let Test.4 : Builtin(Int(U64)) = CallByName List.7 Test.9;
|
||||
let Test.9 : List I64 = Array [1i64, 2i64, 3i64];
|
||||
let Test.4 : U64 = CallByName List.7 Test.9;
|
||||
dec Test.9;
|
||||
let Test.7 : Builtin(List(Builtin(Float(F64)))) = Array [1f64];
|
||||
let Test.5 : Builtin(Int(U64)) = CallByName List.7 Test.7;
|
||||
let Test.7 : List Float64 = Array [1f64];
|
||||
let Test.5 : U64 = CallByName List.7 Test.7;
|
||||
dec Test.7;
|
||||
let Test.3 : Builtin(Int(U64)) = CallByName Num.22 Test.4 Test.5;
|
||||
let Test.3 : U64 = CallByName Num.22 Test.4 Test.5;
|
||||
ret Test.3;
|
||||
|
@ -1,19 +1,19 @@
|
||||
procedure List.4 (#Attr.2, #Attr.3, #Attr.4):
|
||||
let Test.11 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
||||
let Test.9 : Builtin(Bool) = lowlevel NumLt #Attr.3 Test.11;
|
||||
let Test.11 : U64 = lowlevel ListLen #Attr.2;
|
||||
let Test.9 : Int1 = lowlevel NumLt #Attr.3 Test.11;
|
||||
if Test.9 then
|
||||
let Test.10 : Builtin(List(Builtin(Int(I64)))) = lowlevel ListSet #Attr.2 #Attr.3 #Attr.4;
|
||||
let Test.10 : List I64 = lowlevel ListSet #Attr.2 #Attr.3 #Attr.4;
|
||||
ret Test.10;
|
||||
else
|
||||
ret #Attr.2;
|
||||
|
||||
procedure Test.2 (Test.3):
|
||||
let Test.6 : Builtin(Int(U64)) = 0i64;
|
||||
let Test.7 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.5 : Builtin(List(Builtin(Int(I64)))) = CallByName List.4 Test.3 Test.6 Test.7;
|
||||
let Test.6 : U64 = 0i64;
|
||||
let Test.7 : I64 = 0i64;
|
||||
let Test.5 : List I64 = CallByName List.4 Test.3 Test.6 Test.7;
|
||||
ret Test.5;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.1 : Builtin(List(Builtin(Int(I64)))) = Array [1i64, 2i64, 3i64];
|
||||
let Test.4 : Builtin(List(Builtin(Int(I64)))) = CallByName Test.2 Test.1;
|
||||
let Test.1 : List I64 = Array [1i64, 2i64, 3i64];
|
||||
let Test.4 : List I64 = CallByName Test.2 Test.1;
|
||||
ret Test.4;
|
||||
|
@ -1,9 +1,9 @@
|
||||
procedure Test.1 (Test.2):
|
||||
inc Test.2;
|
||||
let Test.6 : Struct([Builtin(List(Builtin(Int(I64)))), Builtin(List(Builtin(Int(I64))))]) = Struct {Test.2, Test.2};
|
||||
let Test.6 : {List I64, List I64} = Struct {Test.2, Test.2};
|
||||
ret Test.6;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.5 : Builtin(List(Builtin(Int(I64)))) = Array [1i64, 2i64, 3i64];
|
||||
let Test.4 : Struct([Builtin(List(Builtin(Int(I64)))), Builtin(List(Builtin(Int(I64))))]) = CallByName Test.1 Test.5;
|
||||
let Test.5 : List I64 = Array [1i64, 2i64, 3i64];
|
||||
let Test.4 : {List I64, List I64} = CallByName Test.1 Test.5;
|
||||
ret Test.4;
|
||||
|
@ -1,20 +1,20 @@
|
||||
procedure Test.2 (Test.4):
|
||||
let Test.11 : Builtin(Int(U8)) = 0i64;
|
||||
let Test.12 : Builtin(Int(U8)) = GetTagId Test.4;
|
||||
let Test.13 : Builtin(Bool) = lowlevel Eq Test.11 Test.12;
|
||||
let Test.11 : U8 = 0i64;
|
||||
let Test.12 : U8 = GetTagId Test.4;
|
||||
let Test.13 : Int1 = lowlevel Eq Test.11 Test.12;
|
||||
if Test.13 then
|
||||
let Test.5 : Builtin(Str) = UnionAtIndex (Id 0) (Index 0) Test.4;
|
||||
let Test.5 : Str = UnionAtIndex (Id 0) (Index 0) Test.4;
|
||||
inc Test.5;
|
||||
dec Test.4;
|
||||
ret Test.5;
|
||||
else
|
||||
let Test.6 : Builtin(Str) = UnionAtIndex (Id 1) (Index 0) Test.4;
|
||||
let Test.6 : Str = UnionAtIndex (Id 1) (Index 0) Test.4;
|
||||
inc Test.6;
|
||||
dec Test.4;
|
||||
ret Test.6;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.14 : Builtin(Str) = "A";
|
||||
let Test.8 : Union(NonRecursive([[Builtin(Str)], [Builtin(Str)]])) = A Test.14;
|
||||
let Test.7 : Builtin(Str) = CallByName Test.2 Test.8;
|
||||
let Test.14 : Str = "A";
|
||||
let Test.8 : [C Str, C Str] = A Test.14;
|
||||
let Test.7 : Str = CallByName Test.2 Test.8;
|
||||
ret Test.7;
|
||||
|
@ -1,9 +1,9 @@
|
||||
procedure Test.2 (Test.3, Test.4):
|
||||
let Test.8 : Builtin(Int(U64)) = 18i64;
|
||||
let Test.8 : U64 = 18i64;
|
||||
ret Test.8;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.6 : Builtin(Float(F32)) = 100f64;
|
||||
let Test.7 : Builtin(Float(F64)) = 100f64;
|
||||
let Test.5 : Builtin(Int(U64)) = CallByName Test.2 Test.6 Test.7;
|
||||
let Test.6 : Float32 = 100f64;
|
||||
let Test.7 : Float64 = 100f64;
|
||||
let Test.5 : U64 = CallByName Test.2 Test.6 Test.7;
|
||||
ret Test.5;
|
||||
|
@ -1,9 +1,9 @@
|
||||
procedure Test.2 (Test.3, Test.4):
|
||||
let Test.8 : Builtin(Int(U64)) = 18i64;
|
||||
let Test.8 : U64 = 18i64;
|
||||
ret Test.8;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.6 : Builtin(Int(U8)) = 100i64;
|
||||
let Test.7 : Builtin(Int(U32)) = 100i64;
|
||||
let Test.5 : Builtin(Int(U64)) = CallByName Test.2 Test.6 Test.7;
|
||||
let Test.6 : U8 = 100i64;
|
||||
let Test.7 : U32 = 100i64;
|
||||
let Test.5 : U64 = CallByName Test.2 Test.6 Test.7;
|
||||
ret Test.5;
|
||||
|
@ -1,23 +1,23 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.12 : Builtin(Int(U64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.12 : U64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.12;
|
||||
|
||||
procedure Test.4 (Test.7, Test.8):
|
||||
let Test.17 : Builtin(Int(U64)) = 1i64;
|
||||
let Test.17 : U64 = 1i64;
|
||||
ret Test.17;
|
||||
|
||||
procedure Test.4 (Test.7, Test.8):
|
||||
let Test.18 : Builtin(Int(U64)) = 1i64;
|
||||
let Test.18 : U64 = 1i64;
|
||||
ret Test.18;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.4 : LambdaSet(LambdaSet { set: [( Test.4, [])], representation: Struct([]) }) = Struct {};
|
||||
let Test.4 : LambdaSet(LambdaSet { set: [( Test.4, [])], representation: Struct([]) }) = Struct {};
|
||||
let Test.15 : Builtin(Int(U8)) = 100i64;
|
||||
let Test.16 : Builtin(Int(U32)) = 100i64;
|
||||
let Test.10 : Builtin(Int(U64)) = CallByName Test.4 Test.15 Test.16;
|
||||
let Test.13 : Builtin(Int(U32)) = 100i64;
|
||||
let Test.14 : Builtin(Int(U8)) = 100i64;
|
||||
let Test.11 : Builtin(Int(U64)) = CallByName Test.4 Test.13 Test.14;
|
||||
let Test.9 : Builtin(Int(U64)) = CallByName Num.22 Test.10 Test.11;
|
||||
let Test.4 : {} = Struct {};
|
||||
let Test.4 : {} = Struct {};
|
||||
let Test.15 : U8 = 100i64;
|
||||
let Test.16 : U32 = 100i64;
|
||||
let Test.10 : U64 = CallByName Test.4 Test.15 Test.16;
|
||||
let Test.13 : U32 = 100i64;
|
||||
let Test.14 : U8 = 100i64;
|
||||
let Test.11 : U64 = CallByName Test.4 Test.13 Test.14;
|
||||
let Test.9 : U64 = CallByName Num.22 Test.10 Test.11;
|
||||
ret Test.9;
|
||||
|
@ -1,11 +1,11 @@
|
||||
procedure Test.2 (Test.3, Test.4):
|
||||
let Test.8 : Builtin(Int(U64)) = 18i64;
|
||||
let Test.8 : U64 = 18i64;
|
||||
ret Test.8;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.6 : Builtin(List(Builtin(Int(U8)))) = Array [1i64, 2i64, 3i64];
|
||||
let Test.7 : Builtin(List(Builtin(Int(U16)))) = Array [1i64, 2i64, 3i64];
|
||||
let Test.5 : Builtin(Int(U64)) = CallByName Test.2 Test.6 Test.7;
|
||||
let Test.6 : List U8 = Array [1i64, 2i64, 3i64];
|
||||
let Test.7 : List U16 = Array [1i64, 2i64, 3i64];
|
||||
let Test.5 : U64 = CallByName Test.2 Test.6 Test.7;
|
||||
dec Test.7;
|
||||
dec Test.6;
|
||||
ret Test.5;
|
||||
|
@ -1,9 +1,9 @@
|
||||
procedure Test.2 (Test.4, Test.5):
|
||||
let Test.9 : Builtin(Int(U8)) = 18i64;
|
||||
let Test.9 : U8 = 18i64;
|
||||
ret Test.9;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.7 : Builtin(Bool) = false;
|
||||
let Test.8 : Builtin(Int(U8)) = 0u8;
|
||||
let Test.6 : Builtin(Int(U8)) = CallByName Test.2 Test.7 Test.8;
|
||||
let Test.7 : Int1 = false;
|
||||
let Test.8 : U8 = 0u8;
|
||||
let Test.6 : U8 = CallByName Test.2 Test.7 Test.8;
|
||||
ret Test.6;
|
||||
|
@ -1,10 +1,10 @@
|
||||
procedure Test.4 (Test.8):
|
||||
let Test.11 : Builtin(Int(U64)) = 1i64;
|
||||
let Test.11 : U64 = 1i64;
|
||||
ret Test.11;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.13 : Builtin(Bool) = false;
|
||||
let Test.12 : Builtin(Bool) = false;
|
||||
let Test.10 : Struct([Builtin(Bool), Builtin(Bool)]) = Struct {Test.12, Test.13};
|
||||
let Test.9 : Builtin(Int(U64)) = CallByName Test.4 Test.10;
|
||||
let Test.13 : Int1 = false;
|
||||
let Test.12 : Int1 = false;
|
||||
let Test.10 : {Int1, Int1} = Struct {Test.12, Test.13};
|
||||
let Test.9 : U64 = CallByName Test.4 Test.10;
|
||||
ret Test.9;
|
||||
|
@ -1,16 +1,16 @@
|
||||
procedure Test.1 (Test.5):
|
||||
let Test.2 : Builtin(Int(I64)) = 42i64;
|
||||
let Test.3 : LambdaSet(LambdaSet { set: [( Test.3, [Builtin(Int(I64))])], representation: Struct([Builtin(Int(I64))]) }) = Struct {Test.2};
|
||||
let Test.2 : I64 = 42i64;
|
||||
let Test.3 : {I64} = Struct {Test.2};
|
||||
ret Test.3;
|
||||
|
||||
procedure Test.3 (Test.10, #Attr.12):
|
||||
let Test.2 : Builtin(Int(I64)) = StructAtIndex 0 #Attr.12;
|
||||
let Test.2 : Builtin(Int(I64)) = 42i64;
|
||||
let Test.2 : I64 = StructAtIndex 0 #Attr.12;
|
||||
let Test.2 : I64 = 42i64;
|
||||
ret Test.2;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.7 : Struct([]) = Struct {};
|
||||
let Test.9 : Struct([]) = Struct {};
|
||||
let Test.8 : LambdaSet(LambdaSet { set: [( Test.3, [Builtin(Int(I64))])], representation: Struct([Builtin(Int(I64))]) }) = CallByName Test.1 Test.9;
|
||||
let Test.6 : Builtin(Int(I64)) = CallByName Test.3 Test.7 Test.8;
|
||||
let Test.7 : {} = Struct {};
|
||||
let Test.9 : {} = Struct {};
|
||||
let Test.8 : {I64} = CallByName Test.1 Test.9;
|
||||
let Test.6 : I64 = CallByName Test.3 Test.7 Test.8;
|
||||
ret Test.6;
|
||||
|
@ -1,28 +1,28 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.8 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.8 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.8;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.20 : Builtin(Int(I64)) = 41i64;
|
||||
let Test.19 : Union(NonRecursive([[Builtin(Int(I64))], []])) = Just Test.20;
|
||||
let Test.2 : Union(NonRecursive([[Union(NonRecursive([[Builtin(Int(I64))], []]))], []])) = Just Test.19;
|
||||
let Test.20 : I64 = 41i64;
|
||||
let Test.19 : [C I64, C ] = Just Test.20;
|
||||
let Test.2 : [C [C I64, C ], C ] = Just Test.19;
|
||||
joinpoint Test.16:
|
||||
let Test.9 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.9 : I64 = 1i64;
|
||||
ret Test.9;
|
||||
in
|
||||
let Test.14 : Builtin(Int(U8)) = 0i64;
|
||||
let Test.15 : Builtin(Int(U8)) = GetTagId Test.2;
|
||||
let Test.18 : Builtin(Bool) = lowlevel Eq Test.14 Test.15;
|
||||
let Test.14 : U8 = 0i64;
|
||||
let Test.15 : U8 = GetTagId Test.2;
|
||||
let Test.18 : Int1 = lowlevel Eq Test.14 Test.15;
|
||||
if Test.18 then
|
||||
let Test.11 : Union(NonRecursive([[Builtin(Int(I64))], []])) = UnionAtIndex (Id 0) (Index 0) Test.2;
|
||||
let Test.12 : Builtin(Int(U8)) = 0i64;
|
||||
let Test.13 : Builtin(Int(U8)) = GetTagId Test.11;
|
||||
let Test.17 : Builtin(Bool) = lowlevel Eq Test.12 Test.13;
|
||||
let Test.11 : [C I64, C ] = UnionAtIndex (Id 0) (Index 0) Test.2;
|
||||
let Test.12 : U8 = 0i64;
|
||||
let Test.13 : U8 = GetTagId Test.11;
|
||||
let Test.17 : Int1 = lowlevel Eq Test.12 Test.13;
|
||||
if Test.17 then
|
||||
let Test.10 : Union(NonRecursive([[Builtin(Int(I64))], []])) = UnionAtIndex (Id 0) (Index 0) Test.2;
|
||||
let Test.5 : Builtin(Int(I64)) = UnionAtIndex (Id 0) (Index 0) Test.10;
|
||||
let Test.7 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.6 : Builtin(Int(I64)) = CallByName Num.22 Test.5 Test.7;
|
||||
let Test.10 : [C I64, C ] = UnionAtIndex (Id 0) (Index 0) Test.2;
|
||||
let Test.5 : I64 = UnionAtIndex (Id 0) (Index 0) Test.10;
|
||||
let Test.7 : I64 = 1i64;
|
||||
let Test.6 : I64 = CallByName Num.22 Test.5 Test.7;
|
||||
ret Test.6;
|
||||
else
|
||||
jump Test.16;
|
||||
|
@ -1,3 +1,3 @@
|
||||
procedure Test.0 ():
|
||||
let Test.4 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.4 : I64 = 2i64;
|
||||
ret Test.4;
|
||||
|
@ -1,42 +1,42 @@
|
||||
procedure Num.24 (#Attr.2, #Attr.3):
|
||||
let Test.18 : Builtin(Int(I64)) = lowlevel NumMul #Attr.2 #Attr.3;
|
||||
let Test.18 : I64 = lowlevel NumMul #Attr.2 #Attr.3;
|
||||
ret Test.18;
|
||||
|
||||
procedure Test.1 (Test.6):
|
||||
let Test.22 : Builtin(Bool) = false;
|
||||
let Test.23 : Builtin(Bool) = lowlevel Eq Test.22 Test.6;
|
||||
let Test.22 : Int1 = false;
|
||||
let Test.23 : Int1 = lowlevel Eq Test.22 Test.6;
|
||||
if Test.23 then
|
||||
let Test.8 : Builtin(Int(I64)) = 3i64;
|
||||
let Test.8 : I64 = 3i64;
|
||||
ret Test.8;
|
||||
else
|
||||
let Test.10 : Builtin(Int(I64)) = 5i64;
|
||||
let Test.10 : I64 = 5i64;
|
||||
ret Test.10;
|
||||
|
||||
procedure Test.1 (Test.6):
|
||||
let Test.30 : Builtin(Bool) = StructAtIndex 1 Test.6;
|
||||
let Test.31 : Builtin(Bool) = false;
|
||||
let Test.32 : Builtin(Bool) = lowlevel Eq Test.31 Test.30;
|
||||
let Test.30 : Int1 = StructAtIndex 1 Test.6;
|
||||
let Test.31 : Int1 = false;
|
||||
let Test.32 : Int1 = lowlevel Eq Test.31 Test.30;
|
||||
if Test.32 then
|
||||
let Test.8 : Builtin(Int(I64)) = StructAtIndex 0 Test.6;
|
||||
let Test.8 : I64 = StructAtIndex 0 Test.6;
|
||||
ret Test.8;
|
||||
else
|
||||
let Test.10 : Builtin(Int(I64)) = StructAtIndex 0 Test.6;
|
||||
let Test.10 : I64 = StructAtIndex 0 Test.6;
|
||||
ret Test.10;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.40 : Builtin(Int(I64)) = 7i64;
|
||||
let Test.41 : Builtin(Bool) = false;
|
||||
let Test.39 : Struct([Builtin(Int(I64)), Builtin(Bool)]) = Struct {Test.40, Test.41};
|
||||
let Test.35 : Builtin(Int(I64)) = CallByName Test.1 Test.39;
|
||||
let Test.38 : Builtin(Bool) = false;
|
||||
let Test.36 : Builtin(Int(I64)) = CallByName Test.1 Test.38;
|
||||
let Test.25 : Builtin(Int(I64)) = CallByName Num.24 Test.35 Test.36;
|
||||
let Test.33 : Builtin(Int(I64)) = 11i64;
|
||||
let Test.34 : Builtin(Bool) = true;
|
||||
let Test.27 : Struct([Builtin(Int(I64)), Builtin(Bool)]) = Struct {Test.33, Test.34};
|
||||
let Test.26 : Builtin(Int(I64)) = CallByName Test.1 Test.27;
|
||||
let Test.16 : Builtin(Int(I64)) = CallByName Num.24 Test.25 Test.26;
|
||||
let Test.24 : Builtin(Bool) = true;
|
||||
let Test.17 : Builtin(Int(I64)) = CallByName Test.1 Test.24;
|
||||
let Test.15 : Builtin(Int(I64)) = CallByName Num.24 Test.16 Test.17;
|
||||
let Test.40 : I64 = 7i64;
|
||||
let Test.41 : Int1 = false;
|
||||
let Test.39 : {I64, Int1} = Struct {Test.40, Test.41};
|
||||
let Test.35 : I64 = CallByName Test.1 Test.39;
|
||||
let Test.38 : Int1 = false;
|
||||
let Test.36 : I64 = CallByName Test.1 Test.38;
|
||||
let Test.25 : I64 = CallByName Num.24 Test.35 Test.36;
|
||||
let Test.33 : I64 = 11i64;
|
||||
let Test.34 : Int1 = true;
|
||||
let Test.27 : {I64, Int1} = Struct {Test.33, Test.34};
|
||||
let Test.26 : I64 = CallByName Test.1 Test.27;
|
||||
let Test.16 : I64 = CallByName Num.24 Test.25 Test.26;
|
||||
let Test.24 : Int1 = true;
|
||||
let Test.17 : I64 = CallByName Test.1 Test.24;
|
||||
let Test.15 : I64 = CallByName Num.24 Test.16 Test.17;
|
||||
ret Test.15;
|
||||
|
@ -1,6 +1,6 @@
|
||||
procedure Test.0 ():
|
||||
let Test.10 : Union(NullableUnwrapped { nullable_id: true, other_fields: [RecursivePointer] }) = Z ;
|
||||
let Test.9 : Union(NullableUnwrapped { nullable_id: true, other_fields: [RecursivePointer] }) = S Test.10;
|
||||
let Test.8 : Union(NullableUnwrapped { nullable_id: true, other_fields: [RecursivePointer] }) = S Test.9;
|
||||
let Test.2 : Union(NullableUnwrapped { nullable_id: true, other_fields: [RecursivePointer] }) = S Test.8;
|
||||
let Test.10 : TODO = Z ;
|
||||
let Test.9 : TODO = S Test.10;
|
||||
let Test.8 : TODO = S Test.9;
|
||||
let Test.2 : TODO = S Test.8;
|
||||
ret Test.2;
|
||||
|
@ -1,15 +1,15 @@
|
||||
procedure Test.0 ():
|
||||
let Test.14 : Union(NullableUnwrapped { nullable_id: true, other_fields: [RecursivePointer] }) = Z ;
|
||||
let Test.13 : Union(NullableUnwrapped { nullable_id: true, other_fields: [RecursivePointer] }) = S Test.14;
|
||||
let Test.12 : Union(NullableUnwrapped { nullable_id: true, other_fields: [RecursivePointer] }) = S Test.13;
|
||||
let Test.2 : Union(NullableUnwrapped { nullable_id: true, other_fields: [RecursivePointer] }) = S Test.12;
|
||||
let Test.9 : Builtin(Bool) = 1i64;
|
||||
let Test.10 : Builtin(Bool) = GetTagId Test.2;
|
||||
let Test.14 : TODO = Z ;
|
||||
let Test.13 : TODO = S Test.14;
|
||||
let Test.12 : TODO = S Test.13;
|
||||
let Test.2 : TODO = S Test.12;
|
||||
let Test.9 : Int1 = 1i64;
|
||||
let Test.10 : Int1 = GetTagId Test.2;
|
||||
dec Test.2;
|
||||
let Test.11 : Builtin(Bool) = lowlevel Eq Test.9 Test.10;
|
||||
let Test.11 : Int1 = lowlevel Eq Test.9 Test.10;
|
||||
if Test.11 then
|
||||
let Test.7 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.7 : I64 = 0i64;
|
||||
ret Test.7;
|
||||
else
|
||||
let Test.8 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.8 : I64 = 1i64;
|
||||
ret Test.8;
|
||||
|
@ -1,26 +1,26 @@
|
||||
procedure Test.0 ():
|
||||
let Test.20 : Union(NullableUnwrapped { nullable_id: true, other_fields: [RecursivePointer] }) = Z ;
|
||||
let Test.19 : Union(NullableUnwrapped { nullable_id: true, other_fields: [RecursivePointer] }) = S Test.20;
|
||||
let Test.18 : Union(NullableUnwrapped { nullable_id: true, other_fields: [RecursivePointer] }) = S Test.19;
|
||||
let Test.2 : Union(NullableUnwrapped { nullable_id: true, other_fields: [RecursivePointer] }) = S Test.18;
|
||||
let Test.15 : Builtin(Bool) = 0i64;
|
||||
let Test.16 : Builtin(Bool) = GetTagId Test.2;
|
||||
let Test.17 : Builtin(Bool) = lowlevel Eq Test.15 Test.16;
|
||||
let Test.20 : TODO = Z ;
|
||||
let Test.19 : TODO = S Test.20;
|
||||
let Test.18 : TODO = S Test.19;
|
||||
let Test.2 : TODO = S Test.18;
|
||||
let Test.15 : Int1 = 0i64;
|
||||
let Test.16 : Int1 = GetTagId Test.2;
|
||||
let Test.17 : Int1 = lowlevel Eq Test.15 Test.16;
|
||||
if Test.17 then
|
||||
let Test.11 : Union(NullableUnwrapped { nullable_id: true, other_fields: [RecursivePointer] }) = UnionAtIndex (Id 0) (Index 0) Test.2;
|
||||
let Test.11 : TODO = UnionAtIndex (Id 0) (Index 0) Test.2;
|
||||
inc Test.11;
|
||||
dec Test.2;
|
||||
let Test.12 : Builtin(Bool) = 0i64;
|
||||
let Test.13 : Builtin(Bool) = GetTagId Test.11;
|
||||
let Test.12 : Int1 = 0i64;
|
||||
let Test.13 : Int1 = GetTagId Test.11;
|
||||
dec Test.11;
|
||||
let Test.14 : Builtin(Bool) = lowlevel Eq Test.12 Test.13;
|
||||
let Test.14 : Int1 = lowlevel Eq Test.12 Test.13;
|
||||
if Test.14 then
|
||||
let Test.7 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.7 : I64 = 1i64;
|
||||
ret Test.7;
|
||||
else
|
||||
let Test.8 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.8 : I64 = 0i64;
|
||||
ret Test.8;
|
||||
else
|
||||
dec Test.2;
|
||||
let Test.9 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.9 : I64 = 0i64;
|
||||
ret Test.9;
|
||||
|
@ -1,32 +1,32 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.19 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.19 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.19;
|
||||
|
||||
procedure Num.23 (#Attr.2, #Attr.3):
|
||||
let Test.22 : Builtin(Int(I64)) = lowlevel NumSub #Attr.2 #Attr.3;
|
||||
let Test.22 : I64 = lowlevel NumSub #Attr.2 #Attr.3;
|
||||
ret Test.22;
|
||||
|
||||
procedure Num.25 (#Attr.2, #Attr.3):
|
||||
let Test.26 : Builtin(Bool) = lowlevel NumLt #Attr.2 #Attr.3;
|
||||
let Test.26 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
|
||||
ret Test.26;
|
||||
|
||||
procedure Test.1 (Test.27, Test.28, Test.29):
|
||||
joinpoint Test.12 Test.2 Test.3 Test.4:
|
||||
let Test.14 : Builtin(Bool) = CallByName Num.25 Test.3 Test.4;
|
||||
let Test.14 : Int1 = CallByName Num.25 Test.3 Test.4;
|
||||
if Test.14 then
|
||||
dec Test.2;
|
||||
let Test.25 : Builtin(List(Union(NonRecursive([])))) = Array [];
|
||||
let Test.24 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.23 : Struct([Builtin(Int(I64)), Builtin(List(Union(NonRecursive([]))))]) = Struct {Test.24, Test.25};
|
||||
let Test.5 : Builtin(Int(I64)) = StructAtIndex 0 Test.23;
|
||||
let Test.6 : Builtin(List(Union(NonRecursive([])))) = StructAtIndex 1 Test.23;
|
||||
let Test.25 : List [] = Array [];
|
||||
let Test.24 : I64 = 0i64;
|
||||
let Test.23 : {I64, List []} = Struct {Test.24, Test.25};
|
||||
let Test.5 : I64 = StructAtIndex 0 Test.23;
|
||||
let Test.6 : List [] = StructAtIndex 1 Test.23;
|
||||
inc Test.6;
|
||||
dec Test.23;
|
||||
let Test.21 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.20 : Builtin(Int(I64)) = CallByName Num.23 Test.5 Test.21;
|
||||
let Test.16 : Builtin(List(Builtin(Int(I64)))) = CallByName Test.1 Test.6 Test.3 Test.20;
|
||||
let Test.18 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.17 : Builtin(Int(I64)) = CallByName Num.22 Test.5 Test.18;
|
||||
let Test.21 : I64 = 1i64;
|
||||
let Test.20 : I64 = CallByName Num.23 Test.5 Test.21;
|
||||
let Test.16 : List I64 = CallByName Test.1 Test.6 Test.3 Test.20;
|
||||
let Test.18 : I64 = 1i64;
|
||||
let Test.17 : I64 = CallByName Num.22 Test.5 Test.18;
|
||||
jump Test.12 Test.16 Test.17 Test.4;
|
||||
else
|
||||
ret Test.2;
|
||||
@ -34,8 +34,8 @@ procedure Test.1 (Test.27, Test.28, Test.29):
|
||||
jump Test.12 Test.27 Test.28 Test.29;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.9 : Builtin(List(Builtin(Int(I64)))) = Array [];
|
||||
let Test.10 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.11 : Builtin(Int(I64)) = 0i64;
|
||||
let Test.8 : Builtin(List(Builtin(Int(I64)))) = CallByName Test.1 Test.9 Test.10 Test.11;
|
||||
let Test.9 : List I64 = Array [];
|
||||
let Test.10 : I64 = 0i64;
|
||||
let Test.11 : I64 = 0i64;
|
||||
let Test.8 : List I64 = CallByName Test.1 Test.9 Test.10 Test.11;
|
||||
ret Test.8;
|
||||
|
@ -1,52 +1,52 @@
|
||||
procedure List.3 (#Attr.2, #Attr.3):
|
||||
let Test.37 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
||||
let Test.34 : Builtin(Bool) = lowlevel NumLt #Attr.3 Test.37;
|
||||
let Test.37 : U64 = lowlevel ListLen #Attr.2;
|
||||
let Test.34 : Int1 = lowlevel NumLt #Attr.3 Test.37;
|
||||
if Test.34 then
|
||||
let Test.36 : Builtin(Int(I64)) = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
|
||||
let Test.35 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = Ok Test.36;
|
||||
let Test.36 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
|
||||
let Test.35 : [C {}, C I64] = Ok Test.36;
|
||||
ret Test.35;
|
||||
else
|
||||
let Test.33 : Struct([]) = Struct {};
|
||||
let Test.32 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = Err Test.33;
|
||||
let Test.33 : {} = Struct {};
|
||||
let Test.32 : [C {}, C I64] = Err Test.33;
|
||||
ret Test.32;
|
||||
|
||||
procedure List.4 (#Attr.2, #Attr.3, #Attr.4):
|
||||
let Test.15 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
||||
let Test.13 : Builtin(Bool) = lowlevel NumLt #Attr.3 Test.15;
|
||||
let Test.15 : U64 = lowlevel ListLen #Attr.2;
|
||||
let Test.13 : Int1 = lowlevel NumLt #Attr.3 Test.15;
|
||||
if Test.13 then
|
||||
let Test.14 : Builtin(List(Builtin(Int(I64)))) = lowlevel ListSet #Attr.2 #Attr.3 #Attr.4;
|
||||
let Test.14 : List I64 = lowlevel ListSet #Attr.2 #Attr.3 #Attr.4;
|
||||
ret Test.14;
|
||||
else
|
||||
ret #Attr.2;
|
||||
|
||||
procedure Test.1 (Test.2):
|
||||
let Test.38 : Builtin(Int(U64)) = 0i64;
|
||||
let Test.30 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = CallByName List.3 Test.2 Test.38;
|
||||
let Test.31 : Builtin(Int(U64)) = 0i64;
|
||||
let Test.29 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = CallByName List.3 Test.2 Test.31;
|
||||
let Test.8 : Struct([Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])), Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]]))]) = Struct {Test.29, Test.30};
|
||||
let Test.38 : U64 = 0i64;
|
||||
let Test.30 : [C {}, C I64] = CallByName List.3 Test.2 Test.38;
|
||||
let Test.31 : U64 = 0i64;
|
||||
let Test.29 : [C {}, C I64] = CallByName List.3 Test.2 Test.31;
|
||||
let Test.8 : {[C {}, C I64], [C {}, C I64]} = Struct {Test.29, Test.30};
|
||||
joinpoint Test.26:
|
||||
let Test.17 : Builtin(List(Builtin(Int(I64)))) = Array [];
|
||||
let Test.17 : List I64 = Array [];
|
||||
ret Test.17;
|
||||
in
|
||||
let Test.23 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = StructAtIndex 1 Test.8;
|
||||
let Test.24 : Builtin(Int(U8)) = 1i64;
|
||||
let Test.25 : Builtin(Int(U8)) = GetTagId Test.23;
|
||||
let Test.28 : Builtin(Bool) = lowlevel Eq Test.24 Test.25;
|
||||
let Test.23 : [C {}, C I64] = StructAtIndex 1 Test.8;
|
||||
let Test.24 : U8 = 1i64;
|
||||
let Test.25 : U8 = GetTagId Test.23;
|
||||
let Test.28 : Int1 = lowlevel Eq Test.24 Test.25;
|
||||
if Test.28 then
|
||||
let Test.20 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = StructAtIndex 0 Test.8;
|
||||
let Test.21 : Builtin(Int(U8)) = 1i64;
|
||||
let Test.22 : Builtin(Int(U8)) = GetTagId Test.20;
|
||||
let Test.27 : Builtin(Bool) = lowlevel Eq Test.21 Test.22;
|
||||
let Test.20 : [C {}, C I64] = StructAtIndex 0 Test.8;
|
||||
let Test.21 : U8 = 1i64;
|
||||
let Test.22 : U8 = GetTagId Test.20;
|
||||
let Test.27 : Int1 = lowlevel Eq Test.21 Test.22;
|
||||
if Test.27 then
|
||||
let Test.19 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = StructAtIndex 0 Test.8;
|
||||
let Test.4 : Builtin(Int(I64)) = UnionAtIndex (Id 1) (Index 0) Test.19;
|
||||
let Test.18 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = StructAtIndex 1 Test.8;
|
||||
let Test.5 : Builtin(Int(I64)) = UnionAtIndex (Id 1) (Index 0) Test.18;
|
||||
let Test.16 : Builtin(Int(U64)) = 0i64;
|
||||
let Test.10 : Builtin(List(Builtin(Int(I64)))) = CallByName List.4 Test.2 Test.16 Test.5;
|
||||
let Test.11 : Builtin(Int(U64)) = 0i64;
|
||||
let Test.9 : Builtin(List(Builtin(Int(I64)))) = CallByName List.4 Test.10 Test.11 Test.4;
|
||||
let Test.19 : [C {}, C I64] = StructAtIndex 0 Test.8;
|
||||
let Test.4 : I64 = UnionAtIndex (Id 1) (Index 0) Test.19;
|
||||
let Test.18 : [C {}, C I64] = StructAtIndex 1 Test.8;
|
||||
let Test.5 : I64 = UnionAtIndex (Id 1) (Index 0) Test.18;
|
||||
let Test.16 : U64 = 0i64;
|
||||
let Test.10 : List I64 = CallByName List.4 Test.2 Test.16 Test.5;
|
||||
let Test.11 : U64 = 0i64;
|
||||
let Test.9 : List I64 = CallByName List.4 Test.10 Test.11 Test.4;
|
||||
ret Test.9;
|
||||
else
|
||||
dec Test.2;
|
||||
@ -56,6 +56,6 @@ procedure Test.1 (Test.2):
|
||||
jump Test.26;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.7 : Builtin(List(Builtin(Int(I64)))) = Array [1i64, 2i64];
|
||||
let Test.6 : Builtin(List(Builtin(Int(I64)))) = CallByName Test.1 Test.7;
|
||||
let Test.7 : List I64 = Array [1i64, 2i64];
|
||||
let Test.6 : List I64 = CallByName Test.1 Test.7;
|
||||
ret Test.6;
|
||||
|
@ -1,16 +1,16 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.8 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.8 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.8;
|
||||
|
||||
procedure Test.1 (Test.4):
|
||||
let Test.2 : Builtin(Int(I64)) = StructAtIndex 0 Test.4;
|
||||
let Test.3 : Builtin(Int(I64)) = StructAtIndex 1 Test.4;
|
||||
let Test.7 : Builtin(Int(I64)) = CallByName Num.22 Test.2 Test.3;
|
||||
let Test.2 : I64 = StructAtIndex 0 Test.4;
|
||||
let Test.3 : I64 = StructAtIndex 1 Test.4;
|
||||
let Test.7 : I64 = CallByName Num.22 Test.2 Test.3;
|
||||
ret Test.7;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.9 : Builtin(Int(I64)) = 4i64;
|
||||
let Test.10 : Builtin(Int(I64)) = 9i64;
|
||||
let Test.6 : Struct([Builtin(Int(I64)), Builtin(Int(I64))]) = Struct {Test.9, Test.10};
|
||||
let Test.5 : Builtin(Int(I64)) = CallByName Test.1 Test.6;
|
||||
let Test.9 : I64 = 4i64;
|
||||
let Test.10 : I64 = 9i64;
|
||||
let Test.6 : {I64, I64} = Struct {Test.9, Test.10};
|
||||
let Test.5 : I64 = CallByName Test.1 Test.6;
|
||||
ret Test.5;
|
||||
|
@ -1,13 +1,13 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.9 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.9 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.9;
|
||||
|
||||
procedure Test.1 (Test.4):
|
||||
let Test.8 : Builtin(Int(I64)) = 10i64;
|
||||
let Test.7 : Builtin(Int(I64)) = CallByName Num.22 Test.8 Test.4;
|
||||
let Test.8 : I64 = 10i64;
|
||||
let Test.7 : I64 = CallByName Num.22 Test.8 Test.4;
|
||||
ret Test.7;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.10 : Builtin(Int(I64)) = 9i64;
|
||||
let Test.5 : Builtin(Int(I64)) = CallByName Test.1 Test.10;
|
||||
let Test.10 : I64 = 9i64;
|
||||
let Test.5 : I64 = CallByName Test.1 Test.10;
|
||||
ret Test.5;
|
||||
|
@ -1,16 +1,16 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.8 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.8 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.8;
|
||||
|
||||
procedure Test.1 (Test.2):
|
||||
let Test.3 : Builtin(Int(I64)) = StructAtIndex 0 Test.2;
|
||||
let Test.4 : Builtin(Int(I64)) = StructAtIndex 1 Test.2;
|
||||
let Test.7 : Builtin(Int(I64)) = CallByName Num.22 Test.3 Test.4;
|
||||
let Test.3 : I64 = StructAtIndex 0 Test.2;
|
||||
let Test.4 : I64 = StructAtIndex 1 Test.2;
|
||||
let Test.7 : I64 = CallByName Num.22 Test.3 Test.4;
|
||||
ret Test.7;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.9 : Builtin(Int(I64)) = 4i64;
|
||||
let Test.10 : Builtin(Int(I64)) = 9i64;
|
||||
let Test.6 : Struct([Builtin(Int(I64)), Builtin(Int(I64))]) = Struct {Test.9, Test.10};
|
||||
let Test.5 : Builtin(Int(I64)) = CallByName Test.1 Test.6;
|
||||
let Test.9 : I64 = 4i64;
|
||||
let Test.10 : I64 = 9i64;
|
||||
let Test.6 : {I64, I64} = Struct {Test.9, Test.10};
|
||||
let Test.5 : I64 = CallByName Test.1 Test.6;
|
||||
ret Test.5;
|
||||
|
@ -1,13 +1,13 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.8 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.8 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.8;
|
||||
|
||||
procedure Test.1 (Test.2):
|
||||
let Test.3 : Builtin(Int(I64)) = 10i64;
|
||||
let Test.7 : Builtin(Int(I64)) = CallByName Num.22 Test.3 Test.2;
|
||||
let Test.3 : I64 = 10i64;
|
||||
let Test.7 : I64 = CallByName Num.22 Test.3 Test.2;
|
||||
ret Test.7;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.9 : Builtin(Int(I64)) = 9i64;
|
||||
let Test.5 : Builtin(Int(I64)) = CallByName Test.1 Test.9;
|
||||
let Test.9 : I64 = 9i64;
|
||||
let Test.5 : I64 = CallByName Test.1 Test.9;
|
||||
ret Test.5;
|
||||
|
@ -1,48 +1,48 @@
|
||||
procedure List.3 (#Attr.2, #Attr.3):
|
||||
let Test.39 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
||||
let Test.36 : Builtin(Bool) = lowlevel NumLt #Attr.3 Test.39;
|
||||
let Test.39 : U64 = lowlevel ListLen #Attr.2;
|
||||
let Test.36 : Int1 = lowlevel NumLt #Attr.3 Test.39;
|
||||
if Test.36 then
|
||||
let Test.38 : Builtin(Int(I64)) = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
|
||||
let Test.37 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = Ok Test.38;
|
||||
let Test.38 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
|
||||
let Test.37 : [C {}, C I64] = Ok Test.38;
|
||||
ret Test.37;
|
||||
else
|
||||
let Test.35 : Struct([]) = Struct {};
|
||||
let Test.34 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = Err Test.35;
|
||||
let Test.35 : {} = Struct {};
|
||||
let Test.34 : [C {}, C I64] = Err Test.35;
|
||||
ret Test.34;
|
||||
|
||||
procedure List.4 (#Attr.2, #Attr.3, #Attr.4):
|
||||
let Test.19 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
||||
let Test.17 : Builtin(Bool) = lowlevel NumLt #Attr.3 Test.19;
|
||||
let Test.19 : U64 = lowlevel ListLen #Attr.2;
|
||||
let Test.17 : Int1 = lowlevel NumLt #Attr.3 Test.19;
|
||||
if Test.17 then
|
||||
let Test.18 : Builtin(List(Builtin(Int(I64)))) = lowlevel ListSet #Attr.2 #Attr.3 #Attr.4;
|
||||
let Test.18 : List I64 = lowlevel ListSet #Attr.2 #Attr.3 #Attr.4;
|
||||
ret Test.18;
|
||||
else
|
||||
ret #Attr.2;
|
||||
|
||||
procedure Test.1 (Test.2, Test.3, Test.4):
|
||||
let Test.33 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = CallByName List.3 Test.4 Test.3;
|
||||
let Test.32 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = CallByName List.3 Test.4 Test.2;
|
||||
let Test.13 : Struct([Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])), Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]]))]) = Struct {Test.32, Test.33};
|
||||
let Test.33 : [C {}, C I64] = CallByName List.3 Test.4 Test.3;
|
||||
let Test.32 : [C {}, C I64] = CallByName List.3 Test.4 Test.2;
|
||||
let Test.13 : {[C {}, C I64], [C {}, C I64]} = Struct {Test.32, Test.33};
|
||||
joinpoint Test.29:
|
||||
let Test.20 : Builtin(List(Builtin(Int(I64)))) = Array [];
|
||||
let Test.20 : List I64 = Array [];
|
||||
ret Test.20;
|
||||
in
|
||||
let Test.26 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = StructAtIndex 1 Test.13;
|
||||
let Test.27 : Builtin(Int(U8)) = 1i64;
|
||||
let Test.28 : Builtin(Int(U8)) = GetTagId Test.26;
|
||||
let Test.31 : Builtin(Bool) = lowlevel Eq Test.27 Test.28;
|
||||
let Test.26 : [C {}, C I64] = StructAtIndex 1 Test.13;
|
||||
let Test.27 : U8 = 1i64;
|
||||
let Test.28 : U8 = GetTagId Test.26;
|
||||
let Test.31 : Int1 = lowlevel Eq Test.27 Test.28;
|
||||
if Test.31 then
|
||||
let Test.23 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = StructAtIndex 0 Test.13;
|
||||
let Test.24 : Builtin(Int(U8)) = 1i64;
|
||||
let Test.25 : Builtin(Int(U8)) = GetTagId Test.23;
|
||||
let Test.30 : Builtin(Bool) = lowlevel Eq Test.24 Test.25;
|
||||
let Test.23 : [C {}, C I64] = StructAtIndex 0 Test.13;
|
||||
let Test.24 : U8 = 1i64;
|
||||
let Test.25 : U8 = GetTagId Test.23;
|
||||
let Test.30 : Int1 = lowlevel Eq Test.24 Test.25;
|
||||
if Test.30 then
|
||||
let Test.22 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = StructAtIndex 0 Test.13;
|
||||
let Test.6 : Builtin(Int(I64)) = UnionAtIndex (Id 1) (Index 0) Test.22;
|
||||
let Test.21 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = StructAtIndex 1 Test.13;
|
||||
let Test.7 : Builtin(Int(I64)) = UnionAtIndex (Id 1) (Index 0) Test.21;
|
||||
let Test.15 : Builtin(List(Builtin(Int(I64)))) = CallByName List.4 Test.4 Test.2 Test.7;
|
||||
let Test.14 : Builtin(List(Builtin(Int(I64)))) = CallByName List.4 Test.15 Test.3 Test.6;
|
||||
let Test.22 : [C {}, C I64] = StructAtIndex 0 Test.13;
|
||||
let Test.6 : I64 = UnionAtIndex (Id 1) (Index 0) Test.22;
|
||||
let Test.21 : [C {}, C I64] = StructAtIndex 1 Test.13;
|
||||
let Test.7 : I64 = UnionAtIndex (Id 1) (Index 0) Test.21;
|
||||
let Test.15 : List I64 = CallByName List.4 Test.4 Test.2 Test.7;
|
||||
let Test.14 : List I64 = CallByName List.4 Test.15 Test.3 Test.6;
|
||||
ret Test.14;
|
||||
else
|
||||
dec Test.4;
|
||||
@ -52,8 +52,8 @@ procedure Test.1 (Test.2, Test.3, Test.4):
|
||||
jump Test.29;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.10 : Builtin(Int(U64)) = 0i64;
|
||||
let Test.11 : Builtin(Int(U64)) = 0i64;
|
||||
let Test.12 : Builtin(List(Builtin(Int(I64)))) = Array [1i64];
|
||||
let Test.9 : Builtin(List(Builtin(Int(I64)))) = CallByName Test.1 Test.10 Test.11 Test.12;
|
||||
let Test.10 : U64 = 0i64;
|
||||
let Test.11 : U64 = 0i64;
|
||||
let Test.12 : List I64 = Array [1i64];
|
||||
let Test.9 : List I64 = CallByName Test.1 Test.10 Test.11 Test.12;
|
||||
ret Test.9;
|
||||
|
@ -1,8 +1,8 @@
|
||||
procedure Test.0 ():
|
||||
let Test.3 : Builtin(Bool) = true;
|
||||
let Test.3 : Int1 = true;
|
||||
if Test.3 then
|
||||
let Test.4 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.4 : I64 = 1i64;
|
||||
ret Test.4;
|
||||
else
|
||||
let Test.2 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.2 : I64 = 2i64;
|
||||
ret Test.2;
|
||||
|
@ -1,27 +1,27 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.27 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.27 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.27;
|
||||
|
||||
procedure Num.24 (#Attr.2, #Attr.3):
|
||||
let Test.22 : Builtin(Int(I64)) = lowlevel NumMul #Attr.2 #Attr.3;
|
||||
let Test.22 : I64 = lowlevel NumMul #Attr.2 #Attr.3;
|
||||
ret Test.22;
|
||||
|
||||
procedure Test.1 ():
|
||||
let Test.28 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.28 : I64 = 1i64;
|
||||
ret Test.28;
|
||||
|
||||
procedure Test.2 ():
|
||||
let Test.23 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.23 : I64 = 2i64;
|
||||
ret Test.23;
|
||||
|
||||
procedure Test.3 (Test.6):
|
||||
let Test.26 : Builtin(Int(I64)) = CallByName Test.1;
|
||||
let Test.25 : Builtin(Int(I64)) = CallByName Num.22 Test.6 Test.26;
|
||||
let Test.26 : I64 = CallByName Test.1;
|
||||
let Test.25 : I64 = CallByName Num.22 Test.6 Test.26;
|
||||
ret Test.25;
|
||||
|
||||
procedure Test.4 (Test.7):
|
||||
let Test.21 : Builtin(Int(I64)) = CallByName Test.2;
|
||||
let Test.20 : Builtin(Int(I64)) = CallByName Num.24 Test.7 Test.21;
|
||||
let Test.21 : I64 = CallByName Test.2;
|
||||
let Test.20 : I64 = CallByName Num.24 Test.7 Test.21;
|
||||
ret Test.20;
|
||||
|
||||
procedure Test.5 (Test.8, Test.9):
|
||||
@ -30,24 +30,24 @@ procedure Test.5 (Test.8, Test.9):
|
||||
in
|
||||
switch Test.8:
|
||||
case 0:
|
||||
let Test.16 : Builtin(Int(I64)) = CallByName Test.3 Test.9;
|
||||
let Test.16 : I64 = CallByName Test.3 Test.9;
|
||||
jump Test.15 Test.16;
|
||||
|
||||
default:
|
||||
let Test.17 : Builtin(Int(I64)) = CallByName Test.4 Test.9;
|
||||
let Test.17 : I64 = CallByName Test.4 Test.9;
|
||||
jump Test.15 Test.17;
|
||||
|
||||
|
||||
procedure Test.0 ():
|
||||
joinpoint Test.19 Test.12:
|
||||
let Test.13 : Builtin(Int(I64)) = 42i64;
|
||||
let Test.11 : Builtin(Int(I64)) = CallByName Test.5 Test.12 Test.13;
|
||||
let Test.13 : I64 = 42i64;
|
||||
let Test.11 : I64 = CallByName Test.5 Test.12 Test.13;
|
||||
ret Test.11;
|
||||
in
|
||||
let Test.24 : Builtin(Bool) = true;
|
||||
let Test.24 : Int1 = true;
|
||||
if Test.24 then
|
||||
let Test.3 : LambdaSet(LambdaSet { set: [( Test.3, []), ( Test.4, [])], representation: Builtin(Bool) }) = false;
|
||||
let Test.3 : Int1 = false;
|
||||
jump Test.19 Test.3;
|
||||
else
|
||||
let Test.4 : LambdaSet(LambdaSet { set: [( Test.3, []), ( Test.4, [])], representation: Builtin(Bool) }) = true;
|
||||
let Test.4 : Int1 = true;
|
||||
jump Test.19 Test.4;
|
||||
|
@ -1,53 +1,53 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.28 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.28 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.28;
|
||||
|
||||
procedure Num.24 (#Attr.2, #Attr.3):
|
||||
let Test.25 : Builtin(Int(I64)) = lowlevel NumMul #Attr.2 #Attr.3;
|
||||
let Test.25 : I64 = lowlevel NumMul #Attr.2 #Attr.3;
|
||||
ret Test.25;
|
||||
|
||||
procedure Test.1 (Test.2, Test.3):
|
||||
let Test.17 : Builtin(Int(U8)) = GetTagId Test.2;
|
||||
let Test.17 : U8 = GetTagId Test.2;
|
||||
joinpoint Test.18 Test.16:
|
||||
ret Test.16;
|
||||
in
|
||||
switch Test.17:
|
||||
case 0:
|
||||
let Test.19 : Builtin(Int(I64)) = CallByName Test.7 Test.3 Test.2;
|
||||
let Test.19 : I64 = CallByName Test.7 Test.3 Test.2;
|
||||
jump Test.18 Test.19;
|
||||
|
||||
default:
|
||||
let Test.20 : Builtin(Int(I64)) = CallByName Test.8 Test.3 Test.2;
|
||||
let Test.20 : I64 = CallByName Test.8 Test.3 Test.2;
|
||||
jump Test.18 Test.20;
|
||||
|
||||
|
||||
procedure Test.7 (Test.10, #Attr.12):
|
||||
let Test.4 : Builtin(Int(I64)) = UnionAtIndex (Id 0) (Index 0) #Attr.12;
|
||||
let Test.27 : Builtin(Int(I64)) = CallByName Num.22 Test.10 Test.4;
|
||||
let Test.4 : I64 = UnionAtIndex (Id 0) (Index 0) #Attr.12;
|
||||
let Test.27 : I64 = CallByName Num.22 Test.10 Test.4;
|
||||
ret Test.27;
|
||||
|
||||
procedure Test.8 (Test.11, #Attr.12):
|
||||
let Test.6 : Builtin(Bool) = UnionAtIndex (Id 1) (Index 1) #Attr.12;
|
||||
let Test.5 : Builtin(Int(I64)) = UnionAtIndex (Id 1) (Index 0) #Attr.12;
|
||||
let Test.6 : Int1 = UnionAtIndex (Id 1) (Index 1) #Attr.12;
|
||||
let Test.5 : I64 = UnionAtIndex (Id 1) (Index 0) #Attr.12;
|
||||
if Test.6 then
|
||||
let Test.24 : Builtin(Int(I64)) = CallByName Num.24 Test.11 Test.5;
|
||||
let Test.24 : I64 = CallByName Num.24 Test.11 Test.5;
|
||||
ret Test.24;
|
||||
else
|
||||
ret Test.11;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.6 : Builtin(Bool) = true;
|
||||
let Test.4 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.5 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.6 : Int1 = true;
|
||||
let Test.4 : I64 = 1i64;
|
||||
let Test.5 : I64 = 2i64;
|
||||
joinpoint Test.22 Test.14:
|
||||
let Test.15 : Builtin(Int(I64)) = 42i64;
|
||||
let Test.13 : Builtin(Int(I64)) = CallByName Test.1 Test.14 Test.15;
|
||||
let Test.15 : I64 = 42i64;
|
||||
let Test.13 : I64 = CallByName Test.1 Test.14 Test.15;
|
||||
ret Test.13;
|
||||
in
|
||||
let Test.26 : Builtin(Bool) = true;
|
||||
let Test.26 : Int1 = true;
|
||||
if Test.26 then
|
||||
let Test.7 : LambdaSet(LambdaSet { set: [( Test.7, [Builtin(Int(I64))]), ( Test.8, [Builtin(Int(I64)), Builtin(Bool)])], representation: Union(NonRecursive([[Builtin(Int(I64))], [Builtin(Int(I64)), Builtin(Bool)]])) }) = ClosureTag(Test.7) Test.4;
|
||||
let Test.7 : [C I64, C I64 Int1] = ClosureTag(Test.7) Test.4;
|
||||
jump Test.22 Test.7;
|
||||
else
|
||||
let Test.8 : LambdaSet(LambdaSet { set: [( Test.7, [Builtin(Int(I64))]), ( Test.8, [Builtin(Int(I64)), Builtin(Bool)])], representation: Union(NonRecursive([[Builtin(Int(I64))], [Builtin(Int(I64)), Builtin(Bool)]])) }) = ClosureTag(Test.8) Test.5 Test.6;
|
||||
let Test.8 : [C I64, C I64 Int1] = ClosureTag(Test.8) Test.5 Test.6;
|
||||
jump Test.22 Test.8;
|
||||
|
@ -1,44 +1,44 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.24 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.24 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.24;
|
||||
|
||||
procedure Num.24 (#Attr.2, #Attr.3):
|
||||
let Test.21 : Builtin(Int(I64)) = lowlevel NumMul #Attr.2 #Attr.3;
|
||||
let Test.21 : I64 = lowlevel NumMul #Attr.2 #Attr.3;
|
||||
ret Test.21;
|
||||
|
||||
procedure Test.6 (Test.8, #Attr.12):
|
||||
let Test.4 : Builtin(Int(I64)) = UnionAtIndex (Id 0) (Index 0) #Attr.12;
|
||||
let Test.23 : Builtin(Int(I64)) = CallByName Num.22 Test.8 Test.4;
|
||||
let Test.4 : I64 = UnionAtIndex (Id 0) (Index 0) #Attr.12;
|
||||
let Test.23 : I64 = CallByName Num.22 Test.8 Test.4;
|
||||
ret Test.23;
|
||||
|
||||
procedure Test.7 (Test.9, #Attr.12):
|
||||
let Test.5 : Builtin(Int(I64)) = UnionAtIndex (Id 1) (Index 0) #Attr.12;
|
||||
let Test.20 : Builtin(Int(I64)) = CallByName Num.24 Test.9 Test.5;
|
||||
let Test.5 : I64 = UnionAtIndex (Id 1) (Index 0) #Attr.12;
|
||||
let Test.20 : I64 = CallByName Num.24 Test.9 Test.5;
|
||||
ret Test.20;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.4 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.5 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.12 : Builtin(Int(I64)) = 42i64;
|
||||
let Test.4 : I64 = 1i64;
|
||||
let Test.5 : I64 = 2i64;
|
||||
let Test.12 : I64 = 42i64;
|
||||
joinpoint Test.19 Test.13:
|
||||
let Test.14 : Builtin(Int(U8)) = GetTagId Test.13;
|
||||
let Test.14 : U8 = GetTagId Test.13;
|
||||
joinpoint Test.15 Test.11:
|
||||
ret Test.11;
|
||||
in
|
||||
switch Test.14:
|
||||
case 0:
|
||||
let Test.16 : Builtin(Int(I64)) = CallByName Test.6 Test.12 Test.13;
|
||||
let Test.16 : I64 = CallByName Test.6 Test.12 Test.13;
|
||||
jump Test.15 Test.16;
|
||||
|
||||
default:
|
||||
let Test.17 : Builtin(Int(I64)) = CallByName Test.7 Test.12 Test.13;
|
||||
let Test.17 : I64 = CallByName Test.7 Test.12 Test.13;
|
||||
jump Test.15 Test.17;
|
||||
|
||||
in
|
||||
let Test.22 : Builtin(Bool) = true;
|
||||
let Test.22 : Int1 = true;
|
||||
if Test.22 then
|
||||
let Test.6 : LambdaSet(LambdaSet { set: [( Test.6, [Builtin(Int(I64))]), ( Test.7, [Builtin(Int(I64))])], representation: Union(NonRecursive([[Builtin(Int(I64))], [Builtin(Int(I64))]])) }) = ClosureTag(Test.6) Test.4;
|
||||
let Test.6 : [C I64, C I64] = ClosureTag(Test.6) Test.4;
|
||||
jump Test.19 Test.6;
|
||||
else
|
||||
let Test.7 : LambdaSet(LambdaSet { set: [( Test.6, [Builtin(Int(I64))]), ( Test.7, [Builtin(Int(I64))])], representation: Union(NonRecursive([[Builtin(Int(I64))], [Builtin(Int(I64))]])) }) = ClosureTag(Test.7) Test.5;
|
||||
let Test.7 : [C I64, C I64] = ClosureTag(Test.7) Test.5;
|
||||
jump Test.19 Test.7;
|
||||
|
@ -1,23 +1,23 @@
|
||||
procedure Test.1 (Test.5):
|
||||
let Test.2 : Builtin(Int(U8)) = 0u8;
|
||||
let Test.2 : U8 = 0u8;
|
||||
joinpoint Test.9 Test.3:
|
||||
ret Test.3;
|
||||
in
|
||||
switch Test.2:
|
||||
case 1:
|
||||
let Test.10 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.10 : I64 = 1i64;
|
||||
jump Test.9 Test.10;
|
||||
|
||||
case 2:
|
||||
let Test.11 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.11 : I64 = 2i64;
|
||||
jump Test.9 Test.11;
|
||||
|
||||
default:
|
||||
let Test.12 : Builtin(Int(I64)) = 3i64;
|
||||
let Test.12 : I64 = 3i64;
|
||||
jump Test.9 Test.12;
|
||||
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.7 : Struct([]) = Struct {};
|
||||
let Test.6 : Builtin(Int(I64)) = CallByName Test.1 Test.7;
|
||||
let Test.7 : {} = Struct {};
|
||||
let Test.6 : I64 = CallByName Test.1 Test.7;
|
||||
ret Test.6;
|
||||
|
@ -1,28 +1,28 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.8 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.8 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.8;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.20 : Builtin(Int(I64)) = 41i64;
|
||||
let Test.19 : Union(NonRecursive([[Builtin(Int(I64))], []])) = Just Test.20;
|
||||
let Test.2 : Union(NonRecursive([[Union(NonRecursive([[Builtin(Int(I64))], []]))], []])) = Just Test.19;
|
||||
let Test.20 : I64 = 41i64;
|
||||
let Test.19 : [C I64, C ] = Just Test.20;
|
||||
let Test.2 : [C [C I64, C ], C ] = Just Test.19;
|
||||
joinpoint Test.16:
|
||||
let Test.9 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.9 : I64 = 1i64;
|
||||
ret Test.9;
|
||||
in
|
||||
let Test.14 : Builtin(Int(U8)) = 0i64;
|
||||
let Test.15 : Builtin(Int(U8)) = GetTagId Test.2;
|
||||
let Test.18 : Builtin(Bool) = lowlevel Eq Test.14 Test.15;
|
||||
let Test.14 : U8 = 0i64;
|
||||
let Test.15 : U8 = GetTagId Test.2;
|
||||
let Test.18 : Int1 = lowlevel Eq Test.14 Test.15;
|
||||
if Test.18 then
|
||||
let Test.11 : Union(NonRecursive([[Builtin(Int(I64))], []])) = UnionAtIndex (Id 0) (Index 0) Test.2;
|
||||
let Test.12 : Builtin(Int(U8)) = 0i64;
|
||||
let Test.13 : Builtin(Int(U8)) = GetTagId Test.11;
|
||||
let Test.17 : Builtin(Bool) = lowlevel Eq Test.12 Test.13;
|
||||
let Test.11 : [C I64, C ] = UnionAtIndex (Id 0) (Index 0) Test.2;
|
||||
let Test.12 : U8 = 0i64;
|
||||
let Test.13 : U8 = GetTagId Test.11;
|
||||
let Test.17 : Int1 = lowlevel Eq Test.12 Test.13;
|
||||
if Test.17 then
|
||||
let Test.10 : Union(NonRecursive([[Builtin(Int(I64))], []])) = UnionAtIndex (Id 0) (Index 0) Test.2;
|
||||
let Test.5 : Builtin(Int(I64)) = UnionAtIndex (Id 0) (Index 0) Test.10;
|
||||
let Test.7 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.6 : Builtin(Int(I64)) = CallByName Num.22 Test.5 Test.7;
|
||||
let Test.10 : [C I64, C ] = UnionAtIndex (Id 0) (Index 0) Test.2;
|
||||
let Test.5 : I64 = UnionAtIndex (Id 0) (Index 0) Test.10;
|
||||
let Test.7 : I64 = 1i64;
|
||||
let Test.6 : I64 = CallByName Num.22 Test.5 Test.7;
|
||||
ret Test.6;
|
||||
else
|
||||
jump Test.16;
|
||||
|
@ -1,9 +1,9 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.5 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.5 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.5;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.6 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.4 : Builtin(Int(I64)) = 3i64;
|
||||
let Test.3 : Builtin(Int(I64)) = CallByName Num.22 Test.6 Test.4;
|
||||
let Test.6 : I64 = 2i64;
|
||||
let Test.4 : I64 = 3i64;
|
||||
let Test.3 : I64 = CallByName Num.22 Test.6 Test.4;
|
||||
ret Test.3;
|
||||
|
@ -1,27 +1,27 @@
|
||||
procedure Test.1 (Test.5):
|
||||
let Test.19 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.2 : Union(NonRecursive([[Builtin(Int(I64))], [Builtin(Int(I64))]])) = Ok Test.19;
|
||||
let Test.19 : I64 = 2i64;
|
||||
let Test.2 : [C I64, C I64] = Ok Test.19;
|
||||
joinpoint Test.9 Test.3:
|
||||
ret Test.3;
|
||||
in
|
||||
let Test.16 : Builtin(Int(U8)) = 1i64;
|
||||
let Test.17 : Builtin(Int(U8)) = GetTagId Test.2;
|
||||
let Test.18 : Builtin(Bool) = lowlevel Eq Test.16 Test.17;
|
||||
let Test.16 : U8 = 1i64;
|
||||
let Test.17 : U8 = GetTagId Test.2;
|
||||
let Test.18 : Int1 = lowlevel Eq Test.16 Test.17;
|
||||
if Test.18 then
|
||||
let Test.13 : Builtin(Int(I64)) = UnionAtIndex (Id 1) (Index 0) Test.2;
|
||||
let Test.14 : Builtin(Int(I64)) = 3i64;
|
||||
let Test.15 : Builtin(Bool) = lowlevel Eq Test.14 Test.13;
|
||||
let Test.13 : I64 = UnionAtIndex (Id 1) (Index 0) Test.2;
|
||||
let Test.14 : I64 = 3i64;
|
||||
let Test.15 : Int1 = lowlevel Eq Test.14 Test.13;
|
||||
if Test.15 then
|
||||
let Test.10 : Builtin(Int(I64)) = 1i64;
|
||||
let Test.10 : I64 = 1i64;
|
||||
jump Test.9 Test.10;
|
||||
else
|
||||
let Test.11 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.11 : I64 = 2i64;
|
||||
jump Test.9 Test.11;
|
||||
else
|
||||
let Test.12 : Builtin(Int(I64)) = 3i64;
|
||||
let Test.12 : I64 = 3i64;
|
||||
jump Test.9 Test.12;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.7 : Struct([]) = Struct {};
|
||||
let Test.6 : Builtin(Int(I64)) = CallByName Test.1 Test.7;
|
||||
let Test.7 : {} = Struct {};
|
||||
let Test.6 : I64 = CallByName Test.1 Test.7;
|
||||
ret Test.6;
|
||||
|
@ -1,26 +1,26 @@
|
||||
procedure Num.22 (#Attr.2, #Attr.3):
|
||||
let Test.7 : Builtin(Int(I64)) = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
let Test.7 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
||||
ret Test.7;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.16 : Builtin(Int(I64)) = 3i64;
|
||||
let Test.15 : Builtin(Int(I64)) = 2i64;
|
||||
let Test.4 : Struct([Builtin(Int(I64)), Builtin(Int(I64))]) = Struct {Test.15, Test.16};
|
||||
let Test.16 : I64 = 3i64;
|
||||
let Test.15 : I64 = 2i64;
|
||||
let Test.4 : {I64, I64} = Struct {Test.15, Test.16};
|
||||
joinpoint Test.12:
|
||||
let Test.2 : Builtin(Int(I64)) = StructAtIndex 0 Test.4;
|
||||
let Test.3 : Builtin(Int(I64)) = StructAtIndex 1 Test.4;
|
||||
let Test.6 : Builtin(Int(I64)) = CallByName Num.22 Test.2 Test.3;
|
||||
let Test.2 : I64 = StructAtIndex 0 Test.4;
|
||||
let Test.3 : I64 = StructAtIndex 1 Test.4;
|
||||
let Test.6 : I64 = CallByName Num.22 Test.2 Test.3;
|
||||
ret Test.6;
|
||||
in
|
||||
let Test.10 : Builtin(Int(I64)) = StructAtIndex 1 Test.4;
|
||||
let Test.11 : Builtin(Int(I64)) = 3i64;
|
||||
let Test.14 : Builtin(Bool) = lowlevel Eq Test.11 Test.10;
|
||||
let Test.10 : I64 = StructAtIndex 1 Test.4;
|
||||
let Test.11 : I64 = 3i64;
|
||||
let Test.14 : Int1 = lowlevel Eq Test.11 Test.10;
|
||||
if Test.14 then
|
||||
let Test.8 : Builtin(Int(I64)) = StructAtIndex 0 Test.4;
|
||||
let Test.9 : Builtin(Int(I64)) = 4i64;
|
||||
let Test.13 : Builtin(Bool) = lowlevel Eq Test.9 Test.8;
|
||||
let Test.8 : I64 = StructAtIndex 0 Test.4;
|
||||
let Test.9 : I64 = 4i64;
|
||||
let Test.13 : Int1 = lowlevel Eq Test.9 Test.8;
|
||||
if Test.13 then
|
||||
let Test.5 : Builtin(Int(I64)) = 9i64;
|
||||
let Test.5 : I64 = 9i64;
|
||||
ret Test.5;
|
||||
else
|
||||
jump Test.12;
|
||||
|
@ -1249,6 +1249,24 @@ fn aliased_polymorphic_closure() {
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn issue_2535_polymorphic_fields_referenced_in_list() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [ nums ] to "./platform"
|
||||
|
||||
alpha = { a: 1, b: 2 }
|
||||
|
||||
nums : List U8
|
||||
nums =
|
||||
[
|
||||
alpha.a,
|
||||
alpha.b,
|
||||
]
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
||||
// #[ignore]
|
||||
// #[mono_test]
|
||||
// fn static_str_closure() {
|
||||
|
@ -331,7 +331,7 @@ fn jit_to_ast_help<'a, A: ReplApp<'a>>(
|
||||
Layout::Builtin(other) => {
|
||||
todo!("add support for rendering builtin {:?} to the REPL", other)
|
||||
}
|
||||
Layout::Struct(field_layouts) => {
|
||||
Layout::Struct { field_layouts, .. } => {
|
||||
let struct_addr_to_ast = |mem: &'a A::Memory, addr: usize| match content {
|
||||
Content::Structure(FlatType::Record(fields, _)) => {
|
||||
Ok(struct_to_ast(env, mem, addr, field_layouts, *fields))
|
||||
@ -382,7 +382,7 @@ fn jit_to_ast_help<'a, A: ReplApp<'a>>(
|
||||
};
|
||||
|
||||
let fields = [Layout::u64(), *layout];
|
||||
let layout = Layout::Struct(&fields);
|
||||
let layout = Layout::struct_no_name_order(&fields);
|
||||
|
||||
let result_stack_size = layout.stack_size(env.target_info);
|
||||
|
||||
@ -516,7 +516,7 @@ fn addr_to_ast<'a, M: ReplAppMemory>(
|
||||
|
||||
str_to_ast(env.arena, arena_str)
|
||||
}
|
||||
(_, Layout::Struct(field_layouts)) => match content {
|
||||
(_, Layout::Struct{field_layouts, ..}) => match content {
|
||||
Content::Structure(FlatType::Record(fields, _)) => {
|
||||
struct_to_ast(env, mem, addr, field_layouts, *fields)
|
||||
}
|
||||
@ -796,7 +796,7 @@ fn single_tag_union_to_ast<'a, M: ReplAppMemory>(
|
||||
sequence_of_expr(env, mem, addr, it, WhenRecursive::Unreachable).into_bump_slice()
|
||||
} else if field_layouts.is_empty() && !payload_vars.is_empty() {
|
||||
// happens for e.g. `Foo Bar` where unit structures are nested and the inner one is dropped
|
||||
let it = payload_vars.iter().copied().zip([&Layout::Struct(&[])]);
|
||||
let it = payload_vars.iter().copied().zip([&Layout::UNIT]);
|
||||
sequence_of_expr(env, mem, addr, it, WhenRecursive::Unreachable).into_bump_slice()
|
||||
} else {
|
||||
unreachable!()
|
||||
@ -864,7 +864,7 @@ fn struct_to_ast<'a, M: ReplAppMemory>(
|
||||
env,
|
||||
mem,
|
||||
addr,
|
||||
&Layout::Struct(field_layouts),
|
||||
&Layout::struct_no_name_order(field_layouts),
|
||||
WhenRecursive::Unreachable,
|
||||
inner_content,
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user