<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/108564>108564</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang][debug] Incorrect type for subroutines
</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>
It seems that flang generates the wrong debug information for type of subroutine. If subroutine has an argument then that is taken as return type. The following example describes the issue:
```
subroutine sub (r)
real r
print *, r
end subroutine
program main
call sub(3.14)
end program main
```
This is what GDB shows for the type of the sub. Notice the return type of real.
```
(gdb) whatis sub
type = real (real)
```
While it should have been
```
(gdb) whatis sub
type = void (real)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykU8tu5CoQ_Rq8KcXC-BF74UVyW32VzV1FumswZZsZDC0e3ZO_H4GdpDWvzUgWpori1KlDFfdeLQZxJO0zYYwLJVfCGGlPBY9htW7MrkJY-Ta-BPCIm4ew8gCz5maBBQ06HjA5EW7OmgUkiriAMrN1Gw_KGpitg_B2QbAz-CicjUEZLOHl3oSVe-AGuFvihiYkRLPnUh4C_4oGuAeHITqT4Up4XRFmq7W9KbMAfuPbRSNI9JNT4iClvI9I6idCT4S-rx09vmzekfBRAGG9I2zYzwAccg3u3bo4ZQIQ9kTYP-9eNPKukPtEF2cXxzfYuDIHwsS1TtGE9XVZNR-JEsjP4T8w3dfXVfkkyi2J8-_pGfxqb36XecUPqdPeR1HCfzaoCbN9J18KSbWVf1CGsH6RgrAh51I-E88nGYHUp12eJBly_VHML2n_vyqNoEKiG7WElV8RBKKBv2NwtUr-nkEhx1oO9cALHKtH1rG6Y4-0WMe67at5lqyvO0EFFW0jh7rvJCLtJHa8UCOjrKFDVVcNbWpaDm3X1qyppkfBq54y0lDcuNKl1tettG4pcrONFe3brik0F6j9MVt5Xo7ZcmO68CDi4klDtfLBf0IEFXQeyP1GeyLtcx4p0p7gxUzWOZzC_oLpxT8bzxfR6XEN4eJTv7MzYedFhTWKcrIbYeeU4_g9XJz9glMg7Jw5e8LOB-3ryL4HAAD__z6hQiE">