Files
TheRock/compiler/amd-llvm/flang/test/Lower/global-initialization.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

47 lines
1.4 KiB
Fortran

! RUN: bbc %s -o - | FileCheck %s
program bar
! CHECK: fir.address_of(@[[name1:.*]]my_data)
integer, save :: my_data = 1
print *, my_data
call foo()
call foo2()
call foo3()
contains
! CHECK-LABEL: func private @_QFPfoo
subroutine foo()
! CHECK: fir.address_of(@[[name2:.*foo.*my_data]])
integer, save :: my_data = 2
print *, my_data + 1
end subroutine
! CHECK-LABEL: func private @_QFPfoo2
subroutine foo2()
! CHECK: fir.address_of(@[[name3:.*foo2.*my_data]])
integer, save :: my_data
my_data = 4
print *, my_data
end subroutine
! CHECK-LABEL: func private @_QFPfoo3
subroutine foo3()
! CHECK-DAG: fir.address_of(@[[name4:.*foo3.*idata]]){{.*}}fir.array<5xi32>
! CHECK-DAG: fir.address_of(@[[name5:.*foo3.*rdata]]){{.*}}fir.array<3xf16>
! CHECK-DAG: fir.address_of(@[[name6:.*foo3.*my_data]]){{.*}}fir.array<2x4xi64>
integer*4, dimension(5), save :: idata = (/ (i*i, i=1,5) /)
integer*8, dimension(2, 10:13), save :: my_data = reshape((/1,2,3,4,5,6,7,8/), shape(my_data))
real*2, dimension(7:9), save :: rdata = (/100., 99., 98./)
print *, rdata(9)
print *, idata(3)
print *, my_data(1,11)
end subroutine
end program
! CHECK: fir.global internal @[[name1]]
! CHECK: fir.global internal @[[name2]]
! CHECK: fir.global internal @[[name3]]
! CHECK-DAG: fir.global internal @[[name4]]{{.*}}fir.array<5xi32>
! CHECK-DAG: fir.global internal @[[name5]]{{.*}}fir.array<3xf16>
! CHECK-DAG: fir.global internal @[[name6]]{{.*}}fir.array<2x4xi64>