Clang error: empty symbolic operand name in inline assembly string (err_asm_empty_symbolic_operand_name)
Jump to navigation
Jump to search
Text | error: empty symbolic operand name in inline assembly string |
---|---|
Type | Error |
Category | Inline Assembly Issue |
Internal Id | err_asm_empty_symbolic_operand_name |
Internal Message | empty symbolic operand name in inline assembly string
|
Regular Expression | (?:error|fatal error)\: empty symbolic operand name in inline assembly string
|
First Commit | 2009-03-14 5a8987ca5113 Update tablegen diagnostic files to be in sync with the def files. |
Description
Example
Flags | -xc -O2
|
|
---|---|---|
Source |
int f() {
int v = 1;
__asm__ volatile("mov %0, %%eax" : : "r"(v) : "%eax"); // Inline assembly
__asm__ volatile("mov %%eax, %[]" : : : ); // Empty symbolic operand
return 0;
}
| |
Compiler Output |
<source>:4:33: error: empty symbolic operand name in inline assembly string |
Clang Internals (17.0.6)
Git Commit Message
Update tablegen diagnostic files to be in sync with the def files. llvm-svn: 67004
Used in Clang Sources
This section lists all occurrences of the diagnostic within the Clang's codebase. For each occurrence, an auto-extracted snipped from the source code is listed including key elements like control structures, functions, or classes. It should illustrate the conditions under which the diagnostic is activated.
clang/lib/AST/Stmt.cpp (line 749)
/// AnalyzeAsmString - Analyze the asm string of the current asm, decomposing
/// it into pieces. If the asm string is erroneous, emit errors and return
/// true, otherwise return false.
unsigned GCCAsmStmt::AnalyzeAsmString(SmallVectorImpl<AsmStringPiece> &Pieces, const ASTContext &C, unsigned &DiagOffs) const {
// ...
while (true) {
// ...
// Handle operands that have asmSymbolicName (e.g., %x[foo]).
if (EscapedChar == '[') {
// ...
if (NameEnd == CurPtr)
return diag::err_asm_empty_symbolic_operand_name;
Triggered in Clang Tests
This section lists all internal Clang test cases that trigger the diagnostic.
clang/test/Sema/asm.c
- clang/test/Sema/asm.c:81:10: error: empty symbolic operand name in inline assembly string