Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / openmp / libomptarget / test / offloading / thread_limit.c
blob65275a8f279584a35243642612a8e4752ea2d374
1 // clang-format off
2 // RUN: %libomptarget-compile-generic
3 // RUN: env LIBOMPTARGET_INFO=16 \
4 // RUN: %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefix=DEFAULT
6 // UNSUPPORTED: nvptx64-nvidia-cuda
7 // UNSUPPORTED: nvptx64-nvidia-cuda-LTO
8 // UNSUPPORTED: aarch64-unknown-linux-gnu
9 // UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
10 // UNSUPPORTED: x86_64-pc-linux-gnu
11 // UNSUPPORTED: x86_64-pc-linux-gnu-LTO
13 int main() {
14 int n = 1 << 20;
15 int th = 12;
16 int te = n / th;
17 // DEFAULT: 12 (MaxFlatWorkGroupSize:
18 #pragma omp target
19 #pragma omp teams loop num_teams(te), thread_limit(th)
20 for (int i = 0; i < n; i++) {
23 // DEFAULT: 13 (MaxFlatWorkGroupSize:
24 #pragma omp target
25 #pragma omp teams distribute parallel for simd num_teams(te), thread_limit(th+1) simdlen(64)
26 for(int i = 0; i < n; i++) {
28 return 0;