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

    <tr>
        <th>Summary</th>
        <td>
            [flang] Implement MSVC predefined macros for Windows
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          pbo-linaro
      </td>
    </tr>
</table>

<pre>
    Linaro has been working on flang support, for Windows on Arm. It is included in [official release](https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.1/LLVM-17.0.1-woa64.exe) for this platform.
The version included targets MSVC ABI, and not GNU one (available with msys2).

We have been trying to build [OpenBLAS](https://github.com/OpenMathLib/OpenBLAS) and ran into issues with CMake support.
Currently, we are working with CMake community to support flang (MSVC), see this [pull request](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8776).

As part of the feedback from CMake maintainer, it is currently difficult to identify which ABI and architecture flang is targeting. One solution, as suggested [here](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8776#note_1422606), would be to implement a set of MSVC predefined macros, like `clang` already does.
At least having `_MSC_VER` and `_M_{X64,ARM64,IX86}`, would be a good start. It would allow CMake, or any other tool, to identify easily flang configuration, without having to parse any output result.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVM1u4zYQfhr6Mogh0ZYsHXywnboIEHeBTZvdWzASRxJrilTJUVy_fUFZyaZFF0WxF9MiOYPvj4Mh6NYSbUW2F9n9AkfunN8Olbsz2qJ3i8qp6_Zx-g8dBqiILFycP2vbgrPQGLQthHEYnGchD9A4D1-0Ve4S4vnO90t4YNABtK3NqEiBtiCyvWsaXWs04MkQBhLZvZBFxzwEsdoJeRTy2GruxmpZu17IozGvb8vd4N3vVLOQx7k6CHlU7mKNQzVfcr69SzfLZJkKeXx8fD7NX3cXh_l6SX-SkOWElzsdYDDIjfP9UiT3Itn92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