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

    <tr>
        <th>Summary</th>
        <td>
            \@ in assembler macros mistreated
        </td>
    </tr>

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

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

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

<pre>
    Somewhat similar to an issue with macros in general a few years back (meanwhile fixed), the expansion of \@ may not re-start counting from zero for each asm() using it. The following compiles/assembles fine with gcc/gas, but fails to compile with clang unless disabling the integrated assembler.

asm(".macro m imm\n"
    ".Lm\\@:\n"
    "nopl \\imm(%eax)\n"
    ".endm");

void foo(void)
{
    asm("m 1");
    asm("m 2");
}

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtUk1zozAM_TVw0ZRxTCDJgUPTTE972_0DAgS49UfGNk2yv35lSNqdTjmAkeSn957Uuv7W_HaGLhNGCMoojR6iA7SgQpgJLipOYLDzLoCyMJIljxoQBrrAjdAHaLF7h0zuDaG9TEoTDOpKfSYPmXyBOBHQ9Yw2KGfBDZBVL9lWMOYNrIvg6SlE9BE6N9uo7AiDdwb-kncwOA-E3QQYDDdgRJhDKlGxgD8MPDit3SVFOmfO3Dpk8hVDINPymXnYu4Kx6zgzYkiU2jnCgEqHpPR-cS3rNDLWbPlygF4FbHUCTxqUjTR6jNTDo4EvMnHKxPP6fnCUxWIXGFDGsFjLobUC-En5Xym82pCVzz-VWHfWsBYlkARbEV6TpT8Bku1NCnK6PP7P6cOpnk1yjJCOqWDN7o5fCJ_EDWy-oXxLy-9Ndqf1kPdN2R_KA-ZRRU3Nfca8MJ9ePZbIqBA9JR_z2etmivEckgvyNQ2IhzC3Bc-Ef7T-eHyezt69URf5d1nLNOZquy_LfGrqSpJoS1GWuxJRHIaBql1HQgw7qqtDnWtsSQfmdEzO8touEElKdcpVI4WUYrsRYlfJ7b6gWuDQMxZtatzXA-sgw8tSJB6F82Pum4VSO4-Bk5r1hK8k61WjJVraMT7OcXK-eWtp1qqb8qV3s3D_B7oXElo">