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

    <tr>
        <th>Summary</th>
        <td>
            The compiler flags `-M` and `-MM` do not work if an object file is emitted.`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          jeremyong
      </td>
    </tr>
</table>

<pre>
    Given any C++ file, compiling like so:

```
clang++ -M -o test.cpp.o -c test.cpp
```

should result in an object file on disk and the dependencies of `test.cpp` emitted to `stdout` based on the documentation:

> -M, --dependencies
> Like -MD, but also implies -E and writes to stdout by default

I have not verified on Linux/Mac (only Windows), but on windows, both `-M` and `-MM` are instead silently ignored, and no output is emitted.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0kk-PszgMxj9NuFhUIZSWHjjs_OlqpeltpT0HYiAzIUbEabff_lVoOzMava-EghzH9s-PHh2CHTxiI6onUb1kOvJIS_OOC05X8kPWkrk2f9szetD-Cs9CPQn1BL11KNQzdDTN1lk_gLMfCIFE-ZeQL0I-zp28f2vYOe2He4v8BDkBY-BNN88bgrz7jH5bfDvDSNEZWDBEx2ATFlD7jh2vUEAejA0foL0BHhEMzugN-s5iAOpB7OTnlJ0EnCwzGmBKmcCGIqf7Vgc0qdnag7o4oWfNlvzPDctXyE9Jizz_Pusr-5aUyU8v6U0bGbQLBHaaXSLKX1fSy2IZQ6K4IUB7BYO9jo6_D_sHRn1G8MRwxsX29sb4Zn38X6jjSXcgVE3eXeE_6w1dglCHx1zycHlcPkNLPKaV81NaNzGswS1aEKwPjNpAsA49uyvYwdOCJtWm156AIs-RwYaHipvMNKU5lAedYVPs1UFtq6qosrGpdmqvC1NXrdSyV6rtq50s96avi33bKsxso6TaFrKo5aGqy2oj9dbU-329Kw5lf-hLsZU4aes2zp2nDS1DZkOI2BSFqvdF5nSLLqw2VsrjBdasUCq5emlSUd7GIYitdDZw-GrDlh02_454NzMu0Ds9hD-JY2jV_0LLB9j-p_2-iSF2MouLa0bmOSTXqKNQx8HyGNtNR5NQxwRx_-XzQqmNUMcVPQh1vO92btSvAAAA__-ljyUc">