Skip to content

Commit

Permalink
FileCheck bad_op_unsafe_oob_for_slices.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Dec 2, 2023
1 parent 97f03cb commit e8e35c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
// skip-filecheck
// unit-test: ConstProp
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR_FOR_EACH_BIT_WIDTH

// EMIT_MIR bad_op_unsafe_oob_for_slices.main.ConstProp.diff
#[allow(unconditional_panic)]
fn main() {
// CHECK-LABEL: fn main(
// CHECK: debug a => [[a:_.*]];
// CHECK: debug _b => [[b:_.*]];
// CHECK: [[b]] = (*[[a]])[3 of 4];
let a: *const [_] = &[1, 2, 3];
unsafe {
let _b = (*a)[3];
Expand Down

0 comments on commit e8e35c8

Please sign in to comment.