Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / openmp / libompd / test / openmp_examples / ompd_bt.c
blob4bacde67000bbe2f0f62c3223dca8e7ad55f18b0
1 // RUN: %gdb-compile 2>&1 | tee %t.compile
2 // RUN: %gdb-test -x %S/ompd_bt.cmd %t 2>&1 | tee %t.out | FileCheck %s
4 // REQUIRES: determinism
6 #include <omp.h>
8 void subdomain(float *x, int istart, int ipoints) {
9 int i;
11 for (i = 0; i < ipoints; i++)
12 x[istart + i] = 123.456;
15 void sub(float *x, int npoints) {
16 int iam, nt, ipoints, istart;
18 #pragma omp parallel default(shared) private(iam, nt, ipoints, istart)
20 iam = omp_get_thread_num();
21 nt = omp_get_num_threads();
22 ipoints = npoints / nt; /* size of partition */
23 istart = iam * ipoints; /* starting array index */
24 if (iam == nt - 1) /* last thread may do more */
25 ipoints = npoints - istart;
26 subdomain(x, istart, ipoints);
30 int main() {
32 omp_set_num_threads(5);
33 float array[10000];
35 sub(array, 10000);
37 return 0;
40 // CHECK: Loaded OMPD lib successfully!
42 // CHECK: Enabled filter for "bt" output successfully.
43 // CHECK-NOT: {{__kmp.*}}
45 // CHECK: Disabled filter for "bt" output successfully
46 // CHECK: {{__kmp.*}}
48 // CHECK-NOT: Python Exception
49 // CHECK-NOT: The program is not being run.
50 // CHECK-NOT: No such file or directory