diff options
| author | bors <bors@rust-lang.org> | 2023-06-28 07:13:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-06-28 07:13:12 +0000 |
| commit | 984d29d26069590786b47424c8ca205e4f4560cb (patch) | |
| tree | a400dcb280046d1e426076bd25df1b468aebe6b5 /tests/codegen | |
| parent | 662388e17fe4f3a4252f63fd84c05cfd54cc13a0 (diff) | |
| parent | de9dc5916456f441286c35452416a3dec0b4c2c0 (diff) | |
| download | rust-984d29d26069590786b47424c8ca205e4f4560cb.tar.gz rust-984d29d26069590786b47424c8ca205e4f4560cb.zip | |
Auto merge of #2944 - oli-obk:rustup, r=oli-obk
Rustup
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/issues/issue-111603.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/codegen/issues/issue-111603.rs b/tests/codegen/issues/issue-111603.rs index 90b3c314d2f..06429ed3fa9 100644 --- a/tests/codegen/issues/issue-111603.rs +++ b/tests/codegen/issues/issue-111603.rs @@ -5,6 +5,18 @@ use std::sync::Arc; +// CHECK-LABEL: @new_from_array +#[no_mangle] +pub fn new_from_array(x: u64) -> Arc<[u64]> { + // Ensure that we only generate one alloca for the array. + + // CHECK: alloca + // CHECK-SAME: [1000 x i64] + // CHECK-NOT: alloca + let array = [x; 1000]; + Arc::new(array) +} + // CHECK-LABEL: @new_uninit #[no_mangle] pub fn new_uninit(x: u64) -> Arc<[u64; 1000]> { |
