1 // expected-no-diagnostics
2 // RUN: %clang_cc1 -DCK1 -verify -fopenmp -x c++ %s -emit-llvm -o - | FileCheck %s
3 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
12 #pragma omp loop bind(parallel)
13 for (int j
= 0 ; j
< NNN
; j
++) {
19 void parallel_loop_orphan() {
20 #pragma omp loop bind(parallel)
21 for (int j
= 0 ; j
< NNN
; j
++) {
30 #pragma omp loop bind(teams)
31 for (int j
= 0 ; j
< NNN
; j
++) {
40 #pragma omp loop bind(thread)
41 for (int j
= 0 ; j
< NNN
; j
++) {
47 void thread_loop_orphan() {
48 #pragma omp loop bind(thread)
49 for (int j
= 0 ; j
< NNN
; j
++) {
56 parallel_loop_orphan();
63 // CHECK-LABEL: define {{.+}}parallel_loop{{.+}}
64 // CHECK: call {{.+}}__kmpc_fork_call({{.+}}parallel_loop{{.+}}.omp_outlined{{.*}})
67 // CHECK-LABEL: define {{.+}}parallel_loop{{.+}}.omp_outlined{{.+}}
68 // CHECK: call {{.+}}__kmpc_for_static_init_4
69 // CHECK: omp.inner.for.body:
70 // CHECK: omp.loop.exit:
71 // CHECK-NEXT: call {{.+}}__kmpc_for_static_fini
72 // CHECK-NEXT: call {{.+}}__kmpc_barrier
75 // CHECK-LABEL: define {{.+}}parallel_loop_orphan{{.+}}
76 // CHECK: [[TMP0:%.*]] = call {{.+}}__kmpc_global_thread_num
77 // CHECK: call {{.+}}__kmpc_for_static_init_4
78 // CHECK: omp.inner.for.body:
79 // CHECK: omp.inner.for.end:
80 // CHECK: omp.loop.exit:
81 // CHECK-NEXT: call {{.+}}__kmpc_for_static_fini
82 // CHECK-NEXT: call {{.+}}__kmpc_barrier
85 // CHECK-LABEL: define {{.+}}teams_loop{{.+}}
86 // CHECK: call {{.+}}__kmpc_fork_teams({{.+}}teams_loop{{.+}}.omp_outlined{{.*}})
89 // CHECK-LABEL: define {{.+}}teams_loop{{.+}}.omp_outlined{{.+}}
90 // CHECK: call {{.+}}__kmpc_for_static_init_4
91 // CHECK: omp.inner.for.body:
92 // CHECK: omp.loop.exit:
93 // CHECK-NEXT: call {{.+}}__kmpc_for_static_fini
96 // CHECK-LABEL: define {{.+}}thread_loop{{.+}}
97 // CHECK: call {{.+}}__kmpc_fork_call({{.+}}thread_loop{{.+}}.omp_outlined{{.*}})
100 // CHECK-LABEL: define {{.+}}thread_loop{{.+}}.omp_outlined{{.+}}
101 // CHECK: omp.inner.for.body:
102 // CHECK: omp.inner.for.end:
105 // CHECK-LABEL: define {{.+}}thread_loop_orphan{{.+}}
106 // CHECK: omp.inner.for.cond:
107 // CHECK: omp.inner.for.body:
108 // CHECK: omp.inner.for.end:
111 // CHECK-LABEL: define {{.+}}main{{.+}}
112 // CHECK: call {{.+}}parallel_loop{{.+}}()
113 // CHECK-NEXT: call {{.+}}parallel_loop_orphan{{.+}}()
114 // CHECK-NEXT: call {{.+}}teams_loop{{.+}}()
115 // CHECK-NEXT: call {{.+}}thread_loop{{.+}}()
116 // CHECK-NEXT: call {{.+}}thread_loop_orphan{{.+}}()