Michael Woerister | 271fb22 | 2016-12-08 17:47:35 | [diff] [blame] | 1 | // Copyright 2016 The Rust Project Developers. See the COPYRIGHT |
| 2 | // file at the top-level directory of this distribution and at |
| 3 | // http://rust-lang.org/COPYRIGHT. |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 8 | // option. This file may not be copied, modified, or distributed |
| 9 | // except according to those terms. |
| 10 | |
| 11 | // Test that debuginfo does not introduce a dependency edge to the Krate |
| 12 | // dep-node. |
| 13 | |
| 14 | // revisions:rpass1 rpass2 |
Michael Woerister | e6badfd | 2017-09-28 09:58:45 | [diff] [blame^] | 15 | // compile-flags: -Z query-dep-graph |
| 16 | |
Michael Woerister | 271fb22 | 2016-12-08 17:47:35 | [diff] [blame] | 17 | |
| 18 | #![feature(rustc_attrs)] |
| 19 | |
| 20 | |
| 21 | #![rustc_partition_translated(module="issue_38222-mod1", cfg="rpass2")] |
| 22 | |
| 23 | // If trans had added a dependency edge to the Krate dep-node, nothing would |
| 24 | // be re-used, so checking that this module was re-used is sufficient. |
| 25 | #![rustc_partition_reused(module="issue_38222", cfg="rpass2")] |
| 26 | |
| 27 | //[rpass1] compile-flags: -C debuginfo=1 |
| 28 | //[rpass2] compile-flags: -C debuginfo=1 |
| 29 | |
| 30 | pub fn main() { |
| 31 | mod1::some_fn(); |
| 32 | } |
| 33 | |
| 34 | mod mod1 { |
| 35 | pub fn some_fn() { |
| 36 | let _ = 1; |
| 37 | } |
| 38 | |
| 39 | #[cfg(rpass2)] |
| 40 | fn _some_other_fn() { |
| 41 | } |
| 42 | } |