]>
git.proxmox.com Git - rustc.git/blob - src/test/incremental/hashes/loop_expressions.rs
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.
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.
12 // This test case tests the incremental compilation hash (ICH) implementation
15 // The general pattern followed here is: Change one thing between rev1 and rev2
16 // and make sure that the hash has changed, then change nothing between rev2 and
17 // rev3 and make sure that the hash has not changed.
19 // must-compile-successfully
20 // revisions: cfail1 cfail2 cfail3
21 // compile-flags: -Z query-dep-graph
24 #![feature(rustc_attrs)]
28 // Change loop body ------------------------------------------------------------
30 fn change_loop_body() {
39 #[rustc_clean(label="Hir", cfg="cfail2")]
40 #[rustc_clean(label="Hir", cfg="cfail3")]
41 #[rustc_dirty(label="HirBody", cfg="cfail2")]
42 #[rustc_clean(label="HirBody", cfg="cfail3")]
43 #[rustc_metadata_clean(cfg="cfail2")]
44 #[rustc_metadata_clean(cfg="cfail3")]
45 fn change_loop_body() {
55 // Add break -------------------------------------------------------------------
65 #[rustc_clean(label="Hir", cfg="cfail2")]
66 #[rustc_clean(label="Hir", cfg="cfail3")]
67 #[rustc_dirty(label="HirBody", cfg="cfail2")]
68 #[rustc_clean(label="HirBody", cfg="cfail3")]
69 #[rustc_metadata_clean(cfg="cfail2")]
70 #[rustc_metadata_clean(cfg="cfail3")]
81 // Add loop label --------------------------------------------------------------
92 #[rustc_clean(label="Hir", cfg="cfail2")]
93 #[rustc_clean(label="Hir", cfg="cfail3")]
94 #[rustc_dirty(label="HirBody", cfg="cfail2")]
95 #[rustc_clean(label="HirBody", cfg="cfail3")]
96 #[rustc_metadata_clean(cfg="cfail2")]
97 #[rustc_metadata_clean(cfg="cfail3")]
108 // Add loop label to break -----------------------------------------------------
110 fn add_loop_label_to_break() {
119 #[rustc_clean(label="Hir", cfg="cfail2")]
120 #[rustc_clean(label="Hir", cfg="cfail3")]
121 #[rustc_dirty(label="HirBody", cfg="cfail2")]
122 #[rustc_clean(label="HirBody", cfg="cfail3")]
123 #[rustc_metadata_clean(cfg="cfail2")]
124 #[rustc_metadata_clean(cfg="cfail3")]
125 fn add_loop_label_to_break() {
135 // Change break label ----------------------------------------------------------
137 fn change_break_label() {
148 #[rustc_clean(label="Hir", cfg="cfail2")]
149 #[rustc_clean(label="Hir", cfg="cfail3")]
150 #[rustc_dirty(label="HirBody", cfg="cfail2")]
151 #[rustc_clean(label="HirBody", cfg="cfail3")]
152 #[rustc_metadata_clean(cfg="cfail2")]
153 #[rustc_metadata_clean(cfg="cfail3")]
154 fn change_break_label() {
166 // Add loop label to continue --------------------------------------------------
168 fn add_loop_label_to_continue() {
177 #[rustc_clean(label="Hir", cfg="cfail2")]
178 #[rustc_clean(label="Hir", cfg="cfail3")]
179 #[rustc_dirty(label="HirBody", cfg="cfail2")]
180 #[rustc_clean(label="HirBody", cfg="cfail3")]
181 #[rustc_metadata_clean(cfg="cfail2")]
182 #[rustc_metadata_clean(cfg="cfail3")]
183 fn add_loop_label_to_continue() {
193 // Change continue label ----------------------------------------------------------
195 fn change_continue_label() {
206 #[rustc_clean(label="Hir", cfg="cfail2")]
207 #[rustc_clean(label="Hir", cfg="cfail3")]
208 #[rustc_dirty(label="HirBody", cfg="cfail2")]
209 #[rustc_clean(label="HirBody", cfg="cfail3")]
210 #[rustc_metadata_clean(cfg="cfail2")]
211 #[rustc_metadata_clean(cfg="cfail3")]
212 fn change_continue_label() {
224 // Change continue to break ----------------------------------------------------
226 fn change_continue_to_break() {
235 #[rustc_clean(label="Hir", cfg="cfail2")]
236 #[rustc_clean(label="Hir", cfg="cfail3")]
237 #[rustc_dirty(label="HirBody", cfg="cfail2")]
238 #[rustc_clean(label="HirBody", cfg="cfail3")]
239 #[rustc_metadata_clean(cfg="cfail2")]
240 #[rustc_metadata_clean(cfg="cfail3")]
241 fn change_continue_to_break() {