<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/134565>134565</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] Quadruple precision COMPLEX used in TYPE IS statement in SELECT TYPE construct is not executed correctly
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ohno-fj
</td>
</tr>
</table>
<pre>
```
Version of flang : 21.0.0(06cb7b1e14a117e8fe19b72689c8616c772c0807)/AArch64
```
As in the attached program, `Quadruple precision COMPLEX` used in `TYPE IS statement` in `SELECT TYPE construct` is not executed correctly.
The above program is `sngg956k_42.f90`.
Since a simple program that outputs a variable of `Quadruple Precision COMPLEX` can be executed, there should be no problem to use `Quadruple Precision COMPLEX`.
When the program is modified as follows, it executes correctly.
- Change `Quadruple precision COMPLEX` to `Double precision COMPLEX`, or
The above program is `sngg956k_43.f90`.
- Change `Quadruple precision COMPLEX` to `Quadruple precision REAL`
The above program is `sngg956k_44.f90`.
The following are the test program, Flang, Gfortran and ifx compilation/execution result.
sngg956k_42.f90:
```fortran
program main
class(*),allocatable :: obj
allocate(complex(16)::obj)
k=0
select type(p=>obj)
type is(complex(16))
p=(2,3)
k=1
write(6,*) "in select type construct"
end select
write(6,*) "k = ", k
end program main
```
```
$ flang sngg956k_42.f90; ./a.out
k = 0
$
```
```
$ gfortran sngg956k_42.f90; ./a.out
in select type construct
k = 1
$
```
```
$ ifx sngg956k_42.f90; ./a.out
in select type construct
k = 1
$
```
sngg956k_43.f90:
```fortran
program main
class(*),allocatable :: obj
allocate(complex(8)::obj)
k=0
select type(p=>obj)
type is(complex(8))
p=(2,3)
k=1
write(6,*) "in select type construct"
end select
write(6,*) "k = ", k
end program main
```
```
$ flang sngg956k_43.f90; ./a.out
in select type construct
k = 1
$
```
sngg956k_44.f90:
```fortran
program main
class(*),allocatable :: obj
allocate(real(16)::obj)
k=0
select type(p=>obj)
type is(real(16))
p=(2,3)
k=1
write(6,*) "in select type construct"
end select
write(6,*) "k = ", k
end program main
```
```
$ flang sngg956k_44.f90; ./a.out
in select type construct
k = 1
$
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzcVltvrDYQ_jXel1FWZmC5PPDA2UtVKVXTJurlqTIwgBMvXtkmJ_n3lYGkJCdp0p7oPJwo0gJz--abzzDCWtn2RDnbfGKb3UoMrtMm112vz5rrVanr-5zFfP7nxW9krNQ96AYaJfoWWFgABmu-5gxTHldlUgYURCIIEkobCrIywTjNqjQO4ipJsOIpTxhmDA9FYaoujhgvlhUKC7IH1xEI50TVUQ0no1sjjgy3wGL-yyBqM5wUwclQJUc4259_ujjf_8FiDoOl2mdgMb_682IPP16CdcLRkXrn7ZPpcn--317B6FHp3jozVJPZQq8d0B1Vg6MaKm0MVU7drwEYL648rlLf0gMoH8Bibvu2zTbxzV8RrpvMt7L2ffHiUvYVgQArjxPkKcp1woEe3GlwFgTcCiNFqcjz-qTFi5darEQPJT1i9Ly4jgyB7fSgam_rtS9VKjqC056Tt9POgH_vaKJ_0eBR17KRVIOw0Gil9Gfri8pHnuyCJ8aLM9h2om_pHeNy2jvt9FC-4uELaTOSD_A2_eGC_v8M4yWnX_fFufd4L4Do6fxnzUysyb4FYWik15F1S2Uf_HHyFz802jgjehB9DbK5g0ofT1IJJ3XP8DAx7pEZsoNyc53nAgyL5bmaUzJePMA-CtmPHVVKWMswZViMx3IrlNKVcKMcfZqwAF1ej76ziRimHpSiO4ZpEPu40dH7YTa63rBwx8crS4oqB-7-5ONOLNyxcL_w9AaQ9oWcswMAjFGYIsNtuHjsiwQPN5-NHJHFDLdTM8AQZb8EsDjriGMg9fXsMN6-nOQGWLjzF34-N4wXPuoZk8t32PNbjOa35RdT-gRrhgex1sNYfyoEc9DbWdsHrbyV-FUaHosG763pJfn15RZ_r1Z-fqrfq-mvlnT68YpOv3dBh_9XCO8Yf_Qtxm9I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