diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/codegen/issues/issue-37945.rs | 1 | ||||
| -rw-r--r-- | tests/codegen/virtual-function-elimination.rs | 1 | ||||
| -rw-r--r-- | tests/mir-opt/inline/inline_into_box_place.main.Inline.diff | 8 | ||||
| -rw-r--r-- | tests/mir-opt/inline/inline_into_box_place.rs | 1 | ||||
| -rw-r--r-- | tests/run-make/fmt-write-bloat/Makefile | 4 | ||||
| -rw-r--r-- | tests/ui/mir/mir_alignment_check.rs | 11 |
6 files changed, 20 insertions, 6 deletions
diff --git a/tests/codegen/issues/issue-37945.rs b/tests/codegen/issues/issue-37945.rs index fe54375bbf6..19e7e8b1f6e 100644 --- a/tests/codegen/issues/issue-37945.rs +++ b/tests/codegen/issues/issue-37945.rs @@ -4,6 +4,7 @@ // ignore-emscripten // ignore-gnux32 // ignore 32-bit platforms (LLVM has a bug with them) +// ignore-debug // Check that LLVM understands that `Iter` pointer is not null. Issue #37945. diff --git a/tests/codegen/virtual-function-elimination.rs b/tests/codegen/virtual-function-elimination.rs index 4cf7e12fee2..30e5cd0584d 100644 --- a/tests/codegen/virtual-function-elimination.rs +++ b/tests/codegen/virtual-function-elimination.rs @@ -1,5 +1,6 @@ // compile-flags: -Zvirtual-function-elimination -Clto -O -Csymbol-mangling-version=v0 // ignore-32bit +// ignore-debug // CHECK: @vtable.0 = {{.*}}, !type ![[TYPE0:[0-9]+]], !vcall_visibility ![[VCALL_VIS0:[0-9]+]] // CHECK: @vtable.1 = {{.*}}, !type ![[TYPE1:[0-9]+]], !vcall_visibility ![[VCALL_VIS0:[0-9]+]] diff --git a/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff b/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff index bc1c913c00e..a4f0ad465e2 100644 --- a/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff +++ b/tests/mir-opt/inline/inline_into_box_place.main.Inline.diff @@ -8,10 +8,10 @@ scope 1 { debug _x => _1; // in scope 1 at $DIR/inline_into_box_place.rs:+1:9: +1:11 } -+ scope 2 (inlined Vec::<u32>::new) { // at $DIR/inline_into_box_place.rs:7:38: 7:48 ++ scope 2 (inlined Vec::<u32>::new) { // at $DIR/inline_into_box_place.rs:8:38: 8:48 + let mut _3: alloc::raw_vec::RawVec<u32>; // in scope 2 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + } -+ scope 3 (inlined Box::<Vec<u32>>::new) { // at $DIR/inline_into_box_place.rs:7:29: 7:49 ++ scope 3 (inlined Box::<Vec<u32>>::new) { // at $DIR/inline_into_box_place.rs:8:29: 8:49 + debug x => _2; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL + let mut _4: usize; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL + let mut _5: usize; // in scope 3 at $SRC_DIR/alloc/src/boxed.rs:LL:COL @@ -28,7 +28,7 @@ + StorageLive(_3); // scope 2 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + _3 = const _; // scope 2 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL // mir::Constant -- // + span: $DIR/inline_into_box_place.rs:7:38: 7:46 +- // + span: $DIR/inline_into_box_place.rs:8:38: 8:46 - // + user_ty: UserType(2) - // + literal: Const { ty: fn() -> Vec<u32> {Vec::<u32>::new}, val: Value(<ZST>) } + // + span: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL @@ -47,7 +47,7 @@ bb1: { - _1 = Box::<Vec<u32>>::new(move _2) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline_into_box_place.rs:+1:29: +1:49 - // mir::Constant -- // + span: $DIR/inline_into_box_place.rs:7:29: 7:37 +- // + span: $DIR/inline_into_box_place.rs:8:29: 8:37 - // + user_ty: UserType(1) - // + literal: Const { ty: fn(Vec<u32>) -> Box<Vec<u32>> {Box::<Vec<u32>>::new}, val: Value(<ZST>) } + StorageDead(_1); // scope 0 at $DIR/inline_into_box_place.rs:+2:1: +2:2 diff --git a/tests/mir-opt/inline/inline_into_box_place.rs b/tests/mir-opt/inline/inline_into_box_place.rs index b8b73f0c44c..02823e4e1b7 100644 --- a/tests/mir-opt/inline/inline_into_box_place.rs +++ b/tests/mir-opt/inline/inline_into_box_place.rs @@ -1,5 +1,6 @@ // ignore-endian-big // ignore-wasm32-bare compiled with panic=abort by default +// ignore-debug MIR alignment checks in std alter the diff, breaking the test // compile-flags: -Z mir-opt-level=4 // EMIT_MIR inline_into_box_place.main.Inline.diff diff --git a/tests/run-make/fmt-write-bloat/Makefile b/tests/run-make/fmt-write-bloat/Makefile index 07e6e025e08..53615775486 100644 --- a/tests/run-make/fmt-write-bloat/Makefile +++ b/tests/run-make/fmt-write-bloat/Makefile @@ -11,11 +11,11 @@ else NM = nm -PANIC_SYMS = panic_bounds_check pad_integral Display Debug +PANIC_SYMS = panic_bounds_check Debug # Allow for debug_assert!() in debug builds of std. ifdef NO_DEBUG_ASSERTIONS -PANIC_SYMS += panicking panic_fmt +PANIC_SYMS += panicking panic_fmt pad_integral Display Debug endif all: main.rs diff --git a/tests/ui/mir/mir_alignment_check.rs b/tests/ui/mir/mir_alignment_check.rs new file mode 100644 index 00000000000..6c964c78bd1 --- /dev/null +++ b/tests/ui/mir/mir_alignment_check.rs @@ -0,0 +1,11 @@ +// run-fail +// compile-flags: -C debug-assertions +// error-pattern: misaligned pointer dereference: address must be a multiple of 0x4 but is + +fn main() { + let mut x = [0u32; 2]; + let ptr: *mut u8 = x.as_mut_ptr().cast::<u8>(); + unsafe { + *(ptr.add(1).cast::<u32>()) = 42; + } +} |
