]> git.proxmox.com Git - rustc.git/blob - tests/codegen/remap_path_prefix/main.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / tests / codegen / remap_path_prefix / main.rs
1 // ignore-windows
2 //
3
4 // compile-flags: -g -C no-prepopulate-passes --remap-path-prefix={{cwd}}=/the/cwd --remap-path-prefix={{src-base}}=/the/src -Zinline-mir=no
5 // aux-build:remap_path_prefix_aux.rs
6
7 extern crate remap_path_prefix_aux;
8
9 // Here we check that submodules and include files are found using the path without
10 // remapping. This test requires that rustc is called with an absolute path.
11 mod aux_mod;
12 include!("aux_mod.rs");
13
14 // Here we check that the expansion of the file!() macro is mapped.
15 // CHECK: @alloc_5761061597a97f66e13ef2ff92712c4b = private unnamed_addr constant <{ [34 x i8] }> <{ [34 x i8] c"/the/src/remap_path_prefix/main.rs" }>
16 pub static FILE_PATH: &'static str = file!();
17
18 fn main() {
19 remap_path_prefix_aux::some_aux_function();
20 aux_mod::some_aux_mod_function();
21 some_aux_mod_function();
22 }
23
24 // Here we check that local debuginfo is mapped correctly.
25 // CHECK: !DIFile(filename: "/the/src/remap_path_prefix/main.rs", directory: ""
26
27 // And here that debuginfo from other crates are expanded to absolute paths.
28 // CHECK: !DIFile(filename: "/the/aux-src/remap_path_prefix_aux.rs", directory: ""