<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64032>64032</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [flang] [hlfir] Compilation Error (gfortran/regression/char_length_8.f90)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          k-arrows
      </td>
    </tr>
</table>

<pre>
    Consider the following program (reduced from https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/char_length_8.f90):
```console
$ cat test.f90
  CHARACTER(LEN=3), DIMENSION(3,3) :: W
  integer :: ctr = 0
  call test_transpose
  if (ctr .ne. 1) STOP 1
contains
 subroutine test_transpose
    W(:, :)="abc"
    if (any (TRANSPOSE(W(:,:)(1:2)) .ne. "ab")) STOP 2
    ctr = ctr + 1
  end subroutine
END
```

I got the following error at the compilation:
```console
$ flang-new -flang-experimental-hlfir test.f90
error: loc("/tmp/test.f90":7:5): 'hlfir.transpose' op input and output arrays should have the same element type
error: verification of lowering to FIR failed
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVNFu6zYPfhr5hkhgU3HiXPgiTWL8Bf6lB22Bc1nINm1rkyVDktv17QfJTXMQYNgGBBLFkB_JjzSFc7LXRCXLH1h-SsTsB2PLP1bCWvPhktq0n-XRaCdbsuAHgs4oZT6k7mGyprdiBIaFpXZuqIXOmhEG7yfH-IFhxbDqpR_met2YkWGl1Pv1WnlyfuVm6YlhVStTM6xGITXDqjLWWxGkvvsWLfWWnJMmPJpB2DdFuvfDW7Hu9inDfQiZnlh6YNt0-TVGO6PoS4sbaISHEDd6RC3A8X-H58Px9fzMsPj_-cL4iQcwPMLp8bfz5eXx6cKw4AyPQQ8hCj_Az6u71J56sld944N4gm_4RigVY76FOtxkHH27doG74LHWtIYswL-8Pv2AbLFojPZCavdl7-bamtlLTX-DB_CTYRGZP8Z8AicnhijqhiHezJbAQn-G6_X5cHn58fRyZljc_L_cscgYP2AU90uaES_ALbqY8C_YVwLijQ_XWgBIt7-UsGjPl9Ndy76e8XyE3vi7oSNrjQWxqBszTlIJH2bin5vfKaH7laYPWC0i_TmRlSNpL9RqUJ20d8MRg4WuKtMEZkLRlR-ncF4NERk_7Bg_5MsIAsNdxFrf-oM7MBNIPc0ehG7BzD6K1opPB24ws2phEO8Uq3JiJCBFITHwnxPdJfNOVnayiWWD6UCZD7KBG2-genyGTkhF7R0bSVvyds_3IqEy2-7TFPfZJkuGMt-nTYbNtuU1Ftui7tpW5DnH3Q637Q43iSwxRZ7uEDPkiNl6R8UmyzjPt3yzz9uUbVIahVTr8Fmvje0T6dxM5XaTckyUqEm5uF8QA_nxz0BbfkpsGVdBPfeObVIlnXc3FC-9iospdovlJ2D5Q6Q2yMdb7-Ech4Jh8V_WRTJbVf7LXTVZ8zs1nmEVs3cMq1jdXwEAAP__YwyTqQ">