diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp index 69c3300ba4390..5a548f4fcf435 100644 --- a/flang/lib/Lower/OpenACC.cpp +++ b/flang/lib/Lower/OpenACC.cpp @@ -4787,6 +4787,8 @@ genACC(Fortran::lower::AbstractConverter &converter, Fortran::semantics::SemanticsContext &semanticsContext, const Fortran::parser::OpenACCCacheConstruct &cacheConstruct) { fir::FirOpBuilder &builder = converter.getFirOpBuilder(); + mlir::Location loc = converter.genLocation(cacheConstruct.source); + TODO(loc, "OpenACC cache directive"); auto loopOp = builder.getRegion().getParentOfType(); auto crtPos = builder.saveInsertionPoint(); if (loopOp) { diff --git a/flang/test/Lower/OpenACC/Todo/acc-cache.f90 b/flang/test/Lower/OpenACC/Todo/acc-cache.f90 new file mode 100644 index 0000000000000..8b81e876ed2c9 --- /dev/null +++ b/flang/test/Lower/OpenACC/Todo/acc-cache.f90 @@ -0,0 +1,15 @@ +! RUN: %not_todo_cmd bbc -fopenacc -emit-hlfir %s -o - 2>&1 | FileCheck %s + +! CHECK: not yet implemented: OpenACC cache directive + +subroutine test_cache() + integer, parameter :: n = 10 + real, dimension(n) :: a, b + integer :: i + + !$acc loop + do i = 1, n + !$acc cache(b) + a(i) = b(i) + end do +end subroutine diff --git a/flang/test/Lower/OpenACC/acc-loop.f90 b/flang/test/Lower/OpenACC/acc-loop.f90 index 6adf06ad9cd53..ed87cf76038b5 100644 --- a/flang/test/Lower/OpenACC/acc-loop.f90 +++ b/flang/test/Lower/OpenACC/acc-loop.f90 @@ -359,15 +359,6 @@ program acc_loop ! CHECK: acc.yield ! CHECK-NEXT: } attributes {inclusiveUpperbound = array, independent = [#acc.device_type]} - !$acc loop - DO i = 1, n - !$acc cache(b) - a(i) = b(i) - END DO - -! CHECK: %[[CACHE:.*]] = acc.cache varPtr(%{{.*}} : !fir.ref>) -> !fir.ref> {name = "b"} -! CHECK: acc.loop {{.*}} cache(%[[CACHE]] : !fir.ref>) - !$acc loop do 100 i=0, n 100 continue