[flang-commits] [flang] 742939f - [flang] Reinstate class query test

V Donaldson via flang-commits flang-commits at lists.llvm.org
Thu Jun 29 20:27:39 PDT 2023


Author: V Donaldson
Date: 2023-06-29T20:27:08-07:00
New Revision: 742939f128cbf9c979e3d30e4e720825f84e214c

URL: https://github.com/llvm/llvm-project/commit/742939f128cbf9c979e3d30e4e720825f84e214c
DIFF: https://github.com/llvm/llvm-project/commit/742939f128cbf9c979e3d30e4e720825f84e214c.diff

LOG: [flang] Reinstate class query test

Remove kind=10 test variant, which is not universally supported.

Added: 
    flang/test/Lower/Intrinsics/ieee_class_queries.f90

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/flang/test/Lower/Intrinsics/ieee_class_queries.f90 b/flang/test/Lower/Intrinsics/ieee_class_queries.f90
new file mode 100644
index 0000000000000..bb7787ea903e2
--- /dev/null
+++ b/flang/test/Lower/Intrinsics/ieee_class_queries.f90
@@ -0,0 +1,48 @@
+! RUN: bbc -emit-fir -o - %s | FileCheck %s
+
+  ! CHECK-LABEL: func @_QQmain
+  use ieee_arithmetic, only: ieee_is_finite, ieee_is_nan, ieee_is_negative, &
+                             ieee_is_normal
+  real(2) :: x2 = -2.0
+  real(3) :: x3 = -3.0
+  real(4) :: x4 = -4.0
+  real(8) :: x8 = -8.0
+  real(10) :: x10 = -10.0
+  real(16) :: x16 = -16.0
+
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 504 : i32}> : (f16) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 60 : i32}> : (f16) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 360 : i32}> : (f16) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 3 : i32}> : (f16) -> i1
+  print*, ieee_is_finite(x2), ieee_is_negative(x2), ieee_is_normal(x2), &
+          ieee_is_nan(x2)
+
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 504 : i32}> : (bf16) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 60 : i32}> : (bf16) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 360 : i32}> : (bf16) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 3 : i32}> : (bf16) -> i1
+  print*, ieee_is_finite(x3), ieee_is_negative(x3), ieee_is_normal(x3), &
+          ieee_is_nan(x3)
+
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 504 : i32}> : (f32) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 60 : i32}> : (f32) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 360 : i32}> : (f32) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 3 : i32}> : (f32) -> i1
+  print*, ieee_is_finite(x4), ieee_is_negative(x4), ieee_is_normal(x4), &
+          ieee_is_nan(x4)
+
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 504 : i32}> : (f64) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 60 : i32}> : (f64) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 360 : i32}> : (f64) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 3 : i32}> : (f64) -> i1
+  print*, ieee_is_finite(x8), ieee_is_negative(x8), ieee_is_normal(x8), &
+          ieee_is_nan(x8)
+
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 504 : i32}> : (f128) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 60 : i32}> : (f128) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 360 : i32}> : (f128) -> i1
+  ! CHECK:     "llvm.intr.is.fpclass"(%{{.*}}) <{bit = 3 : i32}> : (f128) -> i1
+  print*, ieee_is_finite(x16), ieee_is_negative(x16), ieee_is_normal(x16), &
+          ieee_is_nan(x16)
+
+  end


        


More information about the flang-commits mailing list