mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
fix alignment problem
This commit is contained in:
parent
516db4dafd
commit
aa9bf6bdff
2 changed files with 46 additions and 13 deletions
|
@ -5,6 +5,23 @@ use crate::assert_evals_to;
|
|||
use indoc::indoc;
|
||||
use roc_std::{RocList, RocStr};
|
||||
|
||||
#[test]
|
||||
fn width_and_alignment_u8_u8() {
|
||||
use roc_mono::layout::Builtin;
|
||||
use roc_mono::layout::Layout;
|
||||
use roc_mono::layout::UnionLayout;
|
||||
|
||||
let t = &[Layout::Builtin(Builtin::Int8)] as &[_];
|
||||
let tt = [t, t];
|
||||
|
||||
let layout = Layout::Union(UnionLayout::NonRecursive(&tt));
|
||||
|
||||
// at the moment, the tag id uses an I64, so
|
||||
let ptr_width = 8;
|
||||
assert_eq!(layout.alignment_bytes(ptr_width), 8);
|
||||
assert_eq!(layout.stack_size(ptr_width), 16);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn applied_tag_nothing_ir() {
|
||||
assert_evals_to!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue