diff --git a/tests/run-make/msvc-opt-minsize/Makefile b/tests/run-make/msvc-opt-minsize/Makefile deleted file mode 100644 index 32e6e28018f..00000000000 --- a/tests/run-make/msvc-opt-minsize/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -all: - $(RUSTC) foo.rs -Copt-level=z 2>&1 - $(call RUN,foo) diff --git a/tests/run-make/msvc-opt-minsize/foo.rs b/tests/run-make/msvc-opt-minsize/foo.rs deleted file mode 100644 index 3f5496c08ee..00000000000 --- a/tests/run-make/msvc-opt-minsize/foo.rs +++ /dev/null @@ -1,19 +0,0 @@ -#![feature(test)] -extern crate test; - -fn foo(x: i32, y: i32) -> i64 { - (x + y) as i64 -} - -#[inline(never)] -fn bar() { - let _f = Box::new(0); - // This call used to trigger an LLVM bug in opt-level z where the base - // pointer gets corrupted, see issue #45034 - let y: fn(i32, i32) -> i64 = test::black_box(foo); - test::black_box(y(1, 2)); -} - -fn main() { - bar(); -} diff --git a/tests/ui/windows-subsystem/console.rs b/tests/ui/windows/console.rs similarity index 100% rename from tests/ui/windows-subsystem/console.rs rename to tests/ui/windows/console.rs diff --git a/tests/ui/windows/msvc-opt-minsize.rs b/tests/ui/windows/msvc-opt-minsize.rs new file mode 100644 index 00000000000..c1be168a05d --- /dev/null +++ b/tests/ui/windows/msvc-opt-minsize.rs @@ -0,0 +1,31 @@ +// A previously outdated version of LLVM caused compilation failures on Windows +// specifically with optimization level `z`. After the update to a more recent LLVM +// version, this test checks that compilation and execution both succeed. +// See https://github.com/rust-lang/rust/issues/45034 + +//@ ignore-cross-compile +// Reason: the compiled binary is executed +//@ only-windows +// Reason: the observed bug only occurs on Windows +//@ run-pass +//@ compile-flags: -C opt-level=z + +#![feature(test)] +extern crate test; + +fn foo(x: i32, y: i32) -> i64 { + (x + y) as i64 +} + +#[inline(never)] +fn bar() { + let _f = Box::new(0); + // This call used to trigger an LLVM bug in opt-level z where the base + // pointer gets corrupted, see issue #45034 + let y: fn(i32, i32) -> i64 = test::black_box(foo); + test::black_box(y(1, 2)); +} + +fn main() { + bar(); +} diff --git a/tests/ui/windows-subsystem/windows-subsystem-invalid.rs b/tests/ui/windows/windows-subsystem-invalid.rs similarity index 100% rename from tests/ui/windows-subsystem/windows-subsystem-invalid.rs rename to tests/ui/windows/windows-subsystem-invalid.rs diff --git a/tests/ui/windows-subsystem/windows-subsystem-invalid.stderr b/tests/ui/windows/windows-subsystem-invalid.stderr similarity index 100% rename from tests/ui/windows-subsystem/windows-subsystem-invalid.stderr rename to tests/ui/windows/windows-subsystem-invalid.stderr diff --git a/tests/ui/windows-subsystem/windows.rs b/tests/ui/windows/windows.rs similarity index 100% rename from tests/ui/windows-subsystem/windows.rs rename to tests/ui/windows/windows.rs