<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/87514>87514</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang] Support `-dM` flag
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bcornille
</td>
</tr>
</table>
<pre>
In discussion with a customer asking what predefined macro could be used to identify the flang compiler, I found could not get the set of predefined macros out of the compiler in the same way as clang.
```
>> clang -dM -E - < /dev/null
...
#define __clang__ 1
#define __clang_literal_encoding__ "UTF-8"
#define __clang_major__ 19
#define __clang_minor__ 0
#define __clang_patchlevel__ 0
...
```
```
>> flang-new -dM -E - < /dev/null
flang-new: error: unknown argument: '-dM'
```
It would be good for this flag to be supported both so that flang is consistent with both clang and gfortran/gcc, but also so the predefined macros are discoverable by users so they can use them in their codes.
CC: @kparzysz, @mjklemm
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyElE2PuzYQxj-NuYyIjHlJcuCw3SzSHv6ntufI2AN4Y2zkl0TZT18Zsl213agSAmz_5vEw82DuvRoNYkvq30h9yngMk3VtL6wzSmvMeivv7bsBqbyI3itr4KbCBBxE9MHO6ID7izIj3CYeYHEocVAGJcxcOAvCRi2hR4geJQQLSqIJarhDmBAGzc0Iws6L0ugIe4V3GGw08hFnbIARw8p6DGCH_-zgwcZ1ITFfSqDMFsNnhBu_A_cg0l47Qk-EvpCGPq5tWL6R8m0jIJe_IH-DHEj5CoR1Eq-EdSZqvcG73ZfIdmfllg-cz6vA-QzFsyWtAjquz2iElWplCWN__tHlB8LYs6iZf1iXZI9PCWVWgj4DFh7EpPGK-pv6_pB_VePH4qytyg3e_rdAf5OkfAF0zrr0Es3F2JsB7sY4owlpjrB9Ln8Rtv9x4_cAty_3jNZKGKyDMCmfchmTl3oEH5fFuoASehsm8BZC8uFmLOVBWOOVD2jC5tuV2hrNjYRxsC44bgjrRiGSAfsYgGtvNyn8wW_c4fo72Cs63muE_p7c7fwj5A6CmzSTBvPDisqBsBL9P7zz-rpWoaKXhbvPu_9MCZCKzh8XjfMMmWxLeSyPPMO22BesaIqiZtnUUto3rGnqemgOojnQQZR836A4lkz2pdxnqmWUVbSiZdEUx4LuqmHPDpWsmChlPdQHUlGcudI7ra_zzroxU95HbA_7uqgyzXvUfj0UGFtrmexZnzLXJj7v4-hJRbXywX8rBBX0epJsEfUJft-6A6ShqdENXVuXRafbKYTFk_KFsC4VX4Up9jthZ8K6JPh45IuzHygCYd2anyesW1P8KwAA___GZ3-j">