diff --git a/src/llvm b/src/llvm index 2e951c3ae354b..2e83dcc24a703 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit 2e951c3ae354bcbd2e50b30798e232949a926b75 +Subproject commit 2e83dcc24a7030af0563b4fec9461bee262f5b7e diff --git a/src/rustllvm/llvm-rebuild-trigger b/src/rustllvm/llvm-rebuild-trigger index c8732e27b8252..b613dd3284521 100644 --- a/src/rustllvm/llvm-rebuild-trigger +++ b/src/rustllvm/llvm-rebuild-trigger @@ -1,4 +1,4 @@ # If this file is modified, then llvm will be (optionally) cleaned and then rebuilt. # The actual contents of this file do not matter, but to trigger a change on the # build bots then the contents should be changed so git updates the mtime. -2017-03-23 +2017-03-28 diff --git a/src/test/codegen/no-extra-null-check-on-iterator.rs b/src/test/codegen/no-extra-null-check-on-iterator.rs new file mode 100644 index 0000000000000..636acb9c0b8a7 --- /dev/null +++ b/src/test/codegen/no-extra-null-check-on-iterator.rs @@ -0,0 +1,31 @@ +// 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -O + +// See issue #37945. + +#![crate_type = "lib"] + +use std::slice::Iter; + +// CHECK-LABEL: @is_empty_1 +#[no_mangle] +pub fn is_empty_1(xs: Iter) -> bool { +// CHECK-NOT: icmp eq float* {{.*}}, null + {xs}.next().is_none() +} + +// CHECK-LABEL: @is_empty_2 +#[no_mangle] +pub fn is_empty_2(xs: Iter) -> bool { +// CHECK-NOT: icmp eq float* {{.*}}, null + xs.map(|&x| x).next().is_none() +}