Skip to content

Commit 7a1c06f

Browse files
committed
attempt codegen test conversion
1 parent 46091b0 commit 7a1c06f

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

tests/codegen/noalias-freeze.rs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
#![crate_type = "lib"]
10+
11+
fn project<T>(x: &(T,)) -> &T { &x.0 }
12+
13+
fn dummy() {}
14+
15+
// CHECK-LABEL: @foo(
16+
// CHECK-NOT: noalias
17+
#[no_mangle]
18+
pub fn foo() {
19+
let f = (dummy as fn(),);
20+
(*project(&f))();
21+
}

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

-8
This file was deleted.

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

-14
This file was deleted.

0 commit comments

Comments
 (0)