<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/141365>141365</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[CIR] Upstream ComplexType support
</td>
</tr>
<tr>
<th>Labels</th>
<td>
ClangIR
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
AmrDeveloper
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
AmrDeveloper
</td>
</tr>
</table>
<pre>
Overview
Upstream, the basic support for Complex types. The initial change should add support for declaring and initialising global variables that are a Complex of existing scalar types. Follow-up patches can add support for local variables and operations.
Suggested minimal test case
```cpp
int _Complex ci1;
int _Complex ci2 = {1, 2};
double _Complex cd1
double _Complex cd2 = {1.0, 2.0};
```
Existing incubator tests:
- clang/test/CIR/CodeGen/complex.c
- clang/test/CIR/CodeGen/complex-cast.c
- clang/test/CIR/CodeGen/complex-arithmetic.c
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUk8FunDAQhp_GXEaLjIElHDhsdkvVU6U2PVeDPQuuDLZss0nevvJuaBKll0gIpOGff74ZezAEPS5EHavvmRCH2Z_oQsY68kwIVp8yXONkfff2TzZY9dx9v5C_aHpk_MD44ZcL0RPOTBwhTgQDBi0hrM5ZH-FsPRzt7Aw9QXx2FHJ4mAj0oqNGA3LCZSQIk12NAlTqXaIiadDrZQRc1JajQwqMxg5o4IJe42AoQJwwAnoC_FfPnoGedIhJHyQa9BtCb42xj7vVgcMoJwogcflQ3lj5rkSCSFPAqO0S8lv7P9dxpBBJwawXPaOBSCGCxEA3Advz2yOdY_yglwi_N0KpC1bef4wKYOUJWHNfpKkK1pxuMsYPyq6DoTdiVfw3-mqR86tJzl9tNqSb5ZdtSHqR64DR-msPgZWHm2AH0uAyMtGnOBP98duP9LaKvtLCRC9vZXP5CfFOYoify0Cv4zRT1DKXmepK1ZYtZtQVTXVXFFXBy2zq2rtG1tjcKanqs-TyLNVATYnUFO0wVG2mO8FFzWtRFW1R8zJvqGoHFLSv9nVb1sQqTjNqkxtzmXPrx0yHsFJXVEW5rzODA5nwsjfHRJ5wryvju5SyG9YxsIobHWJ4NYk6muu6pfbqE2yLs93Xh2dH2_3LVm-6KUZ3PQTRM9GPOk7rkEs7M9En05fPznn7h2Sa2xUzMNG_kF468TcAAP__CgZFqg">