mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
windows fix getScalarUnsafe, run gen_str tests
This commit is contained in:
parent
446cff6157
commit
dd766686d1
2 changed files with 20 additions and 9 deletions
5
.github/workflows/windows_tests.yml
vendored
5
.github/workflows/windows_tests.yml
vendored
|
@ -59,6 +59,11 @@ jobs:
|
|||
- name: Test setjmp/longjmp logic
|
||||
run: cargo test-gen-dev --locked --release nat_alias && cargo test-gen-dev --locked --release a_crash
|
||||
|
||||
- name: Run gen tests
|
||||
run: cargo test-gen-llvm --locked --release gen_str
|
||||
|
||||
- name: Actually run the tests.
|
||||
run: cargo test --locked --release -p roc_ident -p roc_region -p roc_collections -p roc_can -p roc_types -p roc_solve -p roc_mono -p roc_gen_dev -p roc_gen_wasm -p roc_serialize -p roc_editor -p roc_linker -p roc_cli
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use inkwell::{
|
||||
attributes::{Attribute, AttributeLoc},
|
||||
module::Linkage,
|
||||
types::{BasicType, IntType},
|
||||
types::{BasicType, BasicTypeEnum, IntType},
|
||||
values::{
|
||||
BasicValue, BasicValueEnum, FloatValue, FunctionValue, InstructionOpcode, IntValue,
|
||||
PointerValue, StructValue,
|
||||
|
@ -513,12 +513,18 @@ pub(crate) fn run_low_level<'a, 'ctx>(
|
|||
use roc_target::OperatingSystem::*;
|
||||
match env.target_info.operating_system {
|
||||
Windows => {
|
||||
let return_type = env.context.struct_type(
|
||||
&[env.ptr_int().into(), env.context.i32_type().into()],
|
||||
false,
|
||||
);
|
||||
let zig_return_type = env
|
||||
.module
|
||||
.get_function(bitcode::STR_GET_SCALAR_UNSAFE)
|
||||
.unwrap()
|
||||
.get_type()
|
||||
.get_param_types()[0]
|
||||
.into_pointer_type()
|
||||
.get_element_type();
|
||||
|
||||
let result = env.builder.build_alloca(return_type, "result");
|
||||
let result = env
|
||||
.builder
|
||||
.build_alloca(BasicTypeEnum::try_from(zig_return_type).unwrap(), "result");
|
||||
|
||||
call_void_bitcode_fn(
|
||||
env,
|
||||
|
@ -526,19 +532,19 @@ pub(crate) fn run_low_level<'a, 'ctx>(
|
|||
bitcode::STR_GET_SCALAR_UNSAFE,
|
||||
);
|
||||
|
||||
let return_type = basic_type_from_layout(
|
||||
let roc_return_type = basic_type_from_layout(
|
||||
env,
|
||||
layout_interner,
|
||||
layout_interner.get_repr(layout),
|
||||
);
|
||||
let cast_result = env.builder.build_pointer_cast(
|
||||
result,
|
||||
return_type.ptr_type(AddressSpace::default()),
|
||||
roc_return_type.ptr_type(AddressSpace::default()),
|
||||
"cast",
|
||||
);
|
||||
|
||||
env.builder
|
||||
.new_build_load(return_type, cast_result, "load_result")
|
||||
.new_build_load(roc_return_type, cast_result, "load_result")
|
||||
}
|
||||
Unix => {
|
||||
let result = call_str_bitcode_fn(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue