File tree Expand file tree Collapse file tree 2 files changed +33
-33
lines changed
offload/test/offloading/fortran Expand file tree Collapse file tree 2 files changed +33
-33
lines changed Original file line number Diff line number Diff line change 22
33module mod
44contains
5- subroutine foo ( dt , switch )
6- implicit none
7- real (4 ), dimension (:), INTENT ( INOUT ) :: dt
8- logical , INTENT ( IN ) :: switch
9- integer :: dim, idx
5+ subroutine foo (dt , switch )
6+ implicit none
7+ real (4 ), dimension (:), intent ( inout ) :: dt
8+ logical , intent ( in ) :: switch
9+ integer :: dim, idx
1010
11- if ( switch ) then
11+ if (switch) then
1212! $omp target teams distribute parallel do
13- do idx = 1 , 100
13+ do idx = 1 , 100
1414 dt(idx) = 20
15- end do
16- else
15+ end do
16+ else
1717! $omp target teams distribute parallel do
18- do idx = 1 , 100
18+ do idx = 1 , 100
1919 dt(idx) = 30
20- end do
21- end if
22- end subroutine foo
20+ end do
21+ end if
22+ end subroutine foo
2323end module
2424
2525! CHECK-LABEL: func.func @{{.*}}(
Original file line number Diff line number Diff line change 88! RUN: %libomptarget-compile-fortran-run-and-check-generic
99module reproducer_mod
1010contains
11- subroutine branching_target_call ( dt , switch )
11+ subroutine branching_target_call (dt , switch )
1212 implicit none
13- real (4 ), dimension (:), INTENT ( INOUT ) :: dt
14- logical , INTENT ( IN ) :: switch
13+ real (4 ), dimension (:), intent ( inout ) :: dt
14+ logical , intent ( in ) :: switch
1515 integer :: dim, idx
1616
1717 dim = size (dt)
18- if ( switch ) then
18+ if (switch) then
1919! $omp target teams distribute parallel do
20- do idx = 1 , dim
21- dt(idx) = 20
22- end do
20+ do idx = 1 , dim
21+ dt(idx) = 20
22+ end do
2323 else
2424! $omp target teams distribute parallel do
25- do idx = 1 , dim
26- dt(idx) = 30
27- end do
25+ do idx = 1 , dim
26+ dt(idx) = 30
27+ end do
2828 end if
29- end subroutine branching_target_call
29+ end subroutine branching_target_call
3030end module reproducer_mod
3131
3232program reproducer
33- use reproducer_mod
34- implicit none
35- real (4 ), dimension (:), allocatable :: dt
36- integer :: n = 21312
37- integer :: i
33+ use reproducer_mod
34+ implicit none
35+ real (4 ), dimension (:), allocatable :: dt
36+ integer :: n = 21312
37+ integer :: i
3838
39- allocate (dt(n))
40- call branching_target_call(dt, .FALSE. )
41- call branching_target_call(dt, .TRUE. )
42- print * , " PASSED"
39+ allocate (dt(n))
40+ call branching_target_call(dt, .FALSE. )
41+ call branching_target_call(dt, .TRUE. )
42+ print * , " PASSED"
4343end program reproducer
4444
4545! CHECK: PASSED
You can’t perform that action at this time.
0 commit comments