about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-22 18:51:46 +0000
committerbors <bors@rust-lang.org>2018-07-22 18:51:46 +0000
commit3b7720399a9006d9d7b89c251fa37ead46f9db7a (patch)
tree893229ffba03c1f5b454d36ae07257ccf1a75d5c /src/test/codegen
parent32772fddd52013a38ece584279b6bc422b2d8b9b (diff)
parentb954d4d1b5a97cf9c13929a742e81035f3158440 (diff)
downloadrust-3b7720399a9006d9d7b89c251fa37ead46f9db7a.tar.gz
rust-3b7720399a9006d9d7b89c251fa37ead46f9db7a.zip
Auto merge of #52616 - kennytm:rollup, r=kennytm
Rollup of 11 pull requests

Successful merges:

 - #51807 (Deprecation of str::slice_unchecked(_mut))
 - #52051 (mem::swap the obvious way for types smaller than the SIMD optimization's block size)
 - #52465 (Add CI test harness for `thumb*` targets. [IRR-2018-embedded])
 - #52507 (Reword when `_` couldn't be inferred)
 - #52508 (Document that Unique::empty() and NonNull::dangling() aren't sentinel values)
 - #52521 (Fix links in rustdoc book.)
 - #52581 (Avoid using `#[macro_export]` for documenting builtin macros)
 - #52582 (Typo)
 - #52587 (Add missing backtick in UniversalRegions doc comment)
 - #52594 (Run the error index tool against the sysroot libdir)
 - #52615 (Added new lines to .gitignore.)
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/swap-small-types.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/codegen/swap-small-types.rs b/src/test/codegen/swap-small-types.rs
new file mode 100644
index 00000000000..46406ee5182
--- /dev/null
+++ b/src/test/codegen/swap-small-types.rs
@@ -0,0 +1,27 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -O
+// only-x86_64
+
+#![crate_type = "lib"]
+
+use std::mem::swap;
+
+type RGB48 = [u16; 3];
+
+// CHECK-LABEL: @swap_rgb48
+#[no_mangle]
+pub fn swap_rgb48(x: &mut RGB48, y: &mut RGB48) {
+// CHECK-NOT: alloca
+// CHECK: load i48
+// CHECK: store i48
+    swap(x, y)
+}