From bd52ff1cc3ff9ecce129d20ed56c61ec0b0c5653 Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Fri, 24 Mar 2017 00:52:46 +0200 Subject: [PATCH] update LLVM with fix for PR32379 Fixes #40593. --- src/llvm | 2 +- src/rustllvm/llvm-rebuild-trigger | 2 +- src/test/run-pass/auxiliary/llvm_pr32379.rs | 15 ++++++++++++++ src/test/run-pass/llvm-pr32379.rs | 23 +++++++++++++++++++++ 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 src/test/run-pass/auxiliary/llvm_pr32379.rs create mode 100644 src/test/run-pass/llvm-pr32379.rs diff --git a/src/llvm b/src/llvm index d5ef27a79661d..2e951c3ae354b 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit d5ef27a79661d4f0d57d7b7d2cdbe9204f790a4a +Subproject commit 2e951c3ae354bcbd2e50b30798e232949a926b75 diff --git a/src/rustllvm/llvm-rebuild-trigger b/src/rustllvm/llvm-rebuild-trigger index be6d535dc732b..c8732e27b8252 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-19 +2017-03-23 diff --git a/src/test/run-pass/auxiliary/llvm_pr32379.rs b/src/test/run-pass/auxiliary/llvm_pr32379.rs new file mode 100644 index 0000000000000..a7b15bda33627 --- /dev/null +++ b/src/test/run-pass/auxiliary/llvm_pr32379.rs @@ -0,0 +1,15 @@ +// 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. + +pub fn pr32379(mut data: u64, f1: bool, f2: bool) -> u64 { + if f1 { data &= !2; } + if f2 { data |= 2; } + data +} diff --git a/src/test/run-pass/llvm-pr32379.rs b/src/test/run-pass/llvm-pr32379.rs new file mode 100644 index 0000000000000..5625e81c0e63c --- /dev/null +++ b/src/test/run-pass/llvm-pr32379.rs @@ -0,0 +1,23 @@ +// 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. + +// aux-build:llvm_pr32379.rs + +// LLVM PR #32379 (https://bugs.llvm.org/show_bug.cgi?id=32379), which +// applies to upstream LLVM 3.9.1, is known to cause rustc itself to be +// miscompiled on ARM (Rust issue #40593). Because cross builds don't test +// our *compiler* on ARM, have a test for the miscompilation directly. + +extern crate llvm_pr32379; + +pub fn main() { + let val = llvm_pr32379::pr32379(2, false, false); + assert_eq!(val, 2); +}