1 // This test case tests the incremental compilation hash (ICH) implementation
4 // The general pattern followed here is: Change one thing between rev1 and rev2
5 // and make sure that the hash has changed, then change nothing between rev2 and
6 // rev3 and make sure that the hash has not changed.
8 // build-pass (FIXME(62277): could be check-pass?)
9 // revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
10 // compile-flags: -Z query-dep-graph -O
11 // [cfail1]compile-flags: -Zincremental-ignore-spans
12 // [cfail2]compile-flags: -Zincremental-ignore-spans
13 // [cfail3]compile-flags: -Zincremental-ignore-spans
16 #![feature(rustc_attrs)]
21 #[cfg(any(cfail1,cfail4))]
22 pub fn change_loop_body() {
30 #[cfg(not(any(cfail1,cfail4)))]
31 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
32 #[rustc_clean(cfg="cfail3")]
33 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
34 #[rustc_clean(cfg="cfail6")]
35 pub fn change_loop_body() {
46 #[cfg(any(cfail1,cfail4))]
47 pub fn change_loop_condition() {
55 #[cfg(not(any(cfail1,cfail4)))]
56 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
57 #[rustc_clean(cfg="cfail3")]
58 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
59 #[rustc_clean(cfg="cfail6")]
60 pub fn change_loop_condition() {
71 #[cfg(any(cfail1,cfail4))]
80 #[cfg(not(any(cfail1,cfail4)))]
81 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir, typeck")]
82 #[rustc_clean(cfg="cfail3")]
83 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir, typeck")]
84 #[rustc_clean(cfg="cfail6")]
96 #[cfg(any(cfail1,cfail4))]
97 pub fn add_loop_label() {
105 #[cfg(not(any(cfail1,cfail4)))]
106 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
107 #[rustc_clean(cfg="cfail3")]
108 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
109 #[rustc_clean(cfg="cfail6")]
110 pub fn add_loop_label() {
120 // Add loop label to break
121 #[cfg(any(cfail1,cfail4))]
122 pub fn add_loop_label_to_break() {
130 #[cfg(not(any(cfail1,cfail4)))]
131 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
132 #[rustc_clean(cfg="cfail3")]
133 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
134 #[rustc_clean(cfg="cfail6")]
135 pub fn add_loop_label_to_break() {
145 // Change break label
146 #[cfg(any(cfail1,cfail4))]
147 pub fn change_break_label() {
157 #[cfg(not(any(cfail1,cfail4)))]
158 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
159 #[rustc_clean(cfg="cfail3")]
160 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
161 #[rustc_clean(cfg="cfail6")]
162 pub fn change_break_label() {
174 // Add loop label to continue
175 #[cfg(any(cfail1,cfail4))]
176 pub fn add_loop_label_to_continue() {
184 #[cfg(not(any(cfail1,cfail4)))]
185 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
186 #[rustc_clean(cfg="cfail3")]
187 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
188 #[rustc_clean(cfg="cfail6")]
189 pub fn add_loop_label_to_continue() {
199 // Change continue label
200 #[cfg(any(cfail1,cfail4))]
201 pub fn change_continue_label() {
211 #[cfg(not(any(cfail1,cfail4)))]
212 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
213 #[rustc_clean(cfg="cfail3")]
214 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
215 #[rustc_clean(cfg="cfail6")]
216 pub fn change_continue_label() {
228 // Change continue to break
229 #[cfg(any(cfail1,cfail4))]
230 pub fn change_continue_to_break() {
238 #[cfg(not(any(cfail1,cfail4)))]
239 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
240 #[rustc_clean(cfg="cfail3")]
241 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
242 #[rustc_clean(cfg="cfail6")]
243 pub fn change_continue_to_break() {