]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #97800 - pnkfelix:issue-97463-fix-aarch64-call-abi-does-not-zeroext...
authorbors <bors@rust-lang.org>
Fri, 16 Sep 2022 20:08:05 +0000 (20:08 +0000)
committerbors <bors@rust-lang.org>
Fri, 16 Sep 2022 20:08:05 +0000 (20:08 +0000)
Aarch64 call abi does not zeroext (and one cannot assume it does so)

Fix #97463

1  2 
compiler/rustc_target/src/abi/call/aarch64.rs
compiler/rustc_target/src/abi/call/mod.rs
compiler/rustc_target/src/spec/mod.rs
src/test/codegen/pic-relocation-model.rs

index 8a5ad90db71f555041b4c45eab93759d884302e6,e88c0cdf0ec3c221eb828aefadf8ec57050920cb..a84988fa75c6dd79279f954c7c56528f0b64cfcb
@@@ -74,10 -101,10 +101,10 @@@ wher
      C: HasDataLayout,
  {
      if !fn_abi.ret.is_ignore() {
-         classify_ret(cx, &mut fn_abi.ret);
+         classify_ret(cx, &mut fn_abi.ret, param_policy);
      }
  
 -    for arg in &mut fn_abi.args {
 +    for arg in fn_abi.args.iter_mut() {
          if arg.is_ignore() {
              continue;
          }
Simple merge
index bcfe2f9af50bdeab63b71f70a655935165490c65,9b378ecb4e590651cc7b8b8a41a11c957160fcd1..602a08067bae183cd1e489d24e3801d052421017
@@@ -10,7 -10,10 +10,10 @@@ pub fn call_foreign_fn() -> u8 
      }
  }
  
- // CHECK: declare zeroext i8 @foreign_fn()
+ // (Allow but do not require `zeroext` here, because it is not worth effort to
+ // spell out which targets have it and which ones do not; see rust#97800.)
+ // CHECK: declare{{( zeroext)?}} i8 @foreign_fn()
  extern "C" {fn foreign_fn() -> u8;}
  
 -// CHECK: !{i32 7, !"PIC Level", i32 2}
 +// CHECK: !{i32 {{[78]}}, !"PIC Level", i32 2}