mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Rollup merge of #125222 - Oneirical:fifth, r=jieyouxu
Migrate `run-make/issue-46239` to `rmake` Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).
This commit is contained in:
commit
f131ee6561
@ -111,7 +111,6 @@ run-make/issue-37839/Makefile
|
||||
run-make/issue-37893/Makefile
|
||||
run-make/issue-38237/Makefile
|
||||
run-make/issue-40535/Makefile
|
||||
run-make/issue-46239/Makefile
|
||||
run-make/issue-47384/Makefile
|
||||
run-make/issue-47551/Makefile
|
||||
run-make/issue-51671/Makefile
|
||||
|
21
tests/codegen/noalias-freeze.rs
Normal file
21
tests/codegen/noalias-freeze.rs
Normal file
@ -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))();
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
# ignore-cross-compile
|
||||
include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) main.rs -C opt-level=1
|
||||
$(call RUN,main)
|
@ -1,8 +0,0 @@
|
||||
fn project<T>(x: &(T,)) -> &T { &x.0 }
|
||||
|
||||
fn dummy() {}
|
||||
|
||||
fn main() {
|
||||
let f = (dummy as fn(),);
|
||||
(*project(&f))();
|
||||
}
|
Loading…
Reference in New Issue
Block a user