From ba2e09d3fef6603dfc4d47f740f27b8a980e81c4 Mon Sep 17 00:00:00 2001 From: Jake Hughes Date: Tue, 21 Nov 2023 14:08:47 +0000 Subject: [PATCH] Add a test --- library/alloc/tests/gc.rs | 12 ++++++++++++ library/alloc/tests/lib.rs | 1 + 2 files changed, 13 insertions(+) create mode 100644 library/alloc/tests/gc.rs 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;