]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/swap-small-types.rs
Suggest defining type parameter when appropriate
[rust.git] / src / test / codegen / swap-small-types.rs
1 // compile-flags: -O
2 // only-x86_64
3 // ignore-debug: the debug assertions get in the way
4
5 #![crate_type = "lib"]
6
7 use std::mem::swap;
8
9 type RGB48 = [u16; 3];
10
11 // CHECK-LABEL: @swap_rgb48
12 #[no_mangle]
13 pub fn swap_rgb48(x: &mut RGB48, y: &mut RGB48) {
14 // CHECK-NOT: alloca
15 // CHECK: load i48
16 // CHECK: store i48
17     swap(x, y)
18 }