Skip to content

Commit 0afce07

Browse files
committed
Keep double remap test and add test with real std
1 parent 00700e5 commit 0afce07

File tree

3 files changed

+26
-19
lines changed

3 files changed

+26
-19
lines changed

src/test/codegen/remap_path_prefix/auxiliary/pseudo_std.rs

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// ignore-windows
2+
// ignore-tidy-linelength
3+
4+
// compile-flags: -g -C no-prepopulate-passes --remap-path-prefix=/the/aux-src=/the/double/remapped/aux-src
5+
// aux-build:remap_path_prefix_aux.rs
6+
7+
extern crate remap_path_prefix_aux;
8+
9+
// Here we check that path can be remapped again after already having been
10+
// remapped by compile-flags inside auxiliary/remap_path_prefix_aux.rs
11+
// CHECK: !DIFile(filename: "/the/double/remapped/aux-src/remap_path_prefix_aux.rs", directory: ""
12+
fn main() {
13+
remap_path_prefix_aux::some_aux_function();
14+
}
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
// ignore-windows
2-
// ignore-tidy-linelength
32

4-
// compile-flags: -g -C no-prepopulate-passes --remap-path-prefix=/home/USERNAME=REDACTED
5-
// aux-build:pseudo_std.rs
3+
// compile-flags: -g -C no-prepopulate-passes --remap-path-prefix={{cwd}}/library/std=/the/std
64

7-
extern crate pseudo_std;
8-
// Here we check that imported code from std has their path remapped.
9-
// If we were to use an actual std function to test, we'd have to remap {{cwd}}/library/...,
10-
// but that will break if rustc was built with remap-debuginfo = true in config.toml.
11-
// Hence we simulate the path rust-src would take in a real linux installation
12-
// by remapping the prefix inside pseudo_std.rs
13-
// CHECK: !DIFile(filename: "REDACTED/TOOLCHAIN/lib/rustlib/src/rust/library/std/src/pseudo_std.rs", directory: ""
5+
// Here we check that imported code from std has their path remapped
6+
// Ideally we want to do
7+
// COM: CHECK-NOT: !DIFile(filename: "{{cwd}}/library/std/src/thread/mod.rs"
8+
// But {{cwd}} will not be expanded here, so we have to check on the bit afterwards
9+
// Note that we can't use a positive check on `/the/std` either, because the rempap flag will
10+
// have no effect when `remap-debuginfo` is set to true in `config.toml`, causing the test to fail
11+
12+
// CHECK-NOT: !DIFile(filename: "{{.*}}/library/std"
1413
fn main() {
15-
pseudo_std::some_std_function();
14+
std::thread::spawn(|| {
15+
println!("hello");
16+
});
1617
}

0 commit comments

Comments
 (0)