rust-gpu/tests/ui/dis/asm_add_two_ints.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

22 lines
411 B
Rust

// build-pass
// compile-flags: -C llvm-args=--disassemble-fn=asm_add_two_ints::add_two_ints
use spirv_std as _;
fn add_two_ints(x: u32, y: u32) -> u32 {
let result;
unsafe {
asm!(
"{0} = OpIAdd typeof{0} {1} {2}",
out(reg) result,
in(reg) x,
in(reg) y,
);
}
result
}
#[spirv(fragment)]
pub fn main() {
add_two_ints(2, 3);
}