diff options
| author | The Miri Conjob Bot <miri@cron.bot> | 2024-01-05 05:12:56 +0000 |
|---|---|---|
| committer | The Miri Conjob Bot <miri@cron.bot> | 2024-01-05 05:12:56 +0000 |
| commit | d11a2bdc1de415c16fd9cbf886aecf22f9cc4a4a (patch) | |
| tree | 4b530857b40a0aaf12b8855289f5a65cd7d8eb73 /tests/codegen | |
| parent | 4c4c6a6de31e1018e718fd68616b4fa989457230 (diff) | |
| parent | a59a98024e3fe317e37e218392f5c34e932b2394 (diff) | |
| download | rust-d11a2bdc1de415c16fd9cbf886aecf22f9cc4a4a.tar.gz rust-d11a2bdc1de415c16fd9cbf886aecf22f9cc4a4a.zip | |
Merge from rustc
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/abi-main-signature-32bit-c-int.rs | 2 | ||||
| -rw-r--r-- | tests/codegen/inherit_overflow.rs | 2 | ||||
| -rw-r--r-- | tests/codegen/maybeuninit-rvo.rs | 33 | ||||
| -rw-r--r-- | tests/codegen/sparc-struct-abi.rs | 2 |
4 files changed, 36 insertions, 3 deletions
diff --git a/tests/codegen/abi-main-signature-32bit-c-int.rs b/tests/codegen/abi-main-signature-32bit-c-int.rs index 34571823f13..771ca66daf8 100644 --- a/tests/codegen/abi-main-signature-32bit-c-int.rs +++ b/tests/codegen/abi-main-signature-32bit-c-int.rs @@ -8,4 +8,4 @@ fn main() { } -// CHECK: define{{( hidden)?}} i32 @main(i32{{( %0)?}}, ptr{{( %1)?}}) +// CHECK: define{{( hidden| noundef)*}} i32 @main(i32{{( %0)?}}, ptr{{( %1)?}}) diff --git a/tests/codegen/inherit_overflow.rs b/tests/codegen/inherit_overflow.rs index 39909d7abfd..fa9ee0ae12a 100644 --- a/tests/codegen/inherit_overflow.rs +++ b/tests/codegen/inherit_overflow.rs @@ -1,4 +1,4 @@ -// compile-flags: -Zmir-enable-passes=+Inline,+ConstProp --crate-type lib +// compile-flags: -Zmir-enable-passes=+Inline,+GVN --crate-type lib // revisions: ASSERT NOASSERT //[ASSERT] compile-flags: -Coverflow-checks=on //[NOASSERT] compile-flags: -Coverflow-checks=off diff --git a/tests/codegen/maybeuninit-rvo.rs b/tests/codegen/maybeuninit-rvo.rs new file mode 100644 index 00000000000..feed513e1fb --- /dev/null +++ b/tests/codegen/maybeuninit-rvo.rs @@ -0,0 +1,33 @@ +// compile-flags: -O +#![feature(c_unwind)] +#![crate_type = "lib"] + +pub struct Foo([u8; 1000]); + +extern "C" { + fn init(p: *mut Foo); +} + +pub fn new_from_uninit() -> Foo { + // CHECK-LABEL: new_from_uninit + // CHECK-NOT: call void @llvm.memcpy. + let mut x = std::mem::MaybeUninit::uninit(); + unsafe { + init(x.as_mut_ptr()); + x.assume_init() + } +} + +extern "C-unwind" { + fn init_unwind(p: *mut Foo); +} + +pub fn new_from_uninit_unwind() -> Foo { + // CHECK-LABEL: new_from_uninit + // CHECK: call void @llvm.memcpy. + let mut x = std::mem::MaybeUninit::uninit(); + unsafe { + init_unwind(x.as_mut_ptr()); + x.assume_init() + } +} diff --git a/tests/codegen/sparc-struct-abi.rs b/tests/codegen/sparc-struct-abi.rs index e8816e4f303..b94ef79aec7 100644 --- a/tests/codegen/sparc-struct-abi.rs +++ b/tests/codegen/sparc-struct-abi.rs @@ -18,7 +18,7 @@ pub struct Bool { b: bool, } -// CHECK: define i64 @structbool() +// CHECK: define{{.*}} i64 @structbool() // CHECK-NEXT: start: // CHECK-NEXT: ret i64 72057594037927936 #[no_mangle] |
