-
Notifications
You must be signed in to change notification settings - Fork 13.3k
/
Copy pathattributes.f90
37 lines (31 loc) · 1.37 KB
/
attributes.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! Test propagation of Fortran attributes to FIR.
! CHECK-LABEL: func @_QPfoo1(
! CHECK-SAME: %arg0: !fir.ref<f32> {fir.bindc_name = "x", fir.optional},
! CHECK-SAME: %arg1: !fir.box<!fir.array<?xf32>> {fir.bindc_name = "y", fir.optional},
! CHECK-SAME: %arg2: !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>> {fir.bindc_name = "i", fir.optional},
! CHECK-SAME: %arg3: !fir.boxchar<1> {fir.bindc_name = "c", fir.optional}
subroutine foo1(x, y, i, c)
real, optional :: x, y(:)
integer, allocatable, optional :: i(:)
character, optional :: c
end subroutine
! CHECK-LABEL: func @_QPfoo2(
! CHECK-SAME: %arg0: !fir.box<!fir.array<?xf32>> {fir.bindc_name = "x", fir.contiguous},
! CHECK-SAME: %arg1: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>> {fir.bindc_name = "i", fir.contiguous}
subroutine foo2(x, i)
real, contiguous :: x(:)
integer, pointer, contiguous :: i(:)
end subroutine
! CHECK-LABEL: func @_QPfoo3
! CHECK-SAME: %arg0: !fir.box<!fir.array<?xf32>> {fir.bindc_name = "x", fir.contiguous, fir.optional}
subroutine foo3(x)
real, optional, contiguous :: x(:)
end subroutine
! CHECK-LABEL: func @_QPfoo4
! CHECK-SAME: %arg0: !fir.ref<f32> {fir.bindc_name = "x", fir.target}
! CHECK-SAME: %arg1: !fir.ref<f32> {fir.asynchronous, fir.bindc_name = "y"}
subroutine foo4(x, y)
real, target :: x
real, asynchronous :: y
end subroutine