Skip to content

Commit

Permalink
rewrite no-builtins-attribute to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jul 23, 2024
1 parent 2e240c5 commit 3347dfb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ run-make/macos-deployment-target/Makefile
run-make/min-global-align/Makefile
run-make/native-link-modifier-bundle/Makefile
run-make/no-alloc-shim/Makefile
run-make/no-builtins-attribute/Makefile
run-make/no-duplicate-libs/Makefile
run-make/panic-abort-eh_frame/Makefile
run-make/pdb-buildinfo-cl-cmd/Makefile
Expand Down
3 changes: 2 additions & 1 deletion tests/run-make/native-link-modifier-whole-archive/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ fn main() {
.crate_type("rlib")
.arg("-lstatic:-bundle,+whole-archive=c_static_lib_with_constructor")
.run();
// Native lib linked into RLIB via `-l static:-bundle,+whole-archive`, RLIB linked into executable
// Native lib linked into RLIB via `-l static:-bundle,+whole-archive`
// RLIB linked into executable
rustc().input("indirectly_linked.rs").run();

// Native lib linked into rlib via `#[link()]` attribute on extern block.
Expand Down
9 changes: 0 additions & 9 deletions tests/run-make/no-builtins-attribute/Makefile

This file was deleted.

13 changes: 13 additions & 0 deletions tests/run-make/no-builtins-attribute/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// `no_builtins` is an attribute related to LLVM's optimizations. In order to ensure that it has an
// effect on link-time optimizations (LTO), it should be added to function declarations in a crate.
// This test uses the `llvm-filecheck` tool to determine that this attribute is successfully
// being added to these function declarations.
// See https://github.com/rust-lang/rust/pull/113716

use run_make_support::{llvm_filecheck, rfs, rustc};

fn main() {
rustc().input("no_builtins.rs").emit("link").run();
rustc().input("main.rs").emit("llvm-ir").run();
llvm_filecheck().patterns("filecheck.main.txt").stdin(rfs::read("main.ll")).run();
}

0 comments on commit 3347dfb

Please sign in to comment.