CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
62 lines
2.1 KiB
C
62 lines
2.1 KiB
C
/*
|
|
* Error and delayed-transformation cases for #pragma omp split counts(...).
|
|
*/
|
|
// 1) Required clause missing: err_omp_required_clause
|
|
// RUN: not %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -fsyntax-only -DTEST_REQUIRED_CLAUSE %s 2>&1 | FileCheck %s --check-prefix=REQ
|
|
// 2) counts(negative): non-negative diagnostic
|
|
// RUN: not %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -fsyntax-only -DTEST_NEGATIVE %s 2>&1 | FileCheck %s --check-prefix=NEG
|
|
// 3) counts(non-integer): integral type diagnostic
|
|
// RUN: not %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -fsyntax-only -DTEST_FLOAT %s 2>&1 | FileCheck %s --check-prefix=FLOAT
|
|
// 6) Loop not transformable (while): must be a for loop
|
|
// RUN: not %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -fsyntax-only -DTEST_WHILE %s 2>&1 | FileCheck %s --check-prefix=WHILE
|
|
// Two invalid counts — two diagnostics on the clause
|
|
// RUN: not %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -fsyntax-only -DTEST_DOUBLE_NEGATIVE %s 2>&1 | FileCheck %s --check-prefix=DBLNEG
|
|
|
|
#ifdef TEST_REQUIRED_CLAUSE
|
|
void test_required_clause_missing(void) {
|
|
#pragma omp split
|
|
for (int i = 0; i < 10; ++i) {
|
|
}
|
|
}
|
|
// REQ: error: {{.*}}requires the 'counts' clause
|
|
#endif
|
|
|
|
#ifdef TEST_NEGATIVE
|
|
void test_negative_count(void) {
|
|
#pragma omp split counts(-1, omp_fill)
|
|
for (int i = 0; i < 10; ++i) {
|
|
}
|
|
}
|
|
// NEG: error: {{.*}}counts{{.*}}non-negative integer
|
|
#endif
|
|
|
|
#ifdef TEST_FLOAT
|
|
void test_float_count(void) {
|
|
#pragma omp split counts(2.5, omp_fill)
|
|
for (int i = 0; i < 10; ++i) {
|
|
}
|
|
}
|
|
// FLOAT: error: {{.*}}integer constant expression must have integer type
|
|
#endif
|
|
|
|
#ifdef TEST_WHILE
|
|
void test_while_not_for(void) {
|
|
int i = 0;
|
|
#pragma omp split counts(5, omp_fill)
|
|
while (i < 10) {
|
|
++i;
|
|
}
|
|
}
|
|
// WHILE: error: {{.*}}must be a for loop
|
|
#endif
|
|
|
|
#ifdef TEST_DOUBLE_NEGATIVE
|
|
void test_two_negative_counts(void) {
|
|
#pragma omp split counts(-1, -1, omp_fill)
|
|
for (int i = 0; i < 10; ++i) {
|
|
}
|
|
}
|
|
// DBLNEG: error: {{.*}}counts{{.*}}non-negative integer
|
|
// DBLNEG: error: {{.*}}counts{{.*}}non-negative integer
|
|
#endif
|