Skip to content

Commit 3347dfb

Browse files
committed
rewrite no-builtins-attribute to rmake
1 parent 2e240c5 commit 3347dfb

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

Diff for: src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ run-make/macos-deployment-target/Makefile
4848
run-make/min-global-align/Makefile
4949
run-make/native-link-modifier-bundle/Makefile
5050
run-make/no-alloc-shim/Makefile
51-
run-make/no-builtins-attribute/Makefile
5251
run-make/no-duplicate-libs/Makefile
5352
run-make/panic-abort-eh_frame/Makefile
5453
run-make/pdb-buildinfo-cl-cmd/Makefile

Diff for: tests/run-make/native-link-modifier-whole-archive/rmake.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ fn main() {
6666
.crate_type("rlib")
6767
.arg("-lstatic:-bundle,+whole-archive=c_static_lib_with_constructor")
6868
.run();
69-
// Native lib linked into RLIB via `-l static:-bundle,+whole-archive`, RLIB linked into executable
69+
// Native lib linked into RLIB via `-l static:-bundle,+whole-archive`
70+
// RLIB linked into executable
7071
rustc().input("indirectly_linked.rs").run();
7172

7273
// Native lib linked into rlib via `#[link()]` attribute on extern block.

Diff for: tests/run-make/no-builtins-attribute/Makefile

-9
This file was deleted.

Diff for: tests/run-make/no-builtins-attribute/rmake.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// `no_builtins` is an attribute related to LLVM's optimizations. In order to ensure that it has an
2+
// effect on link-time optimizations (LTO), it should be added to function declarations in a crate.
3+
// This test uses the `llvm-filecheck` tool to determine that this attribute is successfully
4+
// being added to these function declarations.
5+
// See https://github.com/rust-lang/rust/pull/113716
6+
7+
use run_make_support::{llvm_filecheck, rfs, rustc};
8+
9+
fn main() {
10+
rustc().input("no_builtins.rs").emit("link").run();
11+
rustc().input("main.rs").emit("llvm-ir").run();
12+
llvm_filecheck().patterns("filecheck.main.txt").stdin(rfs::read("main.ll")).run();
13+
}

0 commit comments

Comments
 (0)