mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-31 01:35:11 +02:00
Expand -fzero-call-used-regs test to cover gcc 11.
It turns out that gcc also has some problems with -fzero-call-used-regs, at least v11 on mips. Previously the test in OSSH_CHECK_CFLAG_COMPILE was sufficient to catch it with "=all", but not sufficient for "=used". Expand the testcase and include it in the other tests for good measure. See bz#3629. ok djm@.
This commit is contained in:
parent
ff220d4010
commit
99a2df5e19
@ -15,7 +15,7 @@ AC_DEFUN([OSSH_CHECK_CFLAG_COMPILE], [{
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
/* Trivial function to help test for -fzero-call-used-regs */
|
/* Trivial function to help test for -fzero-call-used-regs */
|
||||||
void f(int n) {}
|
int f(int n) {return rand() % n;}
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
(void)argv;
|
(void)argv;
|
||||||
/* Some math to catch -ftrapv problems in the toolchain */
|
/* Some math to catch -ftrapv problems in the toolchain */
|
||||||
@ -65,6 +65,8 @@ AC_DEFUN([OSSH_CHECK_CFLAG_LINK], [{
|
|||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
/* Trivial function to help test for -fzero-call-used-regs */
|
||||||
|
int f(int n) {return rand() % n;}
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
(void)argv;
|
(void)argv;
|
||||||
/* Some math to catch -ftrapv problems in the toolchain */
|
/* Some math to catch -ftrapv problems in the toolchain */
|
||||||
@ -73,6 +75,7 @@ int main(int argc, char **argv) {
|
|||||||
double m = l / 0.5;
|
double m = l / 0.5;
|
||||||
long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
|
long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
|
||||||
long long int p = n * o;
|
long long int p = n * o;
|
||||||
|
f(0);
|
||||||
printf("%d %d %d %f %f %lld %lld %lld\n", i, j, k, l, m, n, o, p);
|
printf("%d %d %d %f %f %lld %lld %lld\n", i, j, k, l, m, n, o, p);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
@ -104,6 +107,8 @@ AC_DEFUN([OSSH_CHECK_LDFLAG_LINK], [{
|
|||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
/* Trivial function to help test for -fzero-call-used-regs */
|
||||||
|
int f(int n) {return rand() % n;}
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
(void)argv;
|
(void)argv;
|
||||||
/* Some math to catch -ftrapv problems in the toolchain */
|
/* Some math to catch -ftrapv problems in the toolchain */
|
||||||
@ -112,6 +117,7 @@ int main(int argc, char **argv) {
|
|||||||
double m = l / 0.5;
|
double m = l / 0.5;
|
||||||
long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
|
long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
|
||||||
long long p = n * o;
|
long long p = n * o;
|
||||||
|
f(0);
|
||||||
printf("%d %d %d %f %f %lld %lld %lld\n", i, j, k, l, m, n, o, p);
|
printf("%d %d %d %f %f %lld %lld %lld\n", i, j, k, l, m, n, o, p);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user