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)]
30 // Change template -------------------------------------------------------------
32 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
33 pub fn change_template(a: i32) -> i32 {
47 #[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
48 #[rustc_clean(cfg="cfail3")]
49 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
50 pub fn change_template(a: i32) -> i32 {
65 // Change output -------------------------------------------------------------
67 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
68 pub fn change_output(a: i32) -> i32 {
69 let mut _out1: i32 = 0;
70 let mut _out2: i32 = 0;
83 #[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
84 #[rustc_clean(cfg="cfail3")]
85 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
86 pub fn change_output(a: i32) -> i32 {
87 let mut _out1: i32 = 0;
88 let mut _out2: i32 = 0;
102 // Change input -------------------------------------------------------------
104 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
105 pub fn change_input(_a: i32, _b: i32) -> i32 {
119 #[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
120 #[rustc_clean(cfg="cfail3")]
121 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
122 pub fn change_input(_a: i32, _b: i32) -> i32 {
137 // Change input constraint -----------------------------------------------------
139 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
140 pub fn change_input_constraint(_a: i32, _b: i32) -> i32 {
154 #[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
155 #[rustc_clean(cfg="cfail3")]
156 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
157 pub fn change_input_constraint(_a: i32, _b: i32) -> i32 {
172 // Change clobber --------------------------------------------------------------
174 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
175 pub fn change_clobber(_a: i32) -> i32 {
189 #[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
190 #[rustc_clean(cfg="cfail3")]
191 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
192 pub fn change_clobber(_a: i32) -> i32 {
207 // Change options --------------------------------------------------------------
209 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
210 pub fn change_options(_a: i32) -> i32 {
224 #[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
225 #[rustc_clean(cfg="cfail3")]
226 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
227 pub fn change_options(_a: i32) -> i32 {