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
12 // [cfail1]compile-flags: -Zincremental-ignore-spans
13 // [cfail2]compile-flags: -Zincremental-ignore-spans
14 // [cfail3]compile-flags: -Zincremental-ignore-spans
15 // [cfail4]compile-flags: -Zincremental-relative-spans
16 // [cfail5]compile-flags: -Zincremental-relative-spans
17 // [cfail6]compile-flags: -Zincremental-relative-spans
20 #![feature(rustc_attrs)]
26 #[cfg(any(cfail1,cfail4))]
27 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
28 pub fn change_template(_a: i32) -> i32 {
38 #[cfg(not(any(cfail1,cfail4)))]
39 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
40 #[rustc_clean(cfg="cfail3")]
41 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
42 #[rustc_clean(cfg="cfail6")]
43 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
44 pub fn change_template(_a: i32) -> i32 {
57 #[cfg(any(cfail1,cfail4))]
58 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
59 pub fn change_output(a: i32) -> i32 {
60 let mut _out1: i32 = 0;
61 let mut _out2: i32 = 0;
71 #[cfg(not(any(cfail1,cfail4)))]
72 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
73 #[rustc_clean(cfg="cfail3")]
74 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
75 #[rustc_clean(cfg="cfail6")]
76 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
77 pub fn change_output(a: i32) -> i32 {
78 let mut _out1: i32 = 0;
79 let mut _out2: i32 = 0;
92 #[cfg(any(cfail1,cfail4))]
93 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
94 pub fn change_input(_a: i32, _b: i32) -> i32 {
105 #[cfg(not(any(cfail1,cfail4)))]
106 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
107 #[rustc_clean(cfg="cfail3")]
108 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
109 #[rustc_clean(cfg="cfail6")]
110 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
111 pub fn change_input(_a: i32, _b: i32) -> i32 {
124 // Change input constraint
125 #[cfg(any(cfail1,cfail4))]
126 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
127 pub fn change_input_constraint(_a: i32, _b: i32) -> i32 {
138 #[cfg(not(any(cfail1,cfail4)))]
139 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
140 #[rustc_clean(cfg="cfail3")]
141 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
142 #[rustc_clean(cfg="cfail6")]
143 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
144 pub fn change_input_constraint(_a: i32, _b: i32) -> i32 {
157 #[cfg(any(cfail1,cfail4))]
158 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
159 pub fn change_clobber(_a: i32) -> i32 {
171 #[cfg(not(any(cfail1,cfail4)))]
172 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
173 #[rustc_clean(cfg="cfail3")]
174 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
175 #[rustc_clean(cfg="cfail6")]
176 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
177 pub fn change_clobber(_a: i32) -> i32 {
192 #[cfg(any(cfail1,cfail4))]
193 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
194 pub fn change_options(_a: i32) -> i32 {
206 #[cfg(not(any(cfail1,cfail4)))]
207 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
208 #[rustc_clean(cfg="cfail3")]
209 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
210 #[rustc_clean(cfg="cfail6")]
211 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
212 pub fn change_options(_a: i32) -> i32 {