diff options
| author | Ulrik Sverdrup <bluss@users.noreply.github.com> | 2016-04-21 21:35:39 +0200 |
|---|---|---|
| committer | Ulrik Sverdrup <bluss@users.noreply.github.com> | 2016-06-14 15:51:49 +0200 |
| commit | c2ef20fd38c5d52e1cf9416606140012ffa20217 (patch) | |
| tree | 46e2e936b2ac646cc6cb47972bfcfa34ef8f45ee /src/test/codegen | |
| parent | 13f8f40961d4e2166a80699a2e21a5dbf2211ecb (diff) | |
| download | rust-c2ef20fd38c5d52e1cf9416606140012ffa20217.tar.gz rust-c2ef20fd38c5d52e1cf9416606140012ffa20217.zip | |
specialize zip: Add codegen test
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/zip.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/codegen/zip.rs b/src/test/codegen/zip.rs new file mode 100644 index 00000000000..6c956364bf8 --- /dev/null +++ b/src/test/codegen/zip.rs @@ -0,0 +1,22 @@ +// Copyright 2016 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: -C no-prepopulate-passes -O + +#![crate_type = "lib"] + +// CHECK-LABEL: @zip_copy +#[no_mangle] +pub fn zip_copy(xs: &[u8], ys: &mut [u8]) { +// CHECK: memcpy + for (x, y) in xs.iter().zip(ys) { + *y = *x; + } +} |
