[flang-commits] [flang] [Flang][MIF] Adding support of intrinsics with coarray argument (PR #192944)

Dan Bonachea via flang-commits flang-commits at lists.llvm.org
Thu Apr 23 20:46:02 PDT 2026


================
@@ -1,14 +1,20 @@
 ! RUN: %flang_fc1 -emit-hlfir -fcoarray %s -o - | FileCheck %s
 
 program test
-  use iso_fortran_env
-  integer :: i
+  use iso_fortran_env, only: team_type
+  integer :: i, j(2)
   type(team_type) :: team
+  integer :: a[2,*]
 
   ! CHECK: mif.this_image : () -> i32
   i = this_image()
 
   ! CHECK: mif.this_image team %[[TEAM:.*]] : ({{.*}}) -> i32
   i = this_image(TEAM=team)
 
+  ! CHECK: mif.this_image coarray %[[A:.*]] : ({{.*}}) -> !fir.box<!fir.array<?xi64>>
+  j = this_image(COARRAY=a)
+  
+  ! CHECK: mif.this_image coarray %[[A:.*]]#0 dim %[[DIM:.*]] : ({{.*}}) -> i32
+  j = this_image(COARRAY=a, DIM=1)
----------------
bonachea wrote:

Two valid cases are not covered here:
* `THIS_IMAGE (COARRAY, TEAM)`
* `THIS_IMAGE (COARRAY, DIM, TEAM)`

Please add checks to cover those cases.

https://github.com/llvm/llvm-project/pull/192944


More information about the flang-commits mailing list