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))]
55 #[cfg(not(any(cfail1,cfail4)))]
56 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir, typeck")]
57 #[rustc_clean(cfg="cfail3")]
58 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir, typeck")]
59 #[rustc_clean(cfg="cfail6")]
71 #[cfg(any(cfail1,cfail4))]
72 pub fn add_loop_label() {
80 #[cfg(not(any(cfail1,cfail4)))]
81 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
82 #[rustc_clean(cfg="cfail3")]
83 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
84 #[rustc_clean(cfg="cfail6")]
85 pub fn add_loop_label() {
95 // Add loop label to break
96 #[cfg(any(cfail1,cfail4))]
97 pub fn add_loop_label_to_break() {
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_to_break() {
120 // Change break label
121 #[cfg(any(cfail1,cfail4))]
122 pub fn change_break_label() {
132 #[cfg(not(any(cfail1,cfail4)))]
133 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir, typeck")]
134 #[rustc_clean(cfg="cfail3")]
135 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir, typeck")]
136 #[rustc_clean(cfg="cfail6")]
137 pub fn change_break_label() {
149 // Add loop label to continue
150 #[cfg(any(cfail1,cfail4))]
151 pub fn add_loop_label_to_continue() {
159 #[cfg(not(any(cfail1,cfail4)))]
160 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
161 #[rustc_clean(cfg="cfail3")]
162 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
163 #[rustc_clean(cfg="cfail6")]
164 pub fn add_loop_label_to_continue() {
174 // Change continue label
175 #[cfg(any(cfail1,cfail4))]
176 pub fn change_continue_label() {
186 #[cfg(not(any(cfail1,cfail4)))]
187 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
188 #[rustc_clean(cfg="cfail3")]
189 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
190 #[rustc_clean(cfg="cfail6")]
191 pub fn change_continue_label() {
203 // Change continue to break
204 #[cfg(any(cfail1,cfail4))]
205 pub fn change_continue_to_break() {
213 #[cfg(not(any(cfail1,cfail4)))]
214 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, typeck, optimized_mir")]
215 #[rustc_clean(cfg="cfail3")]
216 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, typeck, optimized_mir")]
217 #[rustc_clean(cfg="cfail6")]
218 pub fn change_continue_to_break() {