From 773aadbd7bbe12ec6775a1c18128221462a60554 Mon Sep 17 00:00:00 2001 From: Tarun Prabhu Date: Thu, 13 Nov 2025 09:04:07 -0700 Subject: [PATCH] [flang][NFC] Strip trailing whitespace from tests (5 of N) Only the fortran source files in flang/test/Lower/OpenACC have been modified. The other files in flang/test will be cleaned up in subsequent commits --- .../OpenACC/Todo/do-loops-to-acc-loops-todo.f90 | 6 +++--- flang/test/Lower/OpenACC/acc-atomic-capture.f90 | 10 +++++----- .../test/Lower/OpenACC/acc-atomic-update-array.f90 | 6 +++--- flang/test/Lower/OpenACC/acc-atomic-update.f90 | 6 +++--- flang/test/Lower/OpenACC/acc-bounds.f90 | 2 +- flang/test/Lower/OpenACC/acc-host-data.f90 | 2 +- flang/test/Lower/OpenACC/acc-loop-exit.f90 | 8 ++++---- flang/test/Lower/OpenACC/acc-loop.f90 | 4 ++-- flang/test/Lower/OpenACC/acc-private.f90 | 8 ++++---- flang/test/Lower/OpenACC/acc-routine-named.f90 | 2 +- flang/test/Lower/OpenACC/acc-routine.f90 | 6 +++--- flang/test/Lower/OpenACC/acc-routine02.f90 | 2 +- flang/test/Lower/OpenACC/acc-routine03.f90 | 2 +- flang/test/Lower/OpenACC/acc-routine04.f90 | 8 ++++---- flang/test/Lower/OpenACC/acc-shutdown.f90 | 4 ++-- flang/test/Lower/OpenACC/acc-terminator.f90 | 2 +- flang/test/Lower/OpenACC/acc-use-device.f90 | 4 ++-- flang/test/Lower/OpenACC/locations.f90 | 14 ++++++-------- 18 files changed, 47 insertions(+), 49 deletions(-) diff --git a/flang/test/Lower/OpenACC/Todo/do-loops-to-acc-loops-todo.f90 b/flang/test/Lower/OpenACC/Todo/do-loops-to-acc-loops-todo.f90 index aa1d44365e5eb..3f2b77a9a1484 100644 --- a/flang/test/Lower/OpenACC/Todo/do-loops-to-acc-loops-todo.f90 +++ b/flang/test/Lower/OpenACC/Todo/do-loops-to-acc-loops-todo.f90 @@ -72,9 +72,9 @@ subroutine nested_loop_with_inner_goto() integer :: ii = 0, jj = 0 integer, parameter :: nn = 3 real, dimension(nn, nn) :: aa - + aa = -1 - + ! Nested loop with goto from inner loop - unstructured control flow is not converted. !$acc kernels do ii = 1, nn @@ -88,4 +88,4 @@ subroutine nested_loop_with_inner_goto() ! CHECK4: not yet implemented: unstructured do loop in acc kernels -end subroutine \ No newline at end of file +end subroutine diff --git a/flang/test/Lower/OpenACC/acc-atomic-capture.f90 b/flang/test/Lower/OpenACC/acc-atomic-capture.f90 index 30e60e34b13a2..ccdd4d3014e94 100644 --- a/flang/test/Lower/OpenACC/acc-atomic-capture.f90 +++ b/flang/test/Lower/OpenACC/acc-atomic-capture.f90 @@ -36,7 +36,7 @@ program acc_atomic_capture_test !CHECK: } !$acc atomic capture - y = x * y + y = x * y x = y !$acc end atomic @@ -53,8 +53,8 @@ program acc_atomic_capture_test !$acc atomic capture x = y - y = 2 * 10 + (8 - x) - !$acc end atomic + y = 2 * 10 + (8 - x) + !$acc end atomic end program @@ -123,8 +123,8 @@ subroutine capture_with_convert_f32_to_i32() ! CHECK: } subroutine capture_with_convert_i32_to_f64() - real(8) :: x - integer :: v, u + real(8) :: x + integer :: v, u x = 1.0 v = 0 u = 1 diff --git a/flang/test/Lower/OpenACC/acc-atomic-update-array.f90 b/flang/test/Lower/OpenACC/acc-atomic-update-array.f90 index 184c2a6fb0aeb..b04b0c9d5a143 100644 --- a/flang/test/Lower/OpenACC/acc-atomic-update-array.f90 +++ b/flang/test/Lower/OpenACC/acc-atomic-update-array.f90 @@ -5,7 +5,7 @@ subroutine atomic_update_array1(r, n, x) integer :: n real :: r(n), x integer :: i - + !$acc data copy(r) !$acc parallel loop @@ -51,7 +51,7 @@ subroutine atomic_write_array1(r, n, x) implicit none integer :: n real :: r(n), x - + !$acc atomic write x = r(n) end subroutine @@ -61,7 +61,7 @@ subroutine atomic_write_array1(r, n, x) ! CHECK: %[[DECL_X:.*]]:2 = hlfir.declare %[[ARG2]] dummy_scope %{{[0-9]+}} arg {{[0-9]+}} {uniq_name = "_QFatomic_write_array1Ex"} : (!fir.ref, !fir.dscope) -> (!fir.ref, !fir.ref) ! CHECK: %[[DECL_R:.*]]:2 = hlfir.declare %[[ARG0]](%{{.*}}) dummy_scope %{{[0-9]+}} arg {{[0-9]+}} {uniq_name = "_QFatomic_write_array1Er"} : (!fir.ref>, !fir.shape<1>, !fir.dscope) -> (!fir.box>, !fir.ref>) ! CHECK: %[[DES:.*]] = hlfir.designate %[[DECL_R]]#0 (%{{.*}}) : (!fir.box>, i64) -> !fir.ref -! CHECK: %[[LOAD:.*]] = fir.load %[[DES]] : !fir.ref +! CHECK: %[[LOAD:.*]] = fir.load %[[DES]] : !fir.ref ! CHECK: acc.atomic.write %[[DECL_X]]#0 = %[[LOAD]] : !fir.ref, f32 subroutine atomic_capture_array1(r, n, x, y) diff --git a/flang/test/Lower/OpenACC/acc-atomic-update.f90 b/flang/test/Lower/OpenACC/acc-atomic-update.f90 index 71aa69fd64eba..f4c305a332640 100644 --- a/flang/test/Lower/OpenACC/acc-atomic-update.f90 +++ b/flang/test/Lower/OpenACC/acc-atomic-update.f90 @@ -42,7 +42,7 @@ end function func !CHECK: } !$acc atomic update - a = a + b + a = a + b !CHECK: {{.*}} = arith.constant 1 : i32 !CHECK: acc.atomic.update %[[Y_DECL]]#0 : !fir.ref { @@ -56,10 +56,10 @@ end function func !CHECK: %[[RESULT:.*]] = arith.muli %[[LOADED_X]], %[[ARG]] : i32 !CHECK: acc.yield %[[RESULT]] : i32 !CHECK: } - !$acc atomic + !$acc atomic y = y + 1 !$acc atomic update - z = x * z + z = x * z !CHECK: %[[C1_VAL:.*]] = arith.constant 1 : i32 !CHECK: acc.atomic.update %[[I1_DECL]]#0 : !fir.ref { diff --git a/flang/test/Lower/OpenACC/acc-bounds.f90 b/flang/test/Lower/OpenACC/acc-bounds.f90 index 44ca2514f6eea..03779ac0cfe51 100644 --- a/flang/test/Lower/OpenACC/acc-bounds.f90 +++ b/flang/test/Lower/OpenACC/acc-bounds.f90 @@ -114,7 +114,7 @@ subroutine acc_optional_data(a) !$acc data attach(a) !$acc end data end subroutine - + ! CHECK-LABEL: func.func @_QMopenacc_boundsPacc_optional_data( ! CHECK-SAME: %[[ARG0:.*]]: !fir.ref>>> {fir.bindc_name = "a", fir.optional}) { ! CHECK: %[[ARG0_DECL:.*]]:2 = hlfir.declare %[[ARG0]] dummy_scope %{{[0-9]+}} arg {{[0-9]+}} {fortran_attrs = #fir.var_attrs, uniq_name = "_QMopenacc_boundsFacc_optional_dataEa"} : (!fir.ref>>>, !fir.dscope) -> (!fir.ref>>>, !fir.ref>>>) diff --git a/flang/test/Lower/OpenACC/acc-host-data.f90 b/flang/test/Lower/OpenACC/acc-host-data.f90 index 4d09b25b983b9..2cf8060bcf8d1 100644 --- a/flang/test/Lower/OpenACC/acc-host-data.f90 +++ b/flang/test/Lower/OpenACC/acc-host-data.f90 @@ -26,7 +26,7 @@ subroutine acc_host_data() ! CHECK: acc.host_data dataOperands(%[[DA0]], %[[DA1]] : !fir.ref>, !fir.ref>) ! CHECK: } attributes {ifPresent} - !$acc host_data use_device(a) if_present + !$acc host_data use_device(a) if_present !$acc end host_data ! CHECK: acc.host_data dataOperands(%{{.*}}{{.*}} : !fir.ref>{{.*}}) { ! CHECK: } attributes {ifPresent} diff --git a/flang/test/Lower/OpenACC/acc-loop-exit.f90 b/flang/test/Lower/OpenACC/acc-loop-exit.f90 index 0b35a86c41b2e..6ab215fdbd842 100644 --- a/flang/test/Lower/OpenACC/acc-loop-exit.f90 +++ b/flang/test/Lower/OpenACC/acc-loop-exit.f90 @@ -11,7 +11,7 @@ subroutine sub1(x, a) end do i = 2 -end +end ! CHECK-LABEL: func.func @_QPsub1 ! CHECK: %[[A:.*]]:2 = hlfir.declare %arg1 dummy_scope %{{[0-9]+}} arg {{[0-9]+}} {uniq_name = "_QFsub1Ea"} : (!fir.ref, !fir.dscope) -> (!fir.ref, !fir.ref) @@ -20,9 +20,9 @@ subroutine sub1(x, a) ! CHECK: %[[I:.*]]:2 = hlfir.declare %{{[0-9]+}} {uniq_name = "_QFsub1Ei"} : (!fir.ref) -> (!fir.ref, !fir.ref) ! CHECK: ^bb{{.*}}: ! CHECK: ^bb{{.*}}: -! CHECK: %[[LOAD_I:.*]] = fir.load %[[I]]#0 : !fir.ref -! CHECK: %[[LOAD_I:.*]] = fir.load %[[I]]#0 : !fir.ref -! CHECK: %[[LOAD_A:.*]] = fir.load %[[A]]#0 : !fir.ref +! CHECK: %[[LOAD_I:.*]] = fir.load %[[I]]#0 : !fir.ref +! CHECK: %[[LOAD_I:.*]] = fir.load %[[I]]#0 : !fir.ref +! CHECK: %[[LOAD_A:.*]] = fir.load %[[A]]#0 : !fir.ref ! CHECK: %[[CMP:.*]] = arith.cmpi eq, %[[LOAD_I]], %[[LOAD_A]] : i32 ! CHECK: cf.cond_br %[[CMP]], ^[[EARLY_RET:.*]], ^[[NO_RET:.*]] ! CHECK: ^[[EARLY_RET]]: diff --git a/flang/test/Lower/OpenACC/acc-loop.f90 b/flang/test/Lower/OpenACC/acc-loop.f90 index f9f5e8c2165d5..b3fadbc8b388b 100644 --- a/flang/test/Lower/OpenACC/acc-loop.f90 +++ b/flang/test/Lower/OpenACC/acc-loop.f90 @@ -376,8 +376,8 @@ subroutine sub1(i, j, k) ! CHECK-SAME: %[[ARG_J:.*]]: !fir.ref {fir.bindc_name = "j"} ! CHECK-SAME: %[[ARG_K:.*]]: !fir.ref {fir.bindc_name = "k"} ! CHECK: %[[DC_I:.*]]:2 = hlfir.declare %[[ARG_I]] dummy_scope %0 -! CHECK: %[[DC_J:.*]]:2 = hlfir.declare %[[ARG_J]] dummy_scope %0 -! CHECK: %[[DC_K:.*]]:2 = hlfir.declare %[[ARG_K]] dummy_scope %0 +! CHECK: %[[DC_J:.*]]:2 = hlfir.declare %[[ARG_J]] dummy_scope %0 +! CHECK: %[[DC_K:.*]]:2 = hlfir.declare %[[ARG_K]] dummy_scope %0 ! CHECK: acc.parallel combined(loop) ! CHECK: %[[P_I:.*]] = acc.private varPtr(%[[DC_I]]#0 : !fir.ref) -> !fir.ref {implicit = true, name = "i"} ! CHECK: %[[P_J:.*]] = acc.private varPtr(%[[DC_J]]#0 : !fir.ref) -> !fir.ref {implicit = true, name = "j"} diff --git a/flang/test/Lower/OpenACC/acc-private.f90 b/flang/test/Lower/OpenACC/acc-private.f90 index 10d103c84f8de..ea12da7a5a99f 100644 --- a/flang/test/Lower/OpenACC/acc-private.f90 +++ b/flang/test/Lower/OpenACC/acc-private.f90 @@ -195,8 +195,8 @@ ! CHECK-LABEL: acc.firstprivate.recipe @firstprivatization_ref_i32 : !fir.ref init { ! CHECK: ^bb0(%{{.*}}: !fir.ref): ! CHECK: %[[ALLOCA:.*]] = fir.alloca i32 -! CHECK: %[[DECLARE:.*]]:2 = hlfir.declare %[[ALLOCA]] {uniq_name = "acc.private.init"} : (!fir.ref) -> (!fir.ref, !fir.ref) -! CHECK: acc.yield %[[DECLARE]]#0 : !fir.ref +! CHECK: %[[DECLARE:.*]]:2 = hlfir.declare %[[ALLOCA]] {uniq_name = "acc.private.init"} : (!fir.ref) -> (!fir.ref, !fir.ref) +! CHECK: acc.yield %[[DECLARE]]#0 : !fir.ref ! CHECK: } copy { ! CHECK: ^bb0(%[[SRC:.*]]: !fir.ref, %[[DST:.*]]: !fir.ref): ! CHECK: %[[VALUE:.*]] = fir.load %[[SRC]] : !fir.ref @@ -223,8 +223,8 @@ ! CHECK-LABEL: acc.private.recipe @privatization_ref_i32 : !fir.ref init { ! CHECK: ^bb0(%{{.*}}: !fir.ref): ! CHECK: %[[ALLOCA:.*]] = fir.alloca i32 -! CHECK: %[[DECLARE:.*]]:2 = hlfir.declare %[[ALLOCA]] {uniq_name = "acc.private.init"} : (!fir.ref) -> (!fir.ref, !fir.ref) -! CHECK: acc.yield %[[DECLARE]]#0 : !fir.ref +! CHECK: %[[DECLARE:.*]]:2 = hlfir.declare %[[ALLOCA]] {uniq_name = "acc.private.init"} : (!fir.ref) -> (!fir.ref, !fir.ref) +! CHECK: acc.yield %[[DECLARE]]#0 : !fir.ref ! CHECK: } program acc_private diff --git a/flang/test/Lower/OpenACC/acc-routine-named.f90 b/flang/test/Lower/OpenACC/acc-routine-named.f90 index de9784a1146cc..24d47e58b6e1b 100644 --- a/flang/test/Lower/OpenACC/acc-routine-named.f90 +++ b/flang/test/Lower/OpenACC/acc-routine-named.f90 @@ -14,7 +14,7 @@ module acc_routines subroutine acc1() end subroutine -! CHECK-LABEL: func.func @_QMacc_routinesPacc1() +! CHECK-LABEL: func.func @_QMacc_routinesPacc1() ! CHECK-SAME:attributes {acc.routine_info = #acc.routine_info<[@[[r1]]]>} subroutine acc2() diff --git a/flang/test/Lower/OpenACC/acc-routine.f90 b/flang/test/Lower/OpenACC/acc-routine.f90 index 1a63b4120235c..c281ca5dfc287 100644 --- a/flang/test/Lower/OpenACC/acc-routine.f90 +++ b/flang/test/Lower/OpenACC/acc-routine.f90 @@ -127,13 +127,13 @@ subroutine acc_routine16() end subroutine subroutine acc_routine17() - !$acc routine device_type(host) worker dtype(multicore) vector + !$acc routine device_type(host) worker dtype(multicore) vector end subroutine subroutine acc_routine18() - !$acc routine device_type(host) bind(acc_routine17) dtype(multicore) bind(acc_routine16) + !$acc routine device_type(host) bind(acc_routine17) dtype(multicore) bind(acc_routine16) end subroutine subroutine acc_routine19() - !$acc routine device_type(host,default) bind(acc_routine17) dtype(multicore) bind(acc_routine16) + !$acc routine device_type(host,default) bind(acc_routine17) dtype(multicore) bind(acc_routine16) end subroutine diff --git a/flang/test/Lower/OpenACC/acc-routine02.f90 b/flang/test/Lower/OpenACC/acc-routine02.f90 index 1c15cb409e634..dd07cba4b20e3 100644 --- a/flang/test/Lower/OpenACC/acc-routine02.f90 +++ b/flang/test/Lower/OpenACC/acc-routine02.f90 @@ -17,4 +17,4 @@ program test ! CHECK-LABEL: acc.routine @acc_routine_0 func(@_QPsub1) -! CHECK: func.func @_QPsub1(%ar{{.*}}: !fir.ref> {fir.bindc_name = "a"}, %arg1: !fir.ref {fir.bindc_name = "n"}) attributes {acc.routine_info = #acc.routine_info<[@acc_routine_0]>} +! CHECK: func.func @_QPsub1(%ar{{.*}}: !fir.ref> {fir.bindc_name = "a"}, %arg1: !fir.ref {fir.bindc_name = "n"}) attributes {acc.routine_info = #acc.routine_info<[@acc_routine_0]>} diff --git a/flang/test/Lower/OpenACC/acc-routine03.f90 b/flang/test/Lower/OpenACC/acc-routine03.f90 index ddd6bda0367e4..3fc307746849f 100644 --- a/flang/test/Lower/OpenACC/acc-routine03.f90 +++ b/flang/test/Lower/OpenACC/acc-routine03.f90 @@ -20,7 +20,7 @@ subroutine sub1(a) !$acc routine worker bind(sub2) real :: a(:) end subroutine - + subroutine sub2(a) !$acc routine worker nohost real :: a(:) diff --git a/flang/test/Lower/OpenACC/acc-routine04.f90 b/flang/test/Lower/OpenACC/acc-routine04.f90 index 655e2762b9694..470440728d2f5 100644 --- a/flang/test/Lower/OpenACC/acc-routine04.f90 +++ b/flang/test/Lower/OpenACC/acc-routine04.f90 @@ -14,17 +14,17 @@ subroutine sub1(i) program test_acc_routine use dummy_mod - + !$acc routine(sub2) seq - + implicit none - + integer :: i contains subroutine sub2() end subroutine - + end program ! CHECK: acc.routine @acc_routine_1 func(@_QFPsub2) seq diff --git a/flang/test/Lower/OpenACC/acc-shutdown.f90 b/flang/test/Lower/OpenACC/acc-shutdown.f90 index 304dd4fae6db5..de6191d7f0cd2 100644 --- a/flang/test/Lower/OpenACC/acc-shutdown.f90 +++ b/flang/test/Lower/OpenACC/acc-shutdown.f90 @@ -23,9 +23,9 @@ subroutine acc_shutdown !$acc shutdown device_num(1) device_type(default, nvidia) !CHECK: [[DEVNUM:%.*]] = arith.constant 1 : i32 -!CHECK: acc.shutdown device_num([[DEVNUM]] : i32) attributes {device_types = [#acc.device_type, #acc.device_type]} +!CHECK: acc.shutdown device_num([[DEVNUM]] : i32) attributes {device_types = [#acc.device_type, #acc.device_type]} !$acc shutdown device_type(default) device_type(nvidia) -!CHECK: acc.shutdown attributes {device_types = [#acc.device_type, #acc.device_type]} +!CHECK: acc.shutdown attributes {device_types = [#acc.device_type, #acc.device_type]} end subroutine acc_shutdown diff --git a/flang/test/Lower/OpenACC/acc-terminator.f90 b/flang/test/Lower/OpenACC/acc-terminator.f90 index 53ae1a5e54675..16100f9e36cd5 100644 --- a/flang/test/Lower/OpenACC/acc-terminator.f90 +++ b/flang/test/Lower/OpenACC/acc-terminator.f90 @@ -17,7 +17,7 @@ program main !$acc data copyin(a(:,:,i),b(:,:,i),c(:,:,i)) copyout(c2(:,:,i)) !$acc host_data use_device(a(:,:,i),b(:,:,i),c(:,:,i)) - + !$acc end host_data if ( stat .ne. 0 ) then diff --git a/flang/test/Lower/OpenACC/acc-use-device.f90 b/flang/test/Lower/OpenACC/acc-use-device.f90 index 30fefdb44a2bf..4f9ed2d70b3ec 100644 --- a/flang/test/Lower/OpenACC/acc-use-device.f90 +++ b/flang/test/Lower/OpenACC/acc-use-device.f90 @@ -9,7 +9,7 @@ subroutine test() ! CHECK: %[[A0:.*]] = fir.alloca !fir.array, %{{.*}} {bindc_name = "b", uniq_name = "_QFtestEb"} ! CHECK: %[[A1:.*]] = fir.shape_shift {{.*}} : (index, index) -> !fir.shapeshift<1> ! CHECK: %[[A:.*]]:2 = hlfir.declare %[[A0]](%[[A1]]) {uniq_name = "_QFtestEb"} : (!fir.ref>, !fir.shapeshift<1>) -> (!fir.box>, !fir.ref>) - + !$acc data copy(b) ! CHECK: %[[B:.*]] = acc.copyin var(%[[A]]#0 : !fir.box>) -> !fir.box> {dataClause = #acc, name = "b"} ! CHECK: acc.data dataOperands(%[[B]] : !fir.box>) { @@ -23,7 +23,7 @@ subroutine test() ! CHECK: fir.call @_QPvadd(%[[A]]#1) fastmath : (!fir.ref>) -> () !$acc end data ! CHECK: acc.copyout accVar(%[[B]] : !fir.box>) to var(%[[A]]#0 : !fir.box>) {dataClause = #acc, name = "b"} -end +end ! Test for allocatable, pointer and assumed-shape variables appearing in use_device clause. subroutine test2(a, b, c) diff --git a/flang/test/Lower/OpenACC/locations.f90 b/flang/test/Lower/OpenACC/locations.f90 index 69873b3fbca4f..8e00721ba2b4d 100644 --- a/flang/test/Lower/OpenACC/locations.f90 +++ b/flang/test/Lower/OpenACC/locations.f90 @@ -114,7 +114,7 @@ subroutine if_clause_expr_location(arr) subroutine atomic_read_loc() integer(4) :: x integer(8) :: y - + !$acc atomic read y = x end @@ -123,10 +123,10 @@ subroutine atomic_read_loc() subroutine atomic_capture_loc() implicit none integer :: k, v, i - + k = 1 v = 0 - + !$acc atomic capture v = k k = (i + 1) * 3.14 @@ -142,13 +142,13 @@ subroutine atomic_capture_loc() subroutine atomic_update_loc() implicit none integer :: x, y, z - - !$acc atomic + + !$acc atomic y = y + 1 ! CHECK: acc.atomic.update %{{.*}} : !fir.ref { ! CHECK: ^bb0(%{{.*}}: i32 loc("{{.*}}locations.f90":142:3)): ! CHECK: } loc("{{.*}}locations.f90":142:3) - + !$acc atomic update z = x * z end subroutine @@ -183,5 +183,3 @@ subroutine data_end_locations(arr) !CHECK-SAME: loc("{{.*}}locations.f90":181:11) end subroutine end module - -