about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-07-30 01:40:11 +0000
committerbors <bors@rust-lang.org>2017-07-30 01:40:11 +0000
commit5c71e4ef90ef79c1ac79c4132333cbc80f5b85b9 (patch)
tree1efdfb555e8266e747a7e2c453d0ff84d5613c90 /src/test/codegen
parent53bf7903fa7ebabca85f5937667956177989e345 (diff)
parent16c3fd9f3d3dd6667c1966d6a62e56bf9deed0fd (diff)
downloadrust-5c71e4ef90ef79c1ac79c4132333cbc80f5b85b9.tar.gz
rust-5c71e4ef90ef79c1ac79c4132333cbc80f5b85b9.zip
Auto merge of #43551 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 8 pull requests

- Successful merges: #43409, #43501, #43509, #43512, #43513, #43536, #43544, #43549
- Failed merges:
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/vec-optimizes-away.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/codegen/vec-optimizes-away.rs b/src/test/codegen/vec-optimizes-away.rs
new file mode 100644
index 00000000000..261564ed51a
--- /dev/null
+++ b/src/test/codegen/vec-optimizes-away.rs
@@ -0,0 +1,21 @@
+// Copyright 2017 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.
+//
+// no-system-llvm
+// compile-flags: -O
+#![crate_type="lib"]
+
+#[no_mangle]
+pub fn sum_me() -> i32 {
+    // CHECK-LABEL: @sum_me
+    // CHECK-NEXT: {{^.*:$}}
+    // CHECK-NEXT: ret i32 6
+    vec![1, 2, 3].iter().sum::<i32>()
+}