File: rmake.rs

package info (click to toggle)
rustc 1.90.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid
  • size: 925,928 kB
  • sloc: xml: 158,148; javascript: 19,781; sh: 19,174; python: 15,732; ansic: 13,096; cpp: 7,181; asm: 4,376; makefile: 697; lisp: 176; sql: 15
file content (16 lines) | stat: -rw-r--r-- 704 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// target-cpu is a codegen flag that generates code for the processor of the host machine
// running the compilation. This test is a sanity test that this flag does not cause any
// warnings when used, and that binaries produced by it can also be successfully executed.
// See https://github.com/rust-lang/rust/pull/23238

//@ ignore-cross-compile target-cpu=native doesn't work well when cross compiling

use run_make_support::{run, rustc};

fn main() {
    let out = rustc().input("foo.rs").arg("-Ctarget-cpu=native").run().stderr_utf8();
    run("foo");
    // There should be zero warnings emitted - the bug would cause "unknown CPU `native`"
    // to be printed out.
    assert!(out.is_empty());
}