-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
26 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |