| 1 |
// RUN: %clang_cc1 -verify -fopenmp -triple x86_64-unknown-linux-gnu \ |
| 2 |
// RUN: -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s |
| 3 |
|
| 4 |
// expected-no-diagnostics |
| 5 |
|
| 6 |
int x[100]; |
| 7 |
int y[100]; |
| 8 |
int z[100][100]; |
| 9 |
|
| 10 |
// CHECK-LABEL: @many_iterators_single_clause( |
| 11 |
// CHECK: [[VLA:%.*]] = alloca [[STRUCT_KMP_DEPEND_INFO:%.*]], i64 10, align 16 |
| 12 |
// CHECK: = call i32 @__kmpc_omp_task_with_deps(ptr {{.*}}, i32 {{.*}}, ptr {{.*}}, i32 10, ptr {{.*}}, i32 0, ptr null) |
| 13 |
void many_iterators_single_clause(void) { |
| 14 |
#pragma omp task depend(iterator(j=0:5), in: x[j], y[j]) |
| 15 |
{ |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
// CHECK-LABEL: @many_iterators_many_clauses( |
| 20 |
// CHECK: [[VLA:%.*]] = alloca [[STRUCT_KMP_DEPEND_INFO:%.*]], i64 10, align 16 |
| 21 |
// CHECK: = call i32 @__kmpc_omp_task_with_deps(ptr {{.*}}, i32 {{.*}}, ptr {{.*}}, i32 10, ptr {{.*}}, i32 0, ptr null) |
| 22 |
void many_iterators_many_clauses(void) { |
| 23 |
#pragma omp task depend(iterator(j=0:5), in: x[j]) \ |
| 24 |
depend(iterator(j=0:5), in: y[j]) |
| 25 |
{ |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
// CHECK-LABEL: @multidim_iterators_clause1( |
| 30 |
// CHECK: [[VLA:%.*]] = alloca [[STRUCT_KMP_DEPEND_INFO:%.*]], i64 1, align 16 |
| 31 |
// CHECK: = call i32 @__kmpc_omp_task_with_deps(ptr {{.*}}, i32 {{.*}}, ptr {{.*}}, i32 1, ptr {{.*}}, i32 0, ptr null) |
| 32 |
void multidim_iterators_clause1(void) { |
| 33 |
#pragma omp task depend(iterator(i=0:1, j=0:1), in: z[i][j]) |
| 34 |
{ |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
// CHECK-LABEL: @multidim_iterators_offset_clause( |
| 39 |
// CHECK: [[VLA:%.*]] = alloca [[STRUCT_KMP_DEPEND_INFO:%.*]], i64 1, align 16 |
| 40 |
// CHECK: = call i32 @__kmpc_omp_task_with_deps(ptr {{.*}}, i32 {{.*}}, ptr {{.*}}, i32 1, ptr {{.*}}, i32 0, ptr null) |
| 41 |
void multidim_iterators_offset_clause(void) { |
| 42 |
#pragma omp task depend(iterator(i=5:6, j=10:11), in: z[i][j]) |
| 43 |
{ |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
// CHECK-LABEL: @multidim_iterators_clause25( |
| 48 |
// CHECK: [[VLA:%.*]] = alloca [[STRUCT_KMP_DEPEND_INFO:%.*]], i64 25, align 16 |
| 49 |
// CHECK: = call i32 @__kmpc_omp_task_with_deps(ptr {{.*}}, i32 {{.*}}, ptr {{.*}}, i32 25, ptr {{.*}}, i32 0, ptr null) |
| 50 |
void multidim_iterators_clause25(void) { |
| 51 |
#pragma omp task depend(iterator(i=0:5, j=0:5), in: z[i][j]) |
| 52 |
{ |
| 53 |
} |
| 54 |
} |
| 55 |
|