]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-34427.rs
Merge commit '97e504549371d7640cf011d266e3c17394fdddac' into sync_cg_clif-2021-12-20
[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 }