Skip to content

Commit bd52ff1

Browse files
committed
update LLVM with fix for PR32379
Fixes #40593.
1 parent 90346ea commit bd52ff1

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed

src/rustllvm/llvm-rebuild-trigger

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# If this file is modified, then llvm will be (optionally) cleaned and then rebuilt.
22
# The actual contents of this file do not matter, but to trigger a change on the
33
# build bots then the contents should be changed so git updates the mtime.
4-
2017-03-19
4+
2017-03-23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub fn pr32379(mut data: u64, f1: bool, f2: bool) -> u64 {
12+
if f1 { data &= !2; }
13+
if f2 { data |= 2; }
14+
data
15+
}

src/test/run-pass/llvm-pr32379.rs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// aux-build:llvm_pr32379.rs
12+
13+
// LLVM PR #32379 (https://bugs.llvm.org/show_bug.cgi?id=32379), which
14+
// applies to upstream LLVM 3.9.1, is known to cause rustc itself to be
15+
// miscompiled on ARM (Rust issue #40593). Because cross builds don't test
16+
// our *compiler* on ARM, have a test for the miscompilation directly.
17+
18+
extern crate llvm_pr32379;
19+
20+
pub fn main() {
21+
let val = llvm_pr32379::pr32379(2, false, false);
22+
assert_eq!(val, 2);
23+
}

0 commit comments

Comments
 (0)