repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Set num_threads to 50 on 32-bit hppa in two libgomp loop tests
[official-gcc.git]
/
libgomp
/
testsuite
/
libgomp.c-c++-common
/
array-field-1.c
blob
6dd8b5c48e1ec1c0109dbdc5493520df92d2cb1a
1
/* { dg-do run } */
2
3
#include <stdlib.h>
4
#include <string.h>
5
#include <assert.h>
6
7
#define N 16
8
9
struct
Z
{
10
int
*
ptr
;
11
int
arr
[
N
];
12
int
c
;
13
};
14
15
int
main
(
int
argc
,
char
*
argv
[])
16
{
17
struct
Z
*
myz
;
18
myz
= (
struct
Z
*)
calloc
(
1
,
sizeof
*
myz
);
19
20
#pragma omp target map(tofrom:myz->arr[0:N], myz->c)
21
{
22
for
(
int
i
=
0
;
i
<
N
;
i
++)
23
myz
->
arr
[
i
]++;
24
myz
->
c
++;
25
}
26
27
for
(
int
i
=
0
;
i
<
N
;
i
++)
28
assert
(
myz
->
arr
[
i
] ==
1
);
29
assert
(
myz
->
c
==
1
);
30
31
free
(
myz
);
32
33
return
0
;
34
}
35