Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / offloading / looptripcnt.c
blobd1a095038b75aacd98a75c224a7340ce2dc0745a
1 // RUN: %libomptarget-compile-generic && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-generic 2>&1 | %fcheck-generic -allow-empty -check-prefix=DEBUG
2 // REQUIRES: libomptarget-debug
4 /*
5 Test for looptripcount being popped from runtime stack.
6 */
7 #include <omp.h>
8 #include <stdio.h>
9 int main() {
10 int N = 128;
11 int NN = 1024;
12 int num_teams[NN];
13 int num_threads[NN];
15 printf("#pragma omp target teams distribute parallel for thread_limit(4)\n");
16 #pragma omp target teams distribute parallel for thread_limit(4)
17 for (int j = 0; j < N; j++) {
18 num_threads[j] = omp_get_num_threads();
19 num_teams[j] = omp_get_num_teams();
21 printf("num_threads %d num_teams %d\n", num_threads[0], num_teams[0]);
22 // DEBUG: loop trip count is 128
23 printf("#pragma omp target teams distribute parallel for\n");
24 #pragma omp target teams distribute parallel for
25 for (int j = 0; j < N; j++) {
26 num_threads[j] = omp_get_num_threads();
27 num_teams[j] = omp_get_num_teams();
29 printf("num_threads %d num_teams %d\n", num_threads[0], num_teams[0]);
30 // DEBUG: loop trip count is 128
31 return 0;