Files
TheRock/compiler/amd-llvm/flang/test/Lower/do-while-to-scf-while.f90
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

105 lines
2.0 KiB
Fortran

! RUN: bbc -emit-hlfir -lower-do-while-to-scf-while %s -o - | FileCheck %s
! CHECK-LABEL: func.func @_QPsimple_do_while()
! CHECK: scf.while
! CHECK: scf.condition
! CHECK: scf.yield
subroutine simple_do_while()
implicit none
integer :: i
i = 1
do while (i <= 10)
print *, "i =", i
i = i + 1
end do
end subroutine simple_do_while
! CHECK-LABEL: func.func @_QPdo_while_with_exit()
! CHECK-NOT: scf.while
! CHECK: cf.cond_br
subroutine do_while_with_exit()
implicit none
integer :: i
i = 1
do while (i <= 10)
if (i == 5) exit
i = i + 1
end do
end subroutine do_while_with_exit
! CHECK-LABEL: func.func @_QPnested_do_while()
! CHECK: scf.while
! CHECK: scf.while
subroutine nested_do_while()
implicit none
integer :: i, j
i = 1
do while (i <= 3)
j = 1
do while (j <= 2)
j = j + 1
end do
i = i + 1
end do
end subroutine nested_do_while
! CHECK-LABEL: func.func @_QPdo_while_goto_internal_forward()
! CHECK: scf.while
subroutine do_while_goto_internal_forward()
implicit none
integer :: i, sum
i = 0
sum = 0
do while (i < 10)
i = i + 1
if (mod(i, 2) == 0) goto 100
sum = sum + i
100 continue
end do
print *, "sum=", sum
end subroutine do_while_goto_internal_forward
! CHECK-LABEL: func.func @_QPdo_while_goto_internal_backedge()
! CHECK-NOT: scf.while
! CHECK: cf.cond_br
! CHECK: cf.br
subroutine do_while_goto_internal_backedge()
implicit none
integer :: i, sum
i = 0
sum = 0
do while (i < 5)
i = i + 1
10 continue
sum = sum + 1
if (sum < 3) goto 10
end do
print *, "sum=", sum
end subroutine do_while_goto_internal_backedge
! CHECK-LABEL: func.func @_QPtest_after_unstructured(
! CHECK: scf.while
! CHECK-NOT: cf.br
! CHECK: return
subroutine test_after_unstructured(cdt, switch)
logical :: cdt, eval
integer :: switch, i = 1
if (cdt) then
select case (switch)
case (0)
call print1()
end select
end if
do while(eval(i))
call incr(i)
end do
end subroutine