mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 05:34:11 +03:00
Fixed: Actually calling llvm we generate
This commit is contained in:
parent
ce8f947522
commit
744fefc3a1
@ -25,9 +25,9 @@ pub fn asin(num: f64) callconv(.C) f64 {
|
||||
/// TODO: Obviously, this should not be an alias for arcsin(x);
|
||||
/// fix me!
|
||||
pub fn bytesToU16C(num: f64) callconv(.C) f64 {
|
||||
return @call(.{ .modifier = always_inline }, bytesToU16, .{num});
|
||||
return num + 1;
|
||||
}
|
||||
|
||||
fn bytesToU16(num: f64) f64 {
|
||||
return math.asin(num);
|
||||
return num + 1;
|
||||
}
|
||||
|
@ -1096,7 +1096,7 @@ fn num_bytes_to_u16(symbol: Symbol, var_store: &mut VarStore) -> Def {
|
||||
let ret_float_var = var_store.fresh();
|
||||
|
||||
let body = RunLowLevel {
|
||||
op: LowLevel::NumAsin,
|
||||
op: LowLevel::NumBytesToU16,
|
||||
args: vec![(arg_float_var, Var(Symbol::ARG_1))],
|
||||
ret_var: ret_float_var,
|
||||
};
|
||||
|
@ -6061,6 +6061,7 @@ fn build_float_unary_op<'a, 'ctx, 'env>(
|
||||
NumAtan => call_bitcode_fn(env, &[arg.into()], bitcode::NUM_ATAN),
|
||||
NumAcos => call_bitcode_fn(env, &[arg.into()], bitcode::NUM_ACOS),
|
||||
NumAsin => call_bitcode_fn(env, &[arg.into()], bitcode::NUM_ASIN),
|
||||
NumBytesToU16 => call_bitcode_fn(env, &[arg.into()], bitcode::NUM_BYTES_TO_U16),
|
||||
_ => {
|
||||
unreachable!("Unrecognized int unary operation: {:?}", op);
|
||||
}
|
||||
|
@ -1623,6 +1623,6 @@ mod gen_num {
|
||||
|
||||
#[test]
|
||||
fn num_bytes_to_u16_ascii() {
|
||||
assert_evals_to!("Num.bytesToU16 0", 0.0, f64);
|
||||
assert_evals_to!("Num.bytesToU16 1", 2.0, f64);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user