diff options
| author | oberien <jaro.fietz@gmx.de> | 2018-02-02 09:31:56 +0100 |
|---|---|---|
| committer | oberien <jaro.fietz@gmx.de> | 2018-02-04 16:09:32 +0100 |
| commit | 75474ff1323c2968bb2dafc8b8f0af4817a89d01 (patch) | |
| tree | 4f56a427389cdb9f3cb7ba641e8ecdcde2948da0 /src/test/codegen | |
| parent | a1809d57840a19e28e93b437a7d029be3656acb8 (diff) | |
| download | rust-75474ff1323c2968bb2dafc8b8f0af4817a89d01.tar.gz rust-75474ff1323c2968bb2dafc8b8f0af4817a89d01.zip | |
TrustedLen for Repeat / RangeFrom test cases
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/repeat-trusted-len.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/codegen/repeat-trusted-len.rs b/src/test/codegen/repeat-trusted-len.rs new file mode 100644 index 00000000000..43872f15d51 --- /dev/null +++ b/src/test/codegen/repeat-trusted-len.rs @@ -0,0 +1,23 @@ +// 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 +// ignore-tidy-linelength + +#![crate_type = "lib"] + +use std::iter; + +// CHECK-LABEL: @repeat_take_collect +#[no_mangle] +pub fn repeat_take_collect() -> Vec<u8> { +// CHECK: call void @llvm.memset.p0i8 + iter::repeat(42).take(100000).collect() +} |
