]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-34427.rs
Add 'library/portable-simd/' from commit '1ce1c645cf27c4acdefe6ec8a11d1f0491954a99'
[rust.git] / src / test / ui / issues / issue-34427.rs
1 // run-pass
2 // Issue #34427: On ARM, the code in `foo` at one time was generating
3 // a machine code instruction of the form: `str r0, [r0, rN]!` (for
4 // some N), which is not legal because the source register and base
5 // register cannot be identical in the preindexed form signalled by
6 // the `!`.
7 //
8 // See LLVM bug: https://llvm.org/bugs/show_bug.cgi?id=28809
9
10 #[inline(never)]
11 fn foo(n: usize) -> Vec<Option<(*mut (), &'static ())>> {
12     (0..n).map(|_| None).collect()
13 }
14
15 fn main() {
16     let _ = (foo(10), foo(32));
17 }