Skip to content

Commit 4e40c05

Browse files
authored
Rollup merge of rust-lang#153884 - folkertdev:f16-classify-runtime-const, r=tgross35
test `classify-runtime-const` for `f16` tracking issue: rust-lang#116909 r? tgross35
2 parents 607de1a + 19e9ec7 commit 4e40c05

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

tests/assembly-llvm/asm/aarch64-types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ pub unsafe fn issue_75761() {
9898

9999
macro_rules! check {
100100
($func:ident $ty:ident $class:ident $mov:literal $modifier:literal) => {
101-
// FIXME(f16_f128): Change back to `$func(x: $ty) -> $ty` once arm64ec can pass and return
102-
// `f16` and `f128` without LLVM erroring.
101+
// FIXME(f128): Change back to `$func(x: $ty) -> $ty` once arm64ec can pass and return
102+
// `f128` without LLVM erroring.
103103
// LLVM issue: <https://github.com/llvm/llvm-project/issues/94434>
104104
#[no_mangle]
105105
pub unsafe fn $func(inp: &$ty, out: &mut $ty) {
@@ -117,7 +117,7 @@ macro_rules! check {
117117

118118
macro_rules! check_reg {
119119
($func:ident $ty:ident $reg:tt $mov:literal) => {
120-
// FIXME(f16_f128): See FIXME in `check!`
120+
// FIXME(f128): See FIXME in `check!`
121121
#[no_mangle]
122122
pub unsafe fn $func(inp: &$ty, out: &mut $ty) {
123123
let x = *inp;

tests/ui/float/classify-runtime-const.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
//@ revisions: opt noopt ctfe
33
//@[opt] compile-flags: -O
44
//@[noopt] compile-flags: -Zmir-opt-level=0
5+
//@ min-llvm-version: 22
6+
//@ compile-flags: --check-cfg=cfg(target_has_reliable_f16)
57
// ignore-tidy-linelength
8+
#![feature(cfg_target_has_reliable_f16_f128)]
9+
#![cfg_attr(target_has_reliable_f16, feature(f16))]
610

711
// This tests the float classification functions, for regular runtime code and for const evaluation.
812

@@ -50,6 +54,13 @@ macro_rules! assert_test {
5054

5155
macro_rules! suite {
5256
( $tyname:ident => $( $tt:tt )* ) => {
57+
#[cfg(target_has_reliable_f16)]
58+
fn f16() {
59+
#[allow(unused)]
60+
type $tyname = f16;
61+
suite_inner!(f16 => $($tt)*);
62+
}
63+
5364
fn f32() {
5465
#[allow(unused)]
5566
type $tyname = f32;
@@ -121,7 +132,9 @@ suite! { T => // type alias for the type we are testing
121132
}
122133

123134
fn main() {
135+
#[cfg(target_has_reliable_f16)]
136+
f16();
124137
f32();
125138
f64();
126-
// FIXME(f16_f128): also test f16 and f128
139+
// FIXME(f128): also test f128
127140
}

0 commit comments

Comments
 (0)