<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59400>59400</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Could Clang/LLVM warn about missing clobber declarations in extended inline asm?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
llvm:asmparser,
clang:diagnostics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
zmodem
</td>
</tr>
</table>
<pre>
Consider:
```
int f(int in) {
int out;
asm("movl %1, %%eax;"
"movl %%eax, %0;"
"movl $42, %%ebx;"
:"=r"(out) // output
:"r"(in) // input
:"%eax" // clobbered register
);
return out;
}
```
The inline asm block is clobbering EBX without declaring it, which means the function fails to preserve this callee-saved register.
Since this will be processed by llvm's internal assembler, would it be technically possible to emit a warning about the missing clobber?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U02PozgQ_TXmUuoIbAhw4JCPzan3tKvVXg0UUDPGjlwm6Z5fPzJJNOme1kSRSym_Kr_3qqKZabSIjSj2ojgmegmT882P2fU4J63r35uDs0w9eqF2Ij2K9HFu0_t3_Uk2wCBkFSNZIWsQ5f52BRCTbglC7Z87AGiehayElLO7GBCyyIQ8xChkgfot4qV8gOPnCXqH3PDpn6B5Lp_atl-1VbuYUUcfg6wiV1k_-pyEPEX65yX8XnSvuEmGDyVkv6x4EJfwCd8Z17bosQePI3FA_1FPLdQe4JHzGBZvP9paHr-cze38d0Iga8hi9B1a47rvQPx4luwIf-3_hyuFyS0BeuyMXrMUon3XiboJZtSWIUwIw2K7QM7CoMkwBAdnj4z-ghCm2FYbg_jC-vIkaPNM6B-y3R18JWOgRTh71yEz9tC-gzGXWciS4_qgt9qAZsa5NehXQm4xPVCIdQG7yVJ88h3Ojplag5ESzhRAw1V7G5XoNiqL7Gdijpm7eKFOSd-ovla1TrDJtmVaZGqb5cnUZHpIK52ptkRZVsW2qnqdqr4b6qKsyrRIqJGplJlMq6xQSuUbOQxlm1VFrcohLyst8hRnTWYTFW2cHxNiXrAp6jxNE6NbNLz-AaVcNaud5vmsPeNtuw5Cys5oOwq160mP1nGgjuNdcUx8E4te2mVkkaeGOPCvhwIFg81hteqwtpCn19f__l4tufvxyYv75HUcbvQe8C2g7bF_2p7o1-JNM4Vw5nWt4waPFKal3XRuFvJ0m94aXs7efcMuCHlahbOQp1X7zwAAAP__JiNV6w">