]>
git.proxmox.com Git - rustc.git/blob - src/test/incremental/hashes/inline_asm.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
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)]
26 #[cfg(any(cfail1,cfail4))]
27 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
28 pub fn change_template(a
: i32) -> i32 {
41 #[cfg(not(any(cfail1,cfail4)))]
42 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
43 #[rustc_clean(cfg="cfail3")]
44 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
45 #[rustc_clean(cfg="cfail6")]
46 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
47 pub fn change_template(a
: i32) -> i32 {
63 #[cfg(any(cfail1,cfail4))]
64 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
65 pub fn change_output(a
: i32) -> i32 {
66 let mut _out1
: i32 = 0;
67 let mut _out2
: i32 = 0;
79 #[cfg(not(any(cfail1,cfail4)))]
80 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
81 #[rustc_clean(cfg="cfail3")]
82 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
83 #[rustc_clean(cfg="cfail6")]
84 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
85 pub fn change_output(a
: i32) -> i32 {
86 let mut _out1
: i32 = 0;
87 let mut _out2
: i32 = 0;
102 #[cfg(any(cfail1,cfail4))]
103 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
104 pub fn change_input(_a
: i32, _b
: i32) -> i32 {
107 llvm_asm
!("add 1, $0"
117 #[cfg(not(any(cfail1,cfail4)))]
118 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
119 #[rustc_clean(cfg="cfail3")]
120 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
121 #[rustc_clean(cfg="cfail6")]
122 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
123 pub fn change_input(_a
: i32, _b
: i32) -> i32 {
126 llvm_asm
!("add 1, $0"
138 // Change input constraint
139 #[cfg(any(cfail1,cfail4))]
140 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
141 pub fn change_input_constraint(_a
: i32, _b
: i32) -> i32 {
144 llvm_asm
!("add 1, $0"
154 #[cfg(not(any(cfail1,cfail4)))]
155 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
156 #[rustc_clean(cfg="cfail3")]
157 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
158 #[rustc_clean(cfg="cfail6")]
159 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
160 pub fn change_input_constraint(_a
: i32, _b
: i32) -> i32 {
163 llvm_asm
!("add 1, $0"
176 #[cfg(any(cfail1,cfail4))]
177 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
178 pub fn change_clobber(_a
: i32) -> i32 {
181 llvm_asm
!("add 1, $0"
191 #[cfg(not(any(cfail1,cfail4)))]
192 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
193 #[rustc_clean(cfg="cfail3")]
194 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
195 #[rustc_clean(cfg="cfail6")]
196 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
197 pub fn change_clobber(_a
: i32) -> i32 {
200 llvm_asm
!("add 1, $0"
213 #[cfg(any(cfail1,cfail4))]
214 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
215 pub fn change_options(_a
: i32) -> i32 {
218 llvm_asm
!("add 1, $0"
228 #[cfg(not(any(cfail1,cfail4)))]
229 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
230 #[rustc_clean(cfg="cfail3")]
231 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, optimized_mir")]
232 #[rustc_clean(cfg="cfail6")]
233 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
234 pub fn change_options(_a
: i32) -> i32 {
237 llvm_asm
!("add 1, $0"