diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2021-11-13 11:58:09 +0000 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2021-11-15 19:28:07 +0000 |
commit | bd5159bdd4f26ea6e01c1411149e8e2eaec62531 (patch) | |
tree | 621ca4bc9a8865ab0c0176f1ca207d852bab2ea9 /gcc | |
parent | b7f0147833a302d654bf95a9c89f77c7ba4c7148 (diff) | |
download | gcc-bd5159bdd4f26ea6e01c1411149e8e2eaec62531.zip gcc-bd5159bdd4f26ea6e01c1411149e8e2eaec62531.tar.gz gcc-bd5159bdd4f26ea6e01c1411149e8e2eaec62531.tar.bz2 |
testsuite, Darwin: In tsvc.h, use malloc for Darwin <= 9.
Earlier Darwin versions fdo not have posix_memalign() but the
malloc implementation is guaranteed to produce memory suitably
aligned for the largest vector type.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/testsuite/ChangeLog:
* gcc.dg/vect/tsvc/tsvc.h: Use malloc for Darwin 9 and
earlier.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h index 63ea1e2..665ca74 100644 --- a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h +++ b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h @@ -193,8 +193,16 @@ void init(int** ip, real_t* s1, real_t* s2){ xx = (real_t*) memalign(ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t)); *ip = (int *) memalign(ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t)); #else +# if defined (__APPLE__) \ + && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1060 + /* We have no aligned allocator, but malloc is guaranteed to return + alignment suitable for the largest vector item. */ + xx = (real_t*) malloc (LEN_1D*sizeof(real_t)); + *ip = (int *) malloc (LEN_1D*sizeof(real_t)); +# else posix_memalign ((void*)&xx, ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t)); posix_memalign ((void*)ip, ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t)); +# endif #endif for (int i = 0; i < LEN_1D; i = i+5){ |