diff --git a/library/alloc/tests/gc.rs b/library/alloc/tests/gc.rs new file mode 100644 index 0000000000000..be25f93d38a4a --- /dev/null +++ b/library/alloc/tests/gc.rs @@ -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()); +} diff --git a/library/alloc/tests/lib.rs b/library/alloc/tests/lib.rs index 2529c8384764a..1bc2b7dc08e8f 100644 --- a/library/alloc/tests/lib.rs +++ b/library/alloc/tests/lib.rs @@ -56,6 +56,7 @@ mod c_str; mod const_fns; mod cow_str; mod fmt; +mod gc; mod heap; mod linked_list; mod rc;