Skip to content

Commit

Permalink
rewrite relocation-model to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jun 19, 2024
1 parent 5c8459f commit 75ee1d7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 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 @@ -164,7 +164,6 @@ run-make/raw-dylib-inline-cross-dylib/Makefile
run-make/raw-dylib-link-ordinal/Makefile
run-make/raw-dylib-stdcall-ordinal/Makefile
run-make/redundant-libs/Makefile
run-make/relocation-model/Makefile
run-make/relro-levels/Makefile
run-make/remap-path-prefix-dwarf/Makefile
run-make/remap-path-prefix/Makefile
Expand Down
20 changes: 0 additions & 20 deletions tests/run-make/relocation-model/Makefile

This file was deleted.

26 changes: 26 additions & 0 deletions tests/run-make/relocation-model/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Generation of position-independent code (PIC) can be altered
// through use of the -C relocation-model rustc flag. This test
// uses varied values with this flag and checks that compilation
// succeeds.
// See https://github.com/rust-lang/rust/pull/13340

//@ ignore-cross-compile

use run_make_support::{run, rustc};

fn main() {
// FIXME(Oneirical): This first one will likely fail on MSVC due to #28026.
// Remove this after try-job
rustc().arg("-Crelocation-model=static").input("foo.rs").run();
run("foo");
rustc().arg("-Crelocation-model=dynamic-no-pic").input("foo.rs").run();
run("foo");
rustc().arg("-Crelocation-model=default").input("foo.rs").run();
run("foo");
rustc()
.arg("-Crelocation-model=dynamic-no-pic")
.crate_type("dylib")
.emit("link,obj")
.input("foo.rs")
.run();
}

0 comments on commit 75ee1d7

Please sign in to comment.