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

    <tr>
        <th>Summary</th>
        <td>
            Intel asm instructions preceded by "lock" are only recognised in lower case
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          ben-cohen-xs
      </td>
    </tr>
</table>

<pre>
    Assembler instructions in Intel format are normally case insensitive in the `clang` inline assembler.  But if you use the `lock` prefix then the following instruction needs to be in lower case.  If it is in upper case then you get the error "invalid instruction mnemonic", which is not what I would expect.
```
$ clang --version
clang version 14.0.5 (Fedora 14.0.5-2.fc36)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ cat test.c
int main()
{
 // Expected/Observed: The next line compiles successfully
    asm("lock inc eax;\n");

    // Expected: The next line compiles successfully
    // Observed: "error: invalid instruction mnemonic 'INC'"
    asm("lock INC eax;\n");
    return 0;
}

$ clang -o test ./test.c -masm=intel  
./test.c:8:9: error: invalid instruction mnemonic 'INC'
    asm("lock INC eax;\n");
 ^
<inline asm>:2:2: note: instantiated into assembly here
        lock INC eax;
        ^~~~
1 error generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVEuPozgQ_jXOpQSii0fgwCGddKRcZi9zXxlTgHeNjWyTx2V--8pAT6d7NSvNRoli1-v7yvXgzsleE9Usf2X5acdnPxhbN6QjYQbS0d3tGtM-6oNzNDaKLEjtvJ2Fl0Y7kBou2pOCztiRe-CWQIejUg8Q3FEwJ-2kl9dwBj8QsCIRiuueFQlIraQm4O_hY4DX2YPs4GFmmB29eygj_g4Ok6VO3oN0DdYZpcxN6v6ZGGii1oE30CyoytzILnxigEsH0oNcyM_TtCnWiAG0J79EJmuNBYYo9ZUr2X4CGDWNRkvBEBke4TZIMYSY2ni4DdzD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