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.
20 // revisions: cfail1 cfail2 cfail3
21 // compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
24 #![feature(rustc_attrs)]
28 // Change loop body ------------------------------------------------------------
30 pub fn change_loop_body() {
39 #[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
40 #[rustc_clean(cfg="cfail3")]
41 pub fn change_loop_body() {
51 // Change loop body ------------------------------------------------------------
53 pub fn change_loop_condition() {
62 #[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
63 #[rustc_clean(cfg="cfail3")]
64 pub fn change_loop_condition() {
74 // Add break -------------------------------------------------------------------
84 #[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
85 #[rustc_clean(cfg="cfail3")]
96 // Add loop label --------------------------------------------------------------
98 pub fn add_loop_label() {
107 #[rustc_clean(cfg="cfail2", except="HirBody")]
108 #[rustc_clean(cfg="cfail3")]
109 pub fn add_loop_label() {
119 // Add loop label to break -----------------------------------------------------
121 pub fn add_loop_label_to_break() {
130 #[rustc_clean(cfg="cfail2", except="HirBody")]
131 #[rustc_clean(cfg="cfail3")]
132 pub fn add_loop_label_to_break() {
142 // Change break label ----------------------------------------------------------
144 pub fn change_break_label() {
155 #[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
156 #[rustc_clean(cfg="cfail3")]
157 pub fn change_break_label() {
169 // Add loop label to continue --------------------------------------------------
171 pub fn add_loop_label_to_continue() {
180 #[rustc_clean(cfg="cfail2", except="HirBody")]
181 #[rustc_clean(cfg="cfail3")]
182 pub fn add_loop_label_to_continue() {
192 // Change continue label ----------------------------------------------------------
194 pub fn change_continue_label() {
205 #[rustc_clean(cfg="cfail2", except="HirBody, MirValidated")]
206 #[rustc_clean(cfg="cfail3")]
207 pub fn change_continue_label() {
219 // Change continue to break ----------------------------------------------------
221 pub fn change_continue_to_break() {
230 #[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
231 #[rustc_clean(cfg="cfail3")]
232 pub fn change_continue_to_break() {