rust-gpu/tests/ui/dis/unroll_loops.rs
Ashley Hauck 1431c18b9d
Move disassemble tests to compiletest (#609)
* Move disassemble tests to compiletest

* Fix problematic tests

* Add newlines
2021-04-30 09:07:45 +02:00

19 lines
354 B
Rust

// build-pass
// compile-flags: -C llvm-args=--disassemble-fn=unroll_loops::java_hash_ten_times
use spirv_std as _;
#[spirv(unroll_loops)]
fn java_hash_ten_times(mut x: u32, y: u32) -> u32 {
let mut i = 0;
while i < 10 {
x = 31 * x + y;
i += 1;
}
x
}
#[spirv(fragment)]
pub fn main() {
java_hash_ten_times(7, 42);
}