]>
Commit | Line | Data |
---|---|---|
5bcae85e SL |
1 | // Copyright 2016 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 | // Issue #34427: On ARM, the code in `foo` at one time was generating | |
12 | // a machine code instruction of the form: `str r0, [r0, rN]!` (for | |
13 | // some N), which is not legal because the source register and base | |
14 | // register cannot be identical in the preindexed form signalled by | |
15 | // the `!`. | |
16 | // | |
17 | // See LLVM bug: https://llvm.org/bugs/show_bug.cgi?id=28809 | |
18 | ||
19 | #[inline(never)] | |
20 | fn foo(n: usize) -> Vec<Option<(*mut (), &'static ())>> { | |
21 | (0..n).map(|_| None).collect() | |
22 | } | |
23 | ||
24 | fn main() { | |
25 | let _ = (foo(10), foo(32)); | |
26 | } |