]>
git.proxmox.com Git - rustc.git/blob - src/test/incremental/hashes/while_loops.rs
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
14 // [cfail4]compile-flags: -Zincremental-relative-spans
15 // [cfail5]compile-flags: -Zincremental-relative-spans
16 // [cfail6]compile-flags: -Zincremental-relative-spans
19 #![feature(rustc_attrs)]
24 #[cfg(any(cfail1,cfail4))]
25 pub fn change_loop_body() {
33 #[cfg(not(any(cfail1,cfail4)))]
34 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
35 #[rustc_clean(cfg="cfail3")]
36 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
37 #[rustc_clean(cfg="cfail6")]
38 pub fn change_loop_body() {
49 #[cfg(any(cfail1,cfail4))]
50 pub fn change_loop_condition() {
58 #[cfg(not(any(cfail1,cfail4)))]
59 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
60 #[rustc_clean(cfg="cfail3")]
61 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
62 #[rustc_clean(cfg="cfail6")]
63 pub fn change_loop_condition() {
74 #[cfg(any(cfail1,cfail4))]
83 #[cfg(not(any(cfail1,cfail4)))]
84 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir, typeck")]
85 #[rustc_clean(cfg="cfail3")]
86 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir, typeck")]
87 #[rustc_clean(cfg="cfail6")]
99 #[cfg(any(cfail1,cfail4))]
100 pub fn add_loop_label() {
108 #[cfg(not(any(cfail1,cfail4)))]
109 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
110 #[rustc_clean(cfg="cfail3")]
111 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
112 #[rustc_clean(cfg="cfail6")]
113 pub fn add_loop_label() {
123 // Add loop label to break
124 #[cfg(any(cfail1,cfail4))]
125 pub fn add_loop_label_to_break() {
133 #[cfg(not(any(cfail1,cfail4)))]
134 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
135 #[rustc_clean(cfg="cfail3")]
136 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
137 #[rustc_clean(cfg="cfail6")]
138 pub fn add_loop_label_to_break() {
148 // Change break label
149 #[cfg(any(cfail1,cfail4))]
150 pub fn change_break_label() {
160 #[cfg(not(any(cfail1,cfail4)))]
161 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
162 #[rustc_clean(cfg="cfail3")]
163 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
164 #[rustc_clean(cfg="cfail6")]
165 pub fn change_break_label() {
177 // Add loop label to continue
178 #[cfg(any(cfail1,cfail4))]
179 pub fn add_loop_label_to_continue() {
187 #[cfg(not(any(cfail1,cfail4)))]
188 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
189 #[rustc_clean(cfg="cfail3")]
190 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
191 #[rustc_clean(cfg="cfail6")]
192 pub fn add_loop_label_to_continue() {
202 // Change continue label
203 #[cfg(any(cfail1,cfail4))]
204 pub fn change_continue_label() {
214 #[cfg(not(any(cfail1,cfail4)))]
215 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,typeck")]
216 #[rustc_clean(cfg="cfail3")]
217 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,typeck,optimized_mir")]
218 #[rustc_clean(cfg="cfail6")]
219 pub fn change_continue_label() {
231 // Change continue to break
232 #[cfg(any(cfail1,cfail4))]
233 pub fn change_continue_to_break() {
241 #[cfg(not(any(cfail1,cfail4)))]
242 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
243 #[rustc_clean(cfg="cfail3")]
244 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
245 #[rustc_clean(cfg="cfail6")]
246 pub fn change_continue_to_break() {