From 97f78984f7a6f4b869bc1f1d0b4b5e849835ab76 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 16 Feb 2016 09:58:41 -0800 Subject: [PATCH] rustc: Rebase LLVM on the 3.8 release branch This commit rebases our LLVM submodule on the most recent tip of the `release_38` branch of LLVM. There's been a few fixes and this notably fixes the assertion error in #31702. --- src/llvm | 2 +- src/rustllvm/llvm-auto-clean-trigger | 2 +- src/test/auxiliary/issue-31702-1.rs | 26 ++++++++++++++++++++++++ src/test/auxiliary/issue-31702-2.rs | 30 ++++++++++++++++++++++++++++ src/test/run-pass/issue-31702.rs | 19 ++++++++++++++++++ 5 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 src/test/auxiliary/issue-31702-1.rs create mode 100644 src/test/auxiliary/issue-31702-2.rs create mode 100644 src/test/run-pass/issue-31702.rs diff --git a/src/llvm b/src/llvm index de5c31045dc0f..39e8e59056bcd 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit de5c31045dc0f6da1f65d02ee640ccf99ba90e7c +Subproject commit 39e8e59056bcd84bf9c44d0bcd46ae441567e0a0 diff --git a/src/rustllvm/llvm-auto-clean-trigger b/src/rustllvm/llvm-auto-clean-trigger index 7df7df505cd20..50c32a5915395 100644 --- a/src/rustllvm/llvm-auto-clean-trigger +++ b/src/rustllvm/llvm-auto-clean-trigger @@ -1,4 +1,4 @@ # If this file is modified, then llvm will be forcibly 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. -2015-01-25 +2016-02-16 diff --git a/src/test/auxiliary/issue-31702-1.rs b/src/test/auxiliary/issue-31702-1.rs new file mode 100644 index 0000000000000..50a31630df318 --- /dev/null +++ b/src/test/auxiliary/issue-31702-1.rs @@ -0,0 +1,26 @@ +// Copyright 2016 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. + +#[derive(Copy)] +pub struct U256(pub [u64; 4]); + +impl Clone for U256 { + fn clone(&self) -> U256 { + *self + } +} + +impl U256 { + pub fn new(value: u64) -> U256 { + let mut ret = [0; 4]; + ret[0] = value; + U256(ret) + } +} diff --git a/src/test/auxiliary/issue-31702-2.rs b/src/test/auxiliary/issue-31702-2.rs new file mode 100644 index 0000000000000..c5b1bc6dfb08d --- /dev/null +++ b/src/test/auxiliary/issue-31702-2.rs @@ -0,0 +1,30 @@ +// Copyright 2016 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: -g + +extern crate issue_31702_1; + +use std::collections::HashMap; +use issue_31702_1::U256; + +pub struct Ethash { + engine_params: for<'a> fn() -> Option<&'a Vec>, + u256_params: HashMap, +} + +impl Ethash { + pub fn u256_param(&mut self, name: &str) -> U256 { + let engine = self.engine_params; + *self.u256_params.entry(name.to_owned()).or_insert_with(|| { + engine().map_or(U256::new(0u64), |_a| loop {}) + }) + } +} diff --git a/src/test/run-pass/issue-31702.rs b/src/test/run-pass/issue-31702.rs new file mode 100644 index 0000000000000..89eafa88ee0d1 --- /dev/null +++ b/src/test/run-pass/issue-31702.rs @@ -0,0 +1,19 @@ +// Copyright 2016 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:issue-31702-1.rs +// aux-build:issue-31702-2.rs + +// this test is actually entirely in the linked library crates + +extern crate issue_31702_1; +extern crate issue_31702_2; + +fn main() {}