mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Rollup merge of #153884 - folkertdev:f16-classify-runtime-const, r=tgross35
test `classify-runtime-const` for `f16` tracking issue: https://github.com/rust-lang/rust/issues/116909 r? tgross35
This commit is contained in:
@@ -98,8 +98,8 @@ pub unsafe fn issue_75761() {
|
||||
|
||||
macro_rules! check {
|
||||
($func:ident $ty:ident $class:ident $mov:literal $modifier:literal) => {
|
||||
// FIXME(f16_f128): Change back to `$func(x: $ty) -> $ty` once arm64ec can pass and return
|
||||
// `f16` and `f128` without LLVM erroring.
|
||||
// FIXME(f128): Change back to `$func(x: $ty) -> $ty` once arm64ec can pass and return
|
||||
// `f128` without LLVM erroring.
|
||||
// LLVM issue: <https://github.com/llvm/llvm-project/issues/94434>
|
||||
#[no_mangle]
|
||||
pub unsafe fn $func(inp: &$ty, out: &mut $ty) {
|
||||
@@ -117,7 +117,7 @@ pub unsafe fn $func(inp: &$ty, out: &mut $ty) {
|
||||
|
||||
macro_rules! check_reg {
|
||||
($func:ident $ty:ident $reg:tt $mov:literal) => {
|
||||
// FIXME(f16_f128): See FIXME in `check!`
|
||||
// FIXME(f128): See FIXME in `check!`
|
||||
#[no_mangle]
|
||||
pub unsafe fn $func(inp: &$ty, out: &mut $ty) {
|
||||
let x = *inp;
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
//@ revisions: opt noopt ctfe
|
||||
//@[opt] compile-flags: -O
|
||||
//@[noopt] compile-flags: -Zmir-opt-level=0
|
||||
//@ min-llvm-version: 22
|
||||
//@ compile-flags: --check-cfg=cfg(target_has_reliable_f16)
|
||||
// ignore-tidy-linelength
|
||||
#![feature(cfg_target_has_reliable_f16_f128)]
|
||||
#![cfg_attr(target_has_reliable_f16, feature(f16))]
|
||||
|
||||
// This tests the float classification functions, for regular runtime code and for const evaluation.
|
||||
|
||||
@@ -50,6 +54,13 @@ macro_rules! assert_test {
|
||||
|
||||
macro_rules! suite {
|
||||
( $tyname:ident => $( $tt:tt )* ) => {
|
||||
#[cfg(target_has_reliable_f16)]
|
||||
fn f16() {
|
||||
#[allow(unused)]
|
||||
type $tyname = f16;
|
||||
suite_inner!(f16 => $($tt)*);
|
||||
}
|
||||
|
||||
fn f32() {
|
||||
#[allow(unused)]
|
||||
type $tyname = f32;
|
||||
@@ -121,7 +132,9 @@ macro_rules! suite_inner {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
#[cfg(target_has_reliable_f16)]
|
||||
f16();
|
||||
f32();
|
||||
f64();
|
||||
// FIXME(f16_f128): also test f16 and f128
|
||||
// FIXME(f128): also test f128
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user