Skip to content

.if constant expression folding works for .s but not for inline assembly due to UseAssemblerInfoForParsing #62520

@pskocik

Description

@pskocik

Example:

.text
start:
  nop
end:
.if (end - start) == 0
.err
.endif

compiles when saved as a .s file. But when the same is put into a .c file as:

__asm(
".text\n"
"start:\n"
"  nop\n"
"end:\n"
".if (end - start) == 0\n"
".err\n"
".endif\n"
);

it fails with error: expected absolute expression. GCC succeeds with both examples. #53728 is probably related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    llvm:mcMachine (object) code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions