Skip to content

asm!("asdflol" "nop"); compiles #21045

Closed
@jonasschneider

Description

@jonasschneider

It looks like the implicit concatenation syntax (like in GCC) isn't supported by rustc or maybe LLVM.
In this case, the compiler should error. (Maybe this is just a problem with the asm! macro? If it is even a macro?)

Full example: on x86_64-linux run rustc hello.rs, hello.rs:

#![feature(asm)]
fn main() {
  unsafe { asm!("asdflol" "nop"); }
}

Expected behaviour: compiler error about invalid instruction "asdflolnop", or compiler error about "invalid asm concat syntax, please give a single string"
Actual behaviour: compiles to just a NOP (afaics)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-inline-assemblyArea: Inline assembly (`asm!(…)`)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions