mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
rewrite lto-smoke-c to rmake
This commit is contained in:
parent
5753b30676
commit
741cf91678
@ -62,7 +62,6 @@ run-make/long-linker-command-lines-cmd-exe/Makefile
|
||||
run-make/long-linker-command-lines/Makefile
|
||||
run-make/lto-linkage-used-attr/Makefile
|
||||
run-make/lto-no-link-whole-rlib/Makefile
|
||||
run-make/lto-smoke-c/Makefile
|
||||
run-make/macos-deployment-target/Makefile
|
||||
run-make/macos-fat-archive/Makefile
|
||||
run-make/manual-link/Makefile
|
||||
|
@ -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)
|
20
tests/run-make/lto-smoke-c/rmake.rs
Normal file
20
tests/run-make/lto-smoke-c/rmake.rs
Normal 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");
|
||||
}
|
Loading…
Reference in New Issue
Block a user