Skip to content

Commit 25afbbc

Browse files
committed
Remove arm::t32-specific function pointer test.
All function pointers are currently treated as unaligned anyway; any change implementing function pointer alignment during consteval should add tests that it works properly on arm::t32 functions.
1 parent 10fde9e commit 25afbbc

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

tests/ui/consts/ptr_comparisons.rs

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,6 @@ const ALIGNED_FN_PTR: *const () = {
4242
unsafe { std::mem::transmute(aligned_foo as fn()) }
4343
};
4444

45-
// Only on armv5te-* and armv4t-*
46-
#[cfg(all(
47-
target_arch = "arm",
48-
not(target_feature = "v6"),
49-
))]
50-
const ALIGNED_THUMB_FN_PTR: *const () = {
51-
#[rustc_align(2)]
52-
#[instruction_set(arm::t32)]
53-
fn aligned_thumb_foo() {}
54-
unsafe { std::mem::transmute(aligned_thumb_foo as fn()) }
55-
};
56-
5745
trait Trait {
5846
#[allow(unused)]
5947
fn method(&self) -> u8;
@@ -204,14 +192,10 @@ do_test!(VTABLE_PTR_1, VTABLE_PTR_2, None);
204192
// due to platform-specific semantics.
205193
// See https://github.com/rust-lang/rust/issues/144661
206194
// FIXME: This could return `Some` on platforms where function pointers' addresses actually
207-
// correspond to function addresses including alignment, or on ARM if t32 function pointers
208-
// have their low bit set for consteval.
195+
// correspond to function addresses including alignment, or on platforms where all functions
196+
// are aligned to some amount (e.g. ARM where a32 function pointers are at least 4-aligned,
197+
// and t32 function pointers are 2-aligned-offset-by-1).
209198
do_test!(ALIGNED_FN_PTR, ALIGNED_FN_PTR.wrapping_byte_offset(1), None);
210-
#[cfg(all(
211-
target_arch = "arm",
212-
not(target_feature = "v6"),
213-
))]
214-
do_test!(ALIGNED_THUMB_FN_PTR, ALIGNED_THUMB_FN_PTR.wrapping_byte_offset(1), None);
215199

216200
// Conservatively say we don't know.
217201
do_test!(FN_PTR, VTABLE_PTR_1, None);

0 commit comments

Comments
 (0)