1! RUN: bbc -emit-fir -outline-intrinsics %s -o - | FileCheck %s
2! RUN: %flang_fc1 -emit-fir -mllvm -outline-intrinsics %s -o - | FileCheck %s
3
4! CHECK-LABEL: sqrt_testr
5subroutine sqrt_testr(a, b)
6  real :: a, b
7! CHECK: fir.call @fir.sqrt.f32.f32
8  b = sqrt(a)
9end subroutine
10
11! CHECK-LABEL: sqrt_testd
12subroutine sqrt_testd(a, b)
13  real(kind=8) :: a, b
14! CHECK: fir.call @fir.sqrt.f64.f64
15  b = sqrt(a)
16end subroutine
17
18! CHECK-LABEL: sqrt_testc
19subroutine sqrt_testc(z)
20  complex :: z
21! CHECK: fir.call @fir.sqrt.z4.z4
22  z = sqrt(z)
23end subroutine
24
25! CHECK-LABEL: sqrt_testcd
26subroutine sqrt_testcd(z)
27  complex(kind=8) :: z
28! CHECK: fir.call @fir.sqrt.z8.z8
29  z = sqrt(z)
30end subroutine
31
32! CHECK-LABEL: @fir.sqrt.f32.f32
33! CHECK: math.sqrt %{{.*}} : f32
34
35! CHECK-LABEL: @fir.sqrt.f64.f64
36! CHECK: math.sqrt %{{.*}} : f64
37
38! CHECK-LABEL: func private @fir.sqrt.z4.z4
39! CHECK: fir.call {{.*}}fc_sqrt
40
41! CHECK-LABEL: @fir.sqrt.z8.z8
42! CHECK: fir.call {{.*}}fz_sqrt
43