[RISCV][VLOPT] Add vector narrowing integer right shift instructions to isSupportedIn...
[llvm-project.git] / offload / test / offloading / bug64959_compile_only.c
blob310942f25c00788bc0df3de441b55e47d9894c51
1 // RUN: %libomptarget-compile-generic
2 // RUN: %libomptarget-compileopt-generic
4 #include <stdio.h>
5 #define N 10
7 int main(void) {
8 long int aa = 0;
9 int res = 0;
11 int ng = 12;
12 int cmom = 14;
13 int nxyz = 5000;
15 #pragma omp target teams distribute num_teams(nxyz) \
16 thread_limit(ng *(cmom - 1)) map(tofrom : aa)
17 for (int gid = 0; gid < nxyz; gid++) {
18 #pragma omp parallel for collapse(2)
19 for (unsigned int g = 0; g < ng; g++) {
20 for (unsigned int l = 0; l < cmom - 1; l++) {
21 int a = 0;
22 #pragma omp parallel for reduction(+ : a)
23 for (int i = 0; i < N; i++) {
24 a += i;
26 #pragma omp atomic
27 aa += a;
31 long exp = (long)ng * (cmom - 1) * nxyz * (N * (N - 1) / 2);
32 printf("The result is = %ld exp:%ld!\n", aa, exp);
33 if (aa != exp) {
34 printf("Failed %ld\n", aa);
35 return 1;
37 // CHECK: Success
38 printf("Success\n");
39 return 0;