Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-hughes committed Nov 21, 2023
1 parent 88a482e commit ba2e09d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions library/alloc/tests/gc.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use std::gc::GcAllocator;

#[repr(align(1024))]
struct S(u8);

#[test]
fn large_alignment() {
let x = Box::new_in(S(123), GcAllocator);
let ptr = Box::into_raw(x);
assert!(!ptr.is_null());
assert!(ptr.is_aligned());
}
1 change: 1 addition & 0 deletions library/alloc/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ mod c_str;
mod const_fns;
mod cow_str;
mod fmt;
mod gc;
mod heap;
mod linked_list;
mod rc;
Expand Down

0 comments on commit ba2e09d

Please sign in to comment.