Skip to content

Commit 871f89d

Browse files
committed
attempt codegen test conversion
1 parent 46091b0 commit 871f89d

File tree

3 files changed

+17
-22
lines changed

3 files changed

+17
-22
lines changed

tests/codegen/noalias-freeze.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//@ compile-flags: -Copt-level=1
2+
3+
// References returned by a Frozen pointer type
4+
// could be marked as "noalias", which caused miscompilation errors.
5+
// This test runs the most minimal possible code that can reproduce this bug,
6+
// and checks that noalias does not appear.
7+
// See https://github.com/rust-lang/rust/issues/46239
8+
9+
fn project<T>(x: &(T,)) -> &T { &x.0 }
10+
11+
fn dummy() {}
12+
13+
// CHECK-NOT: noalias
14+
fn main() {
15+
let f = (dummy as fn(),);
16+
(*project(&f))();
17+
}

tests/run-make/no-mark-noalias/main.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/run-make/no-mark-noalias/rmake.rs

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)