<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Clang's assembler doesn't ignore extraneous "#" characters in ARM inline assembly."
   href="http://llvm.org/bugs/show_bug.cgi?id=20117">20117</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang's assembler doesn't ignore extraneous "#" characters in ARM inline assembly.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jacob.bramley@arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm using Clang as packaged by Ubuntu: Ubuntu clang version 3.5-1ubuntu1
(trunk) (based on LLVM 3.5)
This doesn't seem to agree with the available options in the 'version' field.

----

Consider the following test function:


int test(void) {
  int out;
  asm("  ldr %0, =%1\n" : "=r" (out) : "i" (0x000f0002));
  return out;
}


The instruction generated by the inline assembly is "ldr r0, =#983042", since
"i" constraints get a leading hash character by default. The GNU assembler
ignores this character, but Clang does not:


test.c:4:7: error: unknown token in expression
  asm("  ldr %0, =%1\n" : "=r" (out) : "i" (0x000f0002));
      ^
<inline asm>:1:13: note: instantiated into assembly here
          ldr r0, =#983042
                   ^
1 error generated.


GCC has an (undocumented) substitution predicate which causes the hash
character to be omitted ("ldr %0, =%c1"), and Clang appears to support this,
but this still represents an incompatibility with GCC and therefore might be
considered a bug.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>