1 /* { dg-do compile { target cilkplus } } */
2 /* { dg-options "-fcilkplus -floop-nest-optimize -O3" } */
10 int func1 (int *a1
, int *a2
)
12 return __sec_reduce_add (a1
[0:NUMBER
] * a2
[0:NUMBER
:1]);
15 int func2 (int *a1
, int *a2
)
17 return (__sec_reduce_add (a1
[0:NUMBER
] * a2
[0:NUMBER
]) +
18 __sec_reduce_mul (a1
[0:NUMBER
] + a2
[0:NUMBER
]));
21 int func3 (int *a1
, int *a2
)
23 return (int) sqrt ((double)(__sec_reduce_add (a1
[0:NUMBER
] * a2
[0:NUMBER
]) +
24 a2
[0] + a2
[1] + a2
[3]));
27 int func4 (int *a1
, int *a2
)
29 return a1
[NUMBER
-1] * (__sec_reduce_add (a1
[0:NUMBER
] * a2
[0:NUMBER
]) + a2
[0] + a2
[1] + a2
[3])/a1
[NUMBER
-2];
33 int array
[NUMBER
], array2
[NUMBER
];
37 __asm
volatile ("" : "+r" (argc
));
38 for (ii
= 0; ii
< NUMBER
; ii
++)
40 array
[ii
] = argc
; /* This should calculate to 1. */
41 array2
[ii
] = argc
* argc
+ argc
; /* This should calculate to 2. */
44 return_value
= func1 (array
, array2
);
46 printf("Return_value = %d\n", return_value
);
48 if (return_value
!= (2+2+2+2+2))
51 return_value
= func2 (array2
, array
);
53 printf("Return_value = %d\n", return_value
);
55 if (return_value
!= (3*3*3*3*3) + (2+2+2+2+2))
58 return_value
= func3 (array
, array2
);
60 printf("Return_value = %d\n", return_value
);
62 if (return_value
!= 4)
65 return_value
= func4 (array
, array2
);
67 printf("Return_value = %d\n", return_value
);
69 if (return_value
!= 16)