92 lines · plain
1! RUN: split-file %s %t2! RUN: %not_todo_cmd bbc -fopenacc -emit-hlfir %t/do_loop_with_stop.f90 -o - 2>&1 | FileCheck %s --check-prefix=CHECK13! RUN: %not_todo_cmd bbc -fopenacc -emit-hlfir %t/do_loop_with_cycle_goto.f90 -o - 2>&1 | FileCheck %s --check-prefix=CHECK24! RUN: %not_todo_cmd bbc -fopenacc -emit-hlfir %t/nested_goto_loop.f90 -o - 2>&1 | FileCheck %s --check-prefix=CHECK35! RUN: %not_todo_cmd bbc -fopenacc -emit-hlfir %t/nested_loop_with_inner_goto.f90 -o - 2>&1 | FileCheck %s --check-prefix=CHECK46 7//--- do_loop_with_stop.f908 9subroutine do_loop_with_stop()10 integer :: i11 integer, parameter :: n = 1012 real, dimension(n) :: a, b13 14 !$acc kernels15 do i = 1, n16 a(i) = b(i) + 1.017 if (i == 5) stop18 end do19 !$acc end kernels20 21! CHECK1: not yet implemented: unstructured do loop in acc kernels22 23end subroutine24 25//--- do_loop_with_cycle_goto.f9026 27subroutine do_loop_with_cycle_goto()28 integer :: i29 integer, parameter :: n = 1030 real, dimension(n) :: a, b31 32 ! Do loop with cycle and goto - unstructured control flow is not converted.33 !$acc kernels34 do i = 1, n35 if (i == 3) cycle36 a(i) = b(i) + 1.037 if (i == 7) goto 20038 a(i) = a(i) * 2.039 end do40200 continue41 !$acc end kernels42 43! CHECK2: not yet implemented: unstructured do loop in acc kernels44 45end subroutine46 47//--- nested_goto_loop.f9048 49subroutine nested_goto_loop()50 integer :: i, j51 integer, parameter :: n = 10, m = 552 real, dimension(n,m) :: a, b53 54 ! Nested loop with goto from inner to outer - should NOT convert to acc.loop55 !$acc kernels56 do i = 1, n57 do j = 1, m58 a(i,j) = b(i,j) + 1.059 if (i * j > 20) goto 300 ! Exit both loops60 end do61 end do62300 continue63 !$acc end kernels64 65! CHECK3: not yet implemented: unstructured do loop in acc kernels66 67end subroutine68 69//--- nested_loop_with_inner_goto.f9070 71subroutine nested_loop_with_inner_goto()72 integer :: ii = 0, jj = 073 integer, parameter :: nn = 374 real, dimension(nn, nn) :: aa75 76 aa = -177 78 ! Nested loop with goto from inner loop - unstructured control flow is not converted.79 !$acc kernels80 do ii = 1, nn81 do jj = 1, nn82 if (jj > 1) goto 30083 aa(jj, ii) = 133784 end do85 300 continue86 end do87 !$acc end kernels88 89! CHECK4: not yet implemented: unstructured do loop in acc kernels90 91end subroutine92