aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-c-c++-common
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2021-10-25 20:40:13 +0200
committerTobias Burnus <tobias@codesourcery.com>2021-10-25 20:48:38 +0200
commit72dc270be793f159a3a038bef41542d85550b331 (patch)
tree758facca35e070e59895f6a2ae0d1b66a9036f9b /libgomp/testsuite/libgomp.oacc-c-c++-common
parentc49f389e3dee9f00ffc74de6a8770cd55dc12880 (diff)
downloadgcc-72dc270be793f159a3a038bef41542d85550b331.zip
gcc-72dc270be793f159a3a038bef41542d85550b331.tar.gz
gcc-72dc270be793f159a3a038bef41542d85550b331.tar.bz2
libgomp.oacc-c-c++-common/loop-gwv-2.c: Use __builtin_alloca
Some systems do not have <alloca.h> but provide alloca differently, e.g. via stdlib.h. Do it like other testcases do and use __builtin_alloca. libgomp/ChangeLog: PR testsuite/102910 * testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c: Use __builtin_alloca instead of #include <alloca.h> + alloca.
Diffstat (limited to 'libgomp/testsuite/libgomp.oacc-c-c++-common')
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c
index cb3878b..e73ed60 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c
@@ -6,7 +6,6 @@
#include <stdio.h>
#include <openacc.h>
-#include <alloca.h>
#include <string.h>
#include <gomp-constants.h>
#include <stdlib.h>
@@ -78,9 +77,9 @@ int main ()
vectorsize = __builtin_goacc_parlevel_size (GOMP_DIM_VECTOR);
}
- gangdist = (int *) alloca (gangsize * sizeof (int));
- workerdist = (int *) alloca (workersize * sizeof (int));
- vectordist = (int *) alloca (vectorsize * sizeof (int));
+ gangdist = (int *) __builtin_alloca (gangsize * sizeof (int));
+ workerdist = (int *) __builtin_alloca (workersize * sizeof (int));
+ vectordist = (int *) __builtin_alloca (vectorsize * sizeof (int));
memset (gangdist, 0, gangsize * sizeof (int));
memset (workerdist, 0, workersize * sizeof (int));
memset (vectordist, 0, vectorsize * sizeof (int));