1! RUN: bbc %s -o - | FileCheck %s
2
3! CHECK-LABEL: func @_QPi
4subroutine i
5  implicit none
6  integer :: ctemp(10) = (/1,2,3,4,5,6,7,8,9,22/)
7  print *, ctemp(1:10)
8end subroutine i
9
10! CHECK-LABEL: func @_QPs2
11subroutine s2
12  real :: x(10)
13  x = 0.0
14  ! CHECK: fir.call @_FortranAioBeginExternalListOutput
15  print *, x
16  ! CHECK: %[[s:.*]] = fir.slice {{.*}} !fir.slice<1>
17  ! CHECK: %[[p:.*]] = fir.array_coor %{{.*}} [%[[s]]] %
18  ! CHECK: fir.store %{{.*}} to %[[p]] : !fir.ref<f32>
19  x(1:10:3) = 2.0
20  ! CHECK: fir.call @_FortranAioBeginExternalListOutput
21  print *, x
22end subroutine s2
23
24! CHECK-LABEL: func @_QQmain
25program main
26  integer :: A(10)
27  A(1) = 1
28  A(2) = 2
29  A(3) = 3
30  print *, A
31  ! CHECK: %[[A:.*]] = fir.address_of(@_QFEa)
32  ! CHECK: %[[shape:.*]] = fir.shape %c10
33  ! CHECK: %[[slice:.*]] = fir.slice %
34  ! CHECK: fir.embox %[[A]](%[[shape]]) [%[[slice]]] :
35  print*, A(1:3:1)
36  call s
37  call i
38end program main
39