diff options
| author | burlinchen <chenbeiliuhuo@gmail.com> | 2024-08-10 10:44:24 +0800 |
|---|---|---|
| committer | burlinchen <chenbeiliuhuo@gmail.com> | 2024-08-10 10:44:24 +0800 |
| commit | 3dc083dfd80d0436560c34c41be815b88510ffdc (patch) | |
| tree | 9def2a84affe5b099087aec65d3ab84dad206ab4 /tests/codegen/common_prim_int_ptr.rs | |
| parent | bca0c5f2a939999dcb8d83d06a793f39f4815736 (diff) | |
| download | rust-3dc083dfd80d0436560c34c41be815b88510ffdc.tar.gz rust-3dc083dfd80d0436560c34c41be815b88510ffdc.zip | |
test(std): Add codegen test for array::from_fn optimization
This commit adds a new test file 'array-from_fn.rs' to the codegen test suite. The test checks the behavior of std::array::from_fn under different optimization levels: 1. At opt-level=0 (debug build), it verifies that the core::array::Guard is present in the generated code. 2. At opt-level=s (size optimization), it ensures that the Guard is optimized out. This test helps ensure that the compiler correctly optimizes array::from_fn calls in release builds while maintaining safety checks in debug builds.
Diffstat (limited to 'tests/codegen/common_prim_int_ptr.rs')
0 files changed, 0 insertions, 0 deletions
