Sign-extension is not guaranteed by the ABI, and thus the callee cannot assume
it.
This fixes PR44228 and PR12207.
With these changes, there are still two tests that need updating:
- CodeGenObjC/optimized-setter.m fails with:
clang: llvm/lib/IR/Instructions.cpp:400: void llvm::CallInst::init(llvm::FunctionType *, llvm::Value *, ArrayRef<llvm::Value *>, ArrayRef<llvm::OperandBundleDef>, const llvm::Twine &): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed.
- OpenMP/parallel_for_simd_codegen.cpp fails with:
clang: clang/lib/CodeGen/CGCall.cpp:3858: clang::CodeGen::RValue clang::CodeGen::CodeGenFunction::EmitCall(const clang::CodeGen::CGFunctionInfo &, const clang::CodeGen::CGCallee &, clang::CodeGen::ReturnValueSlot, const clang::CodeGen::CallArgList &, llvm::CallBase **, clang::SourceLocation): Assertion `IRFuncTy == TypeFromVal' failed.
These two are probably bad assumptions in some of the ObjC / OpenMP-specific
code, but I want to check this patch is on the right track before digging more.
This test was originally added for x86_64, see the bug:
https://bugs.llvm.org/show_bug.cgi?id=1513
It needs to be updated.