-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep double remap test and add test with real std
- Loading branch information
Showing
3 changed files
with
26 additions
and
19 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
src/test/codegen/remap_path_prefix/double-remap-imported.rs
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,14 @@ | ||
// ignore-windows | ||
// ignore-tidy-linelength | ||
|
||
// compile-flags: -g -C no-prepopulate-passes --remap-path-prefix=/the/aux-src=/the/double/remapped/aux-src | ||
// aux-build:remap_path_prefix_aux.rs | ||
|
||
extern crate remap_path_prefix_aux; | ||
|
||
// Here we check that path can be remapped again after already having been | ||
// remapped by compile-flags inside auxiliary/remap_path_prefix_aux.rs | ||
// CHECK: !DIFile(filename: "/the/double/remapped/aux-src/remap_path_prefix_aux.rs", directory: "" | ||
fn main() { | ||
remap_path_prefix_aux::some_aux_function(); | ||
} |
23 changes: 12 additions & 11 deletions
23
src/test/codegen/remap_path_prefix/issue-73167-remap-std.rs
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 |
---|---|---|
@@ -1,16 +1,17 @@ | ||
// ignore-windows | ||
// ignore-tidy-linelength | ||
|
||
// compile-flags: -g -C no-prepopulate-passes --remap-path-prefix=/home/USERNAME=REDACTED | ||
// aux-build:pseudo_std.rs | ||
// compile-flags: -g -C no-prepopulate-passes --remap-path-prefix={{cwd}}/library/std=/the/std | ||
|
||
extern crate pseudo_std; | ||
// Here we check that imported code from std has their path remapped. | ||
// If we were to use an actual std function to test, we'd have to remap {{cwd}}/library/..., | ||
// but that will break if rustc was built with remap-debuginfo = true in config.toml. | ||
// Hence we simulate the path rust-src would take in a real linux installation | ||
// by remapping the prefix inside pseudo_std.rs | ||
// CHECK: !DIFile(filename: "REDACTED/TOOLCHAIN/lib/rustlib/src/rust/library/std/src/pseudo_std.rs", directory: "" | ||
// Here we check that imported code from std has their path remapped | ||
// Ideally we want to do | ||
// COM: CHECK-NOT: !DIFile(filename: "{{cwd}}/library/std/src/thread/mod.rs" | ||
// But {{cwd}} will not be expanded here, so we have to check on the bit afterwards | ||
// Note that we can't use a positive check on `/the/std` either, because the rempap flag will | ||
// have no effect when `remap-debuginfo` is set to true in `config.toml`, causing the test to fail | ||
|
||
// CHECK-NOT: !DIFile(filename: "{{.*}}/library/std" | ||
fn main() { | ||
pseudo_std::some_std_function(); | ||
std::thread::spawn(|| { | ||
println!("hello"); | ||
}); | ||
} |