Skip to content

Commit 75ca1ea

Browse files
Add codegen test
1 parent 6d83110 commit 75ca1ea

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

tests/codegen/function-arguments.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// compile-flags: -O -C no-prepopulate-passes
22

33
#![crate_type = "lib"]
4+
#![feature(dyn_star)]
45

56
use std::mem::MaybeUninit;
67
use std::num::NonZeroU64;
@@ -279,3 +280,9 @@ pub fn enum_id_1(x: Option<Result<u16, u16>>) -> Option<Result<u16, u16>> {
279280
pub fn enum_id_2(x: Option<u8>) -> Option<u8> {
280281
x
281282
}
283+
284+
// CHECK: { {{i8\*|ptr}}, {{i.*\*|ptr}} } @dyn_star({{i8\*|ptr}} noundef %x.0, {{i.*\*|ptr}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %x.1)
285+
#[no_mangle]
286+
pub fn dyn_star(x: dyn* Drop) -> dyn* Drop {
287+
x
288+
}

tests/ui/llvm-old-style-ptrs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
// This test can be removed once non-opaque pointers are gone from LLVM, maybe.
99

10-
#![feature(dyn_star, pointer_sized_trait)]
10+
#![feature(dyn_star, pointer_like_trait)]
1111
#![allow(incomplete_features)]
1212

1313
use std::fmt::Debug;
14-
use std::marker::PointerSized;
14+
use std::marker::PointerLike;
1515

16-
fn make_dyn_star<'a>(t: impl PointerSized + Debug + 'a) -> dyn* Debug + 'a {
16+
fn make_dyn_star<'a>(t: impl PointerLike + Debug + 'a) -> dyn* Debug + 'a {
1717
t as _
1818
}
1919

0 commit comments

Comments
 (0)