rewrite emit test

This commit is contained in:
Oneirical 2024-05-21 14:53:50 -04:00
parent 7feb191f18
commit 1e3e3df81e
2 changed files with 19 additions and 22 deletions

View File

@ -1,22 +0,0 @@
# ignore-cross-compile
include ../tools.mk
all:
$(RUSTC) -Copt-level=0 --emit=llvm-bc,llvm-ir,asm,obj,link test-24876.rs
$(RUSTC) -Copt-level=1 --emit=llvm-bc,llvm-ir,asm,obj,link test-24876.rs
$(RUSTC) -Copt-level=2 --emit=llvm-bc,llvm-ir,asm,obj,link test-24876.rs
$(RUSTC) -Copt-level=3 --emit=llvm-bc,llvm-ir,asm,obj,link test-24876.rs
$(RUSTC) -Copt-level=s --emit=llvm-bc,llvm-ir,asm,obj,link test-24876.rs
$(RUSTC) -Copt-level=z --emit=llvm-bc,llvm-ir,asm,obj,link test-24876.rs
$(RUSTC) -Copt-level=0 --emit=llvm-bc,llvm-ir,asm,obj,link test-26235.rs
$(call RUN,test-26235) || exit 1
$(RUSTC) -Copt-level=1 --emit=llvm-bc,llvm-ir,asm,obj,link test-26235.rs
$(call RUN,test-26235) || exit 1
$(RUSTC) -Copt-level=2 --emit=llvm-bc,llvm-ir,asm,obj,link test-26235.rs
$(call RUN,test-26235) || exit 1
$(RUSTC) -Copt-level=3 --emit=llvm-bc,llvm-ir,asm,obj,link test-26235.rs
$(call RUN,test-26235) || exit 1
$(RUSTC) -Copt-level=s --emit=llvm-bc,llvm-ir,asm,obj,link test-26235.rs
$(call RUN,test-26235) || exit 1
$(RUSTC) -Copt-level=z --emit=llvm-bc,llvm-ir,asm,obj,link test-26235.rs
$(call RUN,test-26235) || exit 1

View File

@ -0,0 +1,19 @@
// A bug from 2015 would cause errors when emitting multiple types of files
// in the same rustc call. A fix was created in #30452. This test checks that
// the fix did not accidentally break compilation.
// See https://github.com/rust-lang/rust/pull/30452
//@ ignore-cross-compile
use run_make_support::{run, rustc};
fn main() {
let opt_levels = ["0", "1", "2", "3", "s", "z"];
for level in opt_levels {
rustc().opt_level(level).emit("llvm-bc,llvm-ir,asm,obj,link").input("test-24876.rs");
}
for level in opt_levels {
rustc().opt_level(level).emit("llvm-bc,llvm-ir,asm,obj,link").input("test-26235.rs");
run("test-26235");
}
}