Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / openmp / libompd / test / openmp_examples / ompd_parallel.c
bloba6bb992e7e7ffb67e61e0418fab2c93a4ca678e0
1 // RUN: %gdb-compile 2>&1 | tee %t.compile
2 // RUN: %gdb-test -x %S/ompd_parallel.cmd %t 2>&1 | tee %t.out | FileCheck %s
4 // REQUIRES: determinism
6 #include <omp.h>
7 #include <stdio.h>
9 int main() {
10 omp_set_max_active_levels(3);
11 omp_set_num_threads(7);
12 #pragma omp parallel
14 omp_set_num_threads(5);
15 #pragma omp parallel
17 omp_set_num_threads(3);
18 #pragma omp parallel
19 { printf("In nested level:3, team size = %d.\n", omp_get_num_threads()); }
21 printf("In nested level:2, team size = %d.\n", omp_get_num_threads());
23 printf("In nested level:1, team size = %d.\n", omp_get_num_threads());
26 return 0;
29 // CHECK: Loaded OMPD lib successfully!
30 // CHECK: Nesting Level 3: Team Size: 3
31 // CHECK: ompd_parallel.c{{[ ]*}}:16
32 // CHECK: Nesting Level 2: Team Size: 5
33 // CHECK: ompd_parallel.c{{[ ]*}}:13
34 // CHECK: Nesting Level 1: Team Size: 7
35 // CHECK: ompd_parallel.c{{[ ]*}}:10
37 // CHECK: Nesting Level 2: Team Size: 5
38 // CHECK: ompd_parallel.c{{[ ]*}}:13
39 // CHECK: Nesting Level 1: Team Size: 7
40 // CHECK: ompd_parallel.c{{[ ]*}}:10
42 // CHECK: Nesting Level 1: Team Size: 7
43 // CHECK: ompd_parallel.c{{[ ]*}}:10
45 // CHECK-NOT: Python Exception
46 // CHECK-NOT: The program is not being run.
47 // CHECK-NOT: No such file or directory