Set num_threads to 50 on 32-bit hppa in two libgomp loop tests
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / acc_map_data-device_already-2.c
blob4fe0662cabbf2a9775dd60c9684cec56ad8f3233
1 /* Verify that we refuse 'acc_map_data' when the "device address [...] is
2 already mapped". */
4 /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
6 #include <assert.h>
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <openacc.h>
11 int
12 main ()
14 const int N = 132;
16 char *h1 = (char *) malloc (N);
17 assert (h1);
18 void *d = acc_create (h1, N);
19 assert (d);
21 char *h2 = (char *) malloc (N);
22 assert (h2);
23 /* Try to arrange a setting such that a later 'acc_unmap_data' would find the
24 device memory object still referenced elsewhere. This is not possible,
25 given the semantics of 'acc_map_data'. */
26 fprintf (stderr, "CheCKpOInT\n");
27 acc_map_data (h2, d, N);
29 return 0;
33 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
34 /* { dg-output "device address \\\[\[0-9a-fA-FxX\]+, \\\+132\\\] is already mapped" } */
35 /* { dg-shouldfail "" } */