Skip to content

compile-fail/asm-src-loc.rs fails on ARM when compiled without optimizations #40555

Closed
@TimNN

Description

@TimNN

(Cross) compiling this test for arm-unknown-linux-gnueabihf fails because the error span is missing. (Reproduced on nightly-2017-03-04)

#![feature(asm)]

fn main() {
    unsafe {
        asm!("nowayisthisavalidinstruction"); //~ ERROR instruction
    }
}

Output of rustc --target=arm-unknown-linux-gnueabihf -Copt-level=0:

error: <inline asm>:1:2: error: invalid instruction
        nowayisthisavalidinstruction
        ^


error: aborting due to previous error

Output of rustc --target=arm-unknown-linux-gnueabihf -Copt-level=1:

error: <inline asm>:1:2: error: invalid instruction
        nowayisthisavalidinstruction
        ^

 --> asmt.rs:5:9
  |
5 |         asm!("nowayisthisavalidinstruction"); //~ ERROR instruction
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-inline-assemblyArea: Inline assembly (`asm!(…)`)C-bugCategory: This is a bug.O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions