rewrite lto-smoke-c to rmake

This commit is contained in:
Oneirical 2024-07-18 13:42:15 -04:00
parent 5753b30676
commit 741cf91678
3 changed files with 20 additions and 13 deletions

View File

@ -62,7 +62,6 @@ run-make/long-linker-command-lines-cmd-exe/Makefile
run-make/long-linker-command-lines/Makefile run-make/long-linker-command-lines/Makefile
run-make/lto-linkage-used-attr/Makefile run-make/lto-linkage-used-attr/Makefile
run-make/lto-no-link-whole-rlib/Makefile run-make/lto-no-link-whole-rlib/Makefile
run-make/lto-smoke-c/Makefile
run-make/macos-deployment-target/Makefile run-make/macos-deployment-target/Makefile
run-make/macos-fat-archive/Makefile run-make/macos-fat-archive/Makefile
run-make/manual-link/Makefile run-make/manual-link/Makefile

View File

@ -1,12 +0,0 @@
# ignore-cross-compile
include ../tools.mk
# Apparently older versions of GCC segfault if -g is passed...
CC := $(CC:-g=)
all:
$(RUSTC) foo.rs -C lto
$(CC) bar.c $(call STATICLIB,foo) \
$(call OUT_EXE,bar) \
$(EXTRACFLAGS) $(EXTRACXXFLAGS)
$(call RUN,bar)

View File

@ -0,0 +1,20 @@
// LLVM's link-time-optimization (LTO) is a useful feature added to Rust in response
// to #10741. This test uses this feature with `-C lto` alongside a native C library,
// and checks that compilation and execution is successful.
// See https://github.com/rust-lang/rust/issues/10741
//@ ignore-cross-compile
// Reason: the compiled binary is executed
use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib_name};
fn main() {
rustc().input("foo.rs").arg("-Clto").run();
cc().input("bar.c")
.arg(static_lib_name("foo"))
.out_exe("bar")
.args(&extra_c_flags())
.args(&extra_cxx_flags())
.run();
run("bar");
}