Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / Intrinsics / ieee_is_normal.f90
blob84b3d2bf0a6d3502e094df62a239b143155fa957
1 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
2 ! RUN: flang-new -fc1 -emit-fir %s -o - | FileCheck %s
4 ! CHECK-LABEL: ieee_is_normal_f16
5 subroutine ieee_is_normal_f16(r)
6 use ieee_arithmetic
7 real(KIND=2) :: r
8 i = ieee_is_normal(r)
9 ! CHECK: %[[test:.*]] = arith.constant 360 : i32
10 ! CHECK: %[[l:.*]] = "llvm.intr.is.fpclass"(%{{.*}}, %[[test]]) : (f16, i32) -> i1
11 ! CHECK: fir.convert %[[l]] : (i1) -> !fir.logical<4>
12 end subroutine ieee_is_normal_f16
14 ! CHECK-LABEL: ieee_is_normal_bf16
15 subroutine ieee_is_normal_bf16(r)
16 use ieee_arithmetic
17 real(KIND=3) :: r
18 i = ieee_is_normal(r)
19 ! CHECK: %[[test:.*]] = arith.constant 360 : i32
20 ! CHECK: %[[l:.*]] = "llvm.intr.is.fpclass"(%{{.*}}, %[[test]]) : (bf16, i32) -> i1
21 ! CHECK: fir.convert %[[l]] : (i1) -> !fir.logical<4>
22 end subroutine ieee_is_normal_bf16
26 ! CHECK-LABEL: ieee_is_normal_f32
27 subroutine ieee_is_normal_f32(r)
28 use ieee_arithmetic
29 real :: r
30 i = ieee_is_normal(r)
31 ! CHECK: %[[test:.*]] = arith.constant 360 : i32
32 ! CHECK: %[[l:.*]] = "llvm.intr.is.fpclass"(%{{.*}}, %[[test]]) : (f32, i32) -> i1
33 ! CHECK: fir.convert %[[l]] : (i1) -> !fir.logical<4>
34 end subroutine ieee_is_normal_f32
36 ! CHECK-LABEL: ieee_is_normal_f64
37 subroutine ieee_is_normal_f64(r)
38 use ieee_arithmetic
39 real(KIND=8) :: r
40 i = ieee_is_normal(r)
41 ! CHECK: %[[test:.*]] = arith.constant 360 : i32
42 ! CHECK: %[[l:.*]] = "llvm.intr.is.fpclass"(%{{.*}}, %[[test]]) : (f64, i32) -> i1
43 ! CHECK: fir.convert %[[l]] : (i1) -> !fir.logical<4>
44 end subroutine ieee_is_normal_f64
46 ! CHECK-LABEL: ieee_is_normal_f80
47 subroutine ieee_is_normal_f80(r)
48 use ieee_arithmetic
49 real(KIND=10) :: r
50 i = ieee_is_normal(r)
51 ! CHECK: %[[test:.*]] = arith.constant 360 : i32
52 ! CHECK: %[[l:.*]] = "llvm.intr.is.fpclass"(%{{.*}}, %[[test]]) : (f80, i32) -> i1
53 ! CHECK: fir.convert %[[l]] : (i1) -> !fir.logical<4>
54 end subroutine ieee_is_normal_f80
56 ! CHECK-LABEL: ieee_is_normal_f128
57 subroutine ieee_is_normal_f128(r)
58 use ieee_arithmetic
59 real(KIND=16) :: r
60 i = ieee_is_normal(r)
61 ! CHECK: %[[test:.*]] = arith.constant 360 : i32
62 ! CHECK: %[[l:.*]] = "llvm.intr.is.fpclass"(%{{.*}}, %[[test]]) : (f128, i32) -> i1
63 ! CHECK: fir.convert %[[l]] : (i1) -> !fir.logical<4>
64 end subroutine ieee_is_normal_f128