Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / jit / type_punning.c
blob574168b8a69cbb53c77401750c241b268d65f7e9
1 // clang-format off
2 //
3 // RUN: %libomptarget-compileopt-generic -fopenmp-target-jit
4 // RUN: env LIBOMPTARGET_JIT_PRE_OPT_IR_MODULE=%t.pre.ll \
5 // RUN: LIBOMPTARGET_JIT_SKIP_OPT=true \
6 // RUN: %libomptarget-run-generic
7 // RUN: %fcheck-plain-generic --input-file %t.pre.ll %s
8 //
9 // clang-format on
11 // REQUIRES: gpu
13 // Ensure that there is only the kernel function left, not any outlined
14 // parallel regions.
16 // CHECK: define
17 // CHECK-NOT: define
19 #include <omp.h>
20 #include <stdio.h>
22 void f(long *A, int N) {
23 long i = 0;
24 #pragma omp target map(A[ : N])
26 #pragma omp parallel firstprivate(i)
27 A[omp_get_thread_num()] = i;
28 #pragma omp parallel firstprivate(i, N)
29 A[omp_get_thread_num()] += i + N;
33 int main() {
34 long A[1];
35 f(&A[0], 1);
36 printf("%li\n", A[0]);
37 return 0;