mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59: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
|
- name: Test setjmp/longjmp logic
|
||||||
run: cargo test-gen-dev --locked --release nat_alias && cargo test-gen-dev --locked --release a_crash
|
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.
|
- 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
|
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::{
|
use inkwell::{
|
||||||
attributes::{Attribute, AttributeLoc},
|
attributes::{Attribute, AttributeLoc},
|
||||||
module::Linkage,
|
module::Linkage,
|
||||||
types::{BasicType, IntType},
|
types::{BasicType, BasicTypeEnum, IntType},
|
||||||
values::{
|
values::{
|
||||||
BasicValue, BasicValueEnum, FloatValue, FunctionValue, InstructionOpcode, IntValue,
|
BasicValue, BasicValueEnum, FloatValue, FunctionValue, InstructionOpcode, IntValue,
|
||||||
PointerValue, StructValue,
|
PointerValue, StructValue,
|
||||||
|
@ -513,12 +513,18 @@ pub(crate) fn run_low_level<'a, 'ctx>(
|
||||||
use roc_target::OperatingSystem::*;
|
use roc_target::OperatingSystem::*;
|
||||||
match env.target_info.operating_system {
|
match env.target_info.operating_system {
|
||||||
Windows => {
|
Windows => {
|
||||||
let return_type = env.context.struct_type(
|
let zig_return_type = env
|
||||||
&[env.ptr_int().into(), env.context.i32_type().into()],
|
.module
|
||||||
false,
|
.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(
|
call_void_bitcode_fn(
|
||||||
env,
|
env,
|
||||||
|
@ -526,19 +532,19 @@ pub(crate) fn run_low_level<'a, 'ctx>(
|
||||||
bitcode::STR_GET_SCALAR_UNSAFE,
|
bitcode::STR_GET_SCALAR_UNSAFE,
|
||||||
);
|
);
|
||||||
|
|
||||||
let return_type = basic_type_from_layout(
|
let roc_return_type = basic_type_from_layout(
|
||||||
env,
|
env,
|
||||||
layout_interner,
|
layout_interner,
|
||||||
layout_interner.get_repr(layout),
|
layout_interner.get_repr(layout),
|
||||||
);
|
);
|
||||||
let cast_result = env.builder.build_pointer_cast(
|
let cast_result = env.builder.build_pointer_cast(
|
||||||
result,
|
result,
|
||||||
return_type.ptr_type(AddressSpace::default()),
|
roc_return_type.ptr_type(AddressSpace::default()),
|
||||||
"cast",
|
"cast",
|
||||||
);
|
);
|
||||||
|
|
||||||
env.builder
|
env.builder
|
||||||
.new_build_load(return_type, cast_result, "load_result")
|
.new_build_load(roc_return_type, cast_result, "load_result")
|
||||||
}
|
}
|
||||||
Unix => {
|
Unix => {
|
||||||
let result = call_str_bitcode_fn(
|
let result = call_str_bitcode_fn(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue