Skip to content

Commit

Permalink
Remove the slice from alloca-inside-if-false
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin authored Sep 21, 2024
1 parent 2d18a8c commit 338965b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/codegen/no-alloca-inside-if-false.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
fn test<const SIZE: usize>() {
// CHECK-LABEL: no_alloca_inside_if_false::test
// CHECK: start:
// CHECK-NEXT: alloca [{{8|16}} x i8]
// CHECK-NEXT: alloca [{{12|24}} x i8]
// CHECK-NOT: alloca
if const { SIZE < 4096 } {
let arr = [0u8; SIZE];
std::hint::black_box(&arr);
std::hint::black_box(arr);
} else {
let vec = vec![0u8; SIZE];
std::hint::black_box(&vec);
std::hint::black_box(vec);
}
}

Expand Down

0 comments on commit 338965b

Please sign in to comment.