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

    <tr>
        <th>Summary</th>
        <td>
            [flang][debug] Wrong signature for functions with complex return type.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          abidh
      </td>
    </tr>
</table>

<pre>
    See the following example. The type of the `fn` as shown by GDB is wrong. It shows integer as return type.

```
complex function fn(a)
 complex, intent(in) :: a
    fn = a
end function

program function_calls
    implicit none
    interface
        complex function fn(a)
            complex, intent(in) :: a
        end function
    end interface
    complex :: b, c
    c = fn(b)
 print *, c
end program
```

```
(gdb) ptype fn
type = integer (complex)
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU02PmzAQ_TXDZbQI7PB14JBtlKrnVuqxMjAGV46NbLPZ_feVWZIgNVJVCwGeGb95M-MnvFejIWqheAXGRKeGCRiD4pSIJUzWtasp6ezw0X4nwjARSqu1vSozIr2Ly6wpxR8TYfiYCa1cQ6DMpIEyQ-HRT_ZqsPvAr6dXVB6vzpoxxW9h9XhUJtBILoY6CoszK1IK2Qmy4_Yus-1Zt72NWd9RLqYPyhqUBlgtgDWfftwCgH1Z0U0AVisDrEHgR-BHFFsgIkqDwE83C5nhDrtnMDs7OnG5-371Qmv_QFGXWateBTTW0M5sAjkp-p0prn8WsFv_U0tcf1dwsz4hcyOyQXUxS79zr61ZyXUPcrNTJiCw4y464m89ejqy50ZWj0MExnm9PHIjvG5i5tvVAFbf29A8hUqGlg8Nb0RCbV6xknNesCqZ2r4SFWdVLcqqq0Rf5NTLQdTVYeBSCk6JalnGDlmTH_IqK1iVlsTzspCDKKqy54cGDhldhNKp1m-X1LoxUd4v1OZZXeV5okVH2m8CklqYcROQa-OBl24ZPRwyrXzwD4iggl5V93miOEHxOlC3xF_8GRWCUZkiLC4Kzt1H6vGqwnQf3F4xyeJ0O4Uw-zhOdgZ2HlWYli7t7QXYOSbfPi-zs7-pD8DOazEe2Hmr561lfwIAAP__dJs2mQ">