John Kåre Alsaker | 20ce2f6 | 2020-02-06 11:46:26 | [diff] [blame] | 1 | // Test that debuginfo does not introduce a dependency edge to the hir_crate |
Michael Woerister | 271fb22 | 2016-12-08 17:47:35 | [diff] [blame] | 2 | // dep-node. |
| 3 | |
| 4 | // revisions:rpass1 rpass2 |
Michael Woerister | e6badfd | 2017-09-28 09:58:45 | [diff] [blame] | 5 | // compile-flags: -Z query-dep-graph |
| 6 | |
Michael Woerister | 271fb22 | 2016-12-08 17:47:35 | [diff] [blame] | 7 | #![feature(rustc_attrs)] |
John Kåre Alsaker | 20ce2f6 | 2020-02-06 11:46:26 | [diff] [blame] | 8 | #![rustc_partition_reused(module = "issue_38222-mod1", cfg = "rpass2")] |
| 9 | // If codegen had added a dependency edge to the hir_crate dep-node, nothing would |
Michael Woerister | 271fb22 | 2016-12-08 17:47:35 | [diff] [blame] | 10 | // be re-used, so checking that this module was re-used is sufficient. |
John Kåre Alsaker | 20ce2f6 | 2020-02-06 11:46:26 | [diff] [blame] | 11 | #![rustc_partition_reused(module = "issue_38222", cfg = "rpass2")] |
Michael Woerister | 271fb22 | 2016-12-08 17:47:35 | [diff] [blame] | 12 | |
| 13 | //[rpass1] compile-flags: -C debuginfo=1 |
| 14 | //[rpass2] compile-flags: -C debuginfo=1 |
| 15 | |
| 16 | pub fn main() { |
| 17 | mod1::some_fn(); |
| 18 | } |
| 19 | |
| 20 | mod mod1 { |
| 21 | pub fn some_fn() { |
Michael Woerister | cedae73 | 2017-10-27 16:57:15 | [diff] [blame] | 22 | #[cfg(rpass2)] |
| 23 | {} |
Michael Woerister | 271fb22 | 2016-12-08 17:47:35 | [diff] [blame] | 24 | |
Michael Woerister | cedae73 | 2017-10-27 16:57:15 | [diff] [blame] | 25 | let _ = 1; |
Michael Woerister | 271fb22 | 2016-12-08 17:47:35 | [diff] [blame] | 26 | } |
| 27 | } |