brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 61499ec Raw
52 lines · plain
1! RUN: bbc -hlfir=false %s -o - | FileCheck %s2 3! CHECK-LABEL: func @_QPi4subroutine i5  implicit none6  integer :: ctemp(10) = (/1,2,3,4,5,6,7,8,9,22/)7  print *, ctemp(1:10)8end subroutine i9 10! CHECK-LABEL: func @_QPs11subroutine s12  integer, parameter :: LONGreal = 813  real (kind = LONGreal), dimension(-1:11) :: x = (/0,0,0,0,0,0,0,0,0,0,0,0,0/)14  real (kind = LONGreal), dimension(0:12) :: g = (/0,0,0,0,0,0,0,0,0,0,0,0,0/)15  real (kind = LONGreal) :: gs(13)16  x(1) = 4.017  g(1) = 5.018  gs = g(0:12:1) + x(11:(-1):(-1))19  print *, gs20  !print *, dot_product(g(0:12:1), x(11:(-1):(-1)))21end subroutine s22 23! CHECK-LABEL: func @_QPs224subroutine s225  real :: x(10)26  x = 0.027  ! CHECK: fir.call @_FortranAioBeginExternalListOutput28  print *, x29  ! CHECK: %[[s:.*]] = fir.slice {{.*}} !fir.slice<1>30  ! CHECK: %[[p:.*]] = fir.array_coor %{{.*}} [%[[s]]] %31  ! CHECK: fir.store %{{.*}} to %[[p]] : !fir.ref<f32>32  x(1:10:3) = 2.033  ! CHECK: fir.call @_FortranAioBeginExternalListOutput34  print *, x35end subroutine s236 37! CHECK-LABEL: func @_QQmain38program main39  integer :: A(10)40  A(1) = 141  A(2) = 242  A(3) = 343  print *, A44  ! CHECK: %[[A:.*]] = fir.address_of(@_QFEa)45  ! CHECK: %[[shape:.*]] = fir.shape %c1046  ! CHECK: %[[slice:.*]] = fir.slice %47  ! CHECK: fir.embox %[[A]](%[[shape]]) [%[[slice]]] :48  print*, A(1:3:1)49  call s50  call i51end program main52