[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


================
@@ -0,0 +1,14 @@
+! RUN: %flang_fc1 -emit-hlfir -fcoarray %s -o - | FileCheck %s
+
+program test
+  integer :: res(3)
+  integer(kind=8) :: res2(3)
+  integer :: a[2,3:5,*]
+
+  ! CHECK: mif.coshape coarray %[[COARRAY:.*]]#0 : (!fir.ref<i32>) -> !fir.box<!fir.array<?xi64>>
+  res = coshape(a)
+
+  ! CHECK: mif.coshape coarray %[[COARRAY:.*]]#0 : (!fir.ref<i32>) -> !fir.box<!fir.array<?xi64>>
+  res2 = coshape(a)
----------------
bonachea wrote:

Suggest covering the `KIND` parameter here, or alternatively as a third invocation of `coshape`


```suggestion
  res2 = coshape(a, KIND=8)
```




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


More information about the flang-commits mailing list