cleanup: handle -Zmutable-noalias like -Zbox-noalias
This commit is contained in:
parent
c7572670a1
commit
d165a6d708
4 changed files with 31 additions and 28 deletions
23
src/test/codegen/noalias-flag.rs
Normal file
23
src/test/codegen/noalias-flag.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// compile-flags: -O -Zmutable-noalias=no
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
// `-Zmutable-noalias=no` should disable noalias on mut refs...
|
||||
|
||||
// CHECK-LABEL: @test_mut_ref(
|
||||
// CHECK-NOT: noalias
|
||||
// CHECK-SAME: %x
|
||||
#[no_mangle]
|
||||
pub fn test_mut_ref(x: &mut i32) -> &mut i32 {
|
||||
x
|
||||
}
|
||||
|
||||
// ...but not on shared refs
|
||||
|
||||
// CHECK-LABEL: @test_ref(
|
||||
// CHECK-SAME: noalias
|
||||
// CHECK-SAME: %x
|
||||
#[no_mangle]
|
||||
pub fn test_ref(x: &i32) -> &i32 {
|
||||
x
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue