mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-26 00:34:12 +00:00
1431c18b9d
* Move disassemble tests to compiletest * Fix problematic tests * Add newlines
22 lines
411 B
Rust
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);
|
|
}
|