Skip to content

Commit

Permalink
attempt codegen test conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed May 23, 2024
1 parent 46091b0 commit 7a1c06f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
21 changes: 21 additions & 0 deletions tests/codegen/noalias-freeze.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//@ compile-flags: -Copt-level=1

// References returned by a Frozen pointer type
// could be marked as "noalias", which caused miscompilation errors.
// This test runs the most minimal possible code that can reproduce this bug,
// and checks that noalias does not appear.
// See https://github.com/rust-lang/rust/issues/46239

#![crate_type = "lib"]

fn project<T>(x: &(T,)) -> &T { &x.0 }

fn dummy() {}

// CHECK-LABEL: @foo(
// CHECK-NOT: noalias
#[no_mangle]
pub fn foo() {
let f = (dummy as fn(),);
(*project(&f))();
}
8 changes: 0 additions & 8 deletions tests/run-make/no-mark-noalias/main.rs

This file was deleted.

14 changes: 0 additions & 14 deletions tests/run-make/no-mark-noalias/rmake.rs

This file was deleted.

0 comments on commit 7a1c06f

Please sign in to comment.