1 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
2 ! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
4 ! CHECK-LABEL: func @_QPmod_testr4(
5 ! CHECK-SAME: %[[arg0:.*]]: !fir.ref<f32>{{.*}}, %[[arg1:.*]]: !fir.ref<f32>{{.*}}, %[[arg2:.*]]: !fir.ref<f32>{{.*}}) {
6 subroutine mod_testr4(r
, a
, p
)
8 ! CHECK: %[[V1:.*]] = fir.load %[[arg1]] : !fir.ref<f32>
9 ! CHECK: %[[V2:.*]] = fir.load %[[arg2]] : !fir.ref<f32>
10 ! CHECK: %[[FILE:.*]] = fir.address_of(@{{.*}}) : !fir.ref<!fir.char<1,{{.*}}>>
11 ! CHECK: %[[LINE:.*]] = arith.constant {{[0-9]*}} : i32
12 ! CHECK: %[[FILEARG:.*]] = fir.convert %[[FILE]] : (!fir.ref<!fir.char<1,{{.*}}>>) -> !fir.ref<i8>
13 ! CHECK: fir.call @_FortranAModReal4(%[[V1]], %[[V2]], %[[FILEARG]], %[[LINE]]) {{.*}}: (f32, f32, !fir.ref<i8>, i32) -> f32
17 ! CHECK-LABEL: func @_QPmod_testr8(
18 ! CHECK-SAME: %[[arg0:.*]]: !fir.ref<f64>{{.*}}, %[[arg1:.*]]: !fir.ref<f64>{{.*}}, %[[arg2:.*]]: !fir.ref<f64>{{.*}}) {
19 subroutine mod_testr8(r
, a
, p
)
21 ! CHECK: %[[V1:.*]] = fir.load %[[arg1]] : !fir.ref<f64>
22 ! CHECK: %[[V2:.*]] = fir.load %[[arg2]] : !fir.ref<f64>
23 ! CHECK: %[[FILE:.*]] = fir.address_of(@{{.*}}) : !fir.ref<!fir.char<1,{{.*}}>>
24 ! CHECK: %[[LINE:.*]] = arith.constant {{[0-9]*}} : i32
25 ! CHECK: %[[FILEARG:.*]] = fir.convert %[[FILE]] : (!fir.ref<!fir.char<1,{{.*}}>>) -> !fir.ref<i8>
26 ! CHECK: fir.call @_FortranAModReal8(%[[V1]], %[[V2]], %[[FILEARG]], %[[LINE]]) {{.*}}: (f64, f64, !fir.ref<i8>, i32) -> f64
30 ! CHECK-LABEL: func @_QPmod_testr10(
31 ! CHECK-SAME: %[[arg0:.*]]: !fir.ref<f80>{{.*}}, %[[arg1:.*]]: !fir.ref<f80>{{.*}}, %[[arg2:.*]]: !fir.ref<f80>{{.*}}) {
32 subroutine mod_testr10(r
, a
, p
)
34 ! CHECK: %[[V1:.*]] = fir.load %[[arg1]] : !fir.ref<f80>
35 ! CHECK: %[[V2:.*]] = fir.load %[[arg2]] : !fir.ref<f80>
36 ! CHECK: %[[FILE:.*]] = fir.address_of(@{{.*}}) : !fir.ref<!fir.char<1,{{.*}}>>
37 ! CHECK: %[[LINE:.*]] = arith.constant {{[0-9]*}} : i32
38 ! CHECK: %[[FILEARG:.*]] = fir.convert %[[FILE]] : (!fir.ref<!fir.char<1,{{.*}}>>) -> !fir.ref<i8>
39 ! CHECK: fir.call @_FortranAModReal10(%[[V1]], %[[V2]], %[[FILEARG]], %[[LINE]]) {{.*}}: (f80, f80, !fir.ref<i8>, i32) -> f80
43 ! CHECK-LABEL: func @_QPmod_testr16(
44 ! CHECK-SAME: %[[arg0:.*]]: !fir.ref<f128>{{.*}}, %[[arg1:.*]]: !fir.ref<f128>{{.*}}, %[[arg2:.*]]: !fir.ref<f128>{{.*}}) {
45 subroutine mod_testr16(r
, a
, p
)
47 ! CHECK: %[[V1:.*]] = fir.load %[[arg1]] : !fir.ref<f128>
48 ! CHECK: %[[V2:.*]] = fir.load %[[arg2]] : !fir.ref<f128>
49 ! CHECK: %[[FILE:.*]] = fir.address_of(@{{.*}}) : !fir.ref<!fir.char<1,{{.*}}>>
50 ! CHECK: %[[LINE:.*]] = arith.constant {{[0-9]*}} : i32
51 ! CHECK: %[[FILEARG:.*]] = fir.convert %[[FILE]] : (!fir.ref<!fir.char<1,{{.*}}>>) -> !fir.ref<i8>
52 ! CHECK: fir.call @_FortranAModReal16(%[[V1]], %[[V2]], %[[FILEARG]], %[[LINE]]) {{.*}}: (f128, f128, !fir.ref<i8>, i32) -> f128