comparison gcc/testsuite/c-c++-common/cilk-plus/CK/cilk_for_ptr_iter.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* { dg-do run } */
2 /* { dg-require-effective-target cilkplus_runtime } */
3 /* { dg-options "-fcilkplus" } */
4 /* { dg-additional-options "-std=gnu99" { target c } } */
5
6
7
8 /* <feature> loop control variable must have integer, pointer or class type
9 </feature>
10 */
11
12 #define ARRAY_SIZE 10000
13 int a[ARRAY_SIZE];
14
15 int main(void)
16 {
17 int ii = 0;
18
19 for (ii =0; ii < ARRAY_SIZE; ii++)
20 a[ii] = 5;
21 _Cilk_for(int *aa = a; aa < a + ARRAY_SIZE; aa++)
22 *aa = 0;
23 for (ii = 0; ii < ARRAY_SIZE; ii++)
24 if (a[ii] != 0)
25 __builtin_abort ();
26
27 _Cilk_for (int *aa = a; aa < a + ARRAY_SIZE; aa = aa + 2)
28 *aa = 4;
29
30 for (ii = 0; ii < ARRAY_SIZE; ii = ii + 2)
31 if (a[ii] != 4)
32 __builtin_abort ();
33
34 return 0;
35 }