76 lines · plain
1! Test that $dir loop directives (known or unknown) are not clashing2! with $acc lowering.3 4! RUN: %flang_fc1 -fopenacc -emit-hlfir %s -o - | FileCheck %s5 6subroutine test_before_acc_loop(a, b, c)7 real, dimension(10) :: a,b,c8 !dir$ myloop_directive_19 !dir$ myloop_directive_210 !$acc loop11 do i=1,N12 a(i) = b(i) + c(i)13 enddo14end subroutine15! CHECK-LABEL: test_before_acc_loop16! CHECK: acc.loop17 18subroutine test_after_acc_loop(a, b, c)19 real, dimension(10) :: a,b,c20 !$acc loop21 !dir$ myloop_directive_122 !dir$ myloop_directive_223 do i=1,N24 a(i) = b(i) + c(i)25 enddo26end subroutine27! CHECK-LABEL: test_after_acc_loop28! CHECK: acc.loop29 30subroutine test_before_acc_combined(a, b, c)31 real, dimension(10) :: a,b,c32 !dir$ myloop_directive_133 !dir$ myloop_directive_234 !$acc parallel loop35 do i=1,N36 a(i) = b(i) + c(i)37 enddo38end subroutine39! CHECK-LABEL: test_before_acc_combined40! CHECK: acc.parallel combined(loop)41 42subroutine test_after_acc_combined(a, b, c)43 real, dimension(10) :: a,b,c44 !$acc parallel loop45 !dir$ myloop_directive_146 !dir$ myloop_directive_247 do i=1,N48 a(i) = b(i) + c(i)49 enddo50end subroutine51! CHECK-LABEL: test_after_acc_combined52! CHECK: acc.parallel combined(loop)53 54 55subroutine test_vector_always_after_acc(a, b, c)56 real, dimension(10) :: a,b,c57 !$acc loop58 !dir$ vector always59 do i=1,N60 a(i) = b(i) + c(i)61 enddo62end subroutine63! CHECK-LABEL: test_vector_always_after_acc64! CHECK: acc.loop65 66subroutine test_vector_always_before_acc(a, b, c)67 real, dimension(10) :: a,b,c68 !dir$ vector always69 !$acc loop70 do i=1,N71 a(i) = b(i) + c(i)72 enddo73end subroutine74! CHECK-LABEL: test_vector_always_before_acc75! CHECK: acc.loop76