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
370 lines
7.2 KiB
C++
370 lines
7.2 KiB
C++
// RUN: %clang_cc1 %s -verify -fopenacc -fcxx-exceptions
|
|
|
|
|
|
void ReturnTest() {
|
|
#pragma acc parallel
|
|
{
|
|
(void)[]() { return; };
|
|
}
|
|
|
|
#pragma acc parallel loop
|
|
for (int i = 0; i < 5; ++i) {
|
|
(void)[]() { return; };
|
|
}
|
|
|
|
|
|
#pragma acc parallel
|
|
{
|
|
try {}
|
|
catch(...){
|
|
return; // expected-error{{invalid return out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
}
|
|
#pragma acc parallel loop
|
|
for (int i = 0; i < 5; ++i) {
|
|
try {}
|
|
catch(...){
|
|
return; // expected-error{{invalid return out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
}
|
|
}
|
|
|
|
template<typename T>
|
|
void BreakContinue() {
|
|
#pragma acc parallel
|
|
for(int i =0; i < 5; ++i) {
|
|
switch(i) {
|
|
case 0:
|
|
break; // leaves switch, not 'for'.
|
|
default:
|
|
i +=2;
|
|
break;
|
|
}
|
|
if (i == 2)
|
|
continue;
|
|
|
|
break; // expected-error{{invalid branch out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
#pragma acc parallel loop
|
|
for(int i =0; i < 5; ++i) {
|
|
switch(i) {
|
|
case 0:
|
|
break; // leaves switch, not 'for'.
|
|
default:
|
|
i +=2;
|
|
break;
|
|
}
|
|
if (i == 2)
|
|
continue;
|
|
|
|
break; // expected-error{{invalid branch out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
|
|
int j;
|
|
switch(j) {
|
|
case 0:
|
|
#pragma acc parallel
|
|
{
|
|
break; // expected-error{{invalid branch out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
case 1:
|
|
#pragma acc parallel
|
|
{
|
|
}
|
|
break;
|
|
}
|
|
switch(j) {
|
|
case 0:
|
|
#pragma acc parallel loop
|
|
for (int i = 0; i < 5; ++i) {
|
|
break; // expected-error{{invalid branch out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
case 1:
|
|
#pragma acc parallel loop
|
|
for (int i = 0; i < 5; ++i) {
|
|
}
|
|
break;
|
|
}
|
|
|
|
#pragma acc parallel
|
|
for(int i = 0; i < 5; ++i) {
|
|
if (i > 1)
|
|
break; // expected-error{{invalid branch out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
|
|
#pragma acc parallel loop
|
|
for(int i = 0; i < 5; ++i) {
|
|
if (i > 1)
|
|
break; // expected-error{{invalid branch out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
|
|
#pragma acc parallel
|
|
switch(j) {
|
|
case 1:
|
|
break;
|
|
}
|
|
|
|
#pragma acc parallel loop
|
|
for (int i = 0; i < 5; ++i)
|
|
switch(j) {
|
|
case 1:
|
|
break;
|
|
}
|
|
|
|
#pragma acc parallel
|
|
{
|
|
for(int i = 1; i < 100; i++) {
|
|
if (i > 4)
|
|
break;
|
|
}
|
|
}
|
|
|
|
for (int i =0; i < 5; ++i) {
|
|
#pragma acc parallel
|
|
{
|
|
continue; // expected-error{{invalid branch out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
}
|
|
|
|
#pragma acc parallel
|
|
for (int i =0; i < 5; ++i) {
|
|
continue;
|
|
}
|
|
|
|
#pragma acc parallel loop
|
|
for (int i =0; i < 5; ++i) {
|
|
continue;
|
|
}
|
|
|
|
#pragma acc parallel
|
|
for (int i =0; i < 5; ++i) {
|
|
{
|
|
continue;
|
|
}
|
|
}
|
|
|
|
#pragma acc parallel loop
|
|
for (int i =0; i < 5; ++i) {
|
|
{
|
|
continue;
|
|
}
|
|
}
|
|
|
|
for (int i =0; i < 5; ++i) {
|
|
#pragma acc parallel
|
|
{
|
|
break; // expected-error{{invalid branch out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
}
|
|
|
|
#pragma acc parallel
|
|
while (j) {
|
|
--j;
|
|
if (j > 4)
|
|
break; // expected-error{{invalid branch out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
|
|
#pragma acc parallel
|
|
do {
|
|
--j;
|
|
if (j > 4)
|
|
break; // expected-error{{invalid branch out of OpenACC Compute/Combined Construct}}
|
|
} while (j );
|
|
}
|
|
|
|
template<typename T>
|
|
void DuffsDevice() {
|
|
int j;
|
|
switch (j) {
|
|
#pragma acc parallel
|
|
for(int i =0; i < 5; ++i) {
|
|
case 0: // expected-error{{invalid branch into OpenACC Compute/Combined Construct}}
|
|
{}
|
|
}
|
|
}
|
|
|
|
switch (j) {
|
|
#pragma acc parallel loop
|
|
for(int i =0; i < 5; ++i) {
|
|
case 0: // expected-error{{invalid branch into OpenACC Compute/Combined Construct}}
|
|
{}
|
|
}
|
|
}
|
|
|
|
switch (j) {
|
|
#pragma acc parallel
|
|
for(int i =0; i < 5; ++i) {
|
|
default: // expected-error{{invalid branch into OpenACC Compute/Combined Construct}}
|
|
{}
|
|
}
|
|
}
|
|
|
|
switch (j) {
|
|
#pragma acc parallel loop
|
|
for(int i =0; i < 5; ++i) {
|
|
default: // expected-error{{invalid branch into OpenACC Compute/Combined Construct}}
|
|
{}
|
|
}
|
|
}
|
|
|
|
switch (j) {
|
|
#pragma acc parallel
|
|
for(int i =0; i < 5; ++i) {
|
|
case 'a' ... 'z': // expected-error{{invalid branch into OpenACC Compute/Combined Construct}}
|
|
{}
|
|
}
|
|
}
|
|
|
|
switch (j) {
|
|
#pragma acc parallel loop
|
|
for(int i =0; i < 5; ++i) {
|
|
case 'a' ... 'z': // expected-error{{invalid branch into OpenACC Compute/Combined Construct}}
|
|
{}
|
|
}
|
|
}
|
|
}
|
|
|
|
void Exceptions() {
|
|
#pragma acc parallel
|
|
for(int i = 0; i < 5; ++i) {
|
|
throw 5; // expected-error{{invalid throw out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
|
|
#pragma acc parallel loop
|
|
for(int i = 0; i < 5; ++i) {
|
|
throw 5; // expected-error{{invalid throw out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
|
|
#pragma acc parallel
|
|
for(int i = 0; i < 5; ++i) {
|
|
throw; // expected-error{{invalid throw out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
|
|
#pragma acc parallel loop
|
|
for(int i = 0; i < 5; ++i) {
|
|
throw; // expected-error{{invalid throw out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
|
|
#pragma acc serial
|
|
for(int i = 0; i < 5; ++i) {
|
|
throw; // expected-error{{invalid throw out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
|
|
#pragma acc serial loop
|
|
for(int i = 0; i < 5; ++i) {
|
|
throw; // expected-error{{invalid throw out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
|
|
#pragma acc kernels
|
|
for(int i = 0; i < 5; ++i) {
|
|
throw; // expected-error{{invalid throw out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
|
|
#pragma acc kernels loop
|
|
for(int i = 0; i < 5; ++i) {
|
|
throw; // expected-error{{invalid throw out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
|
|
#pragma acc parallel
|
|
for(int i = 0; i < 5; ++i) {
|
|
try {
|
|
throw 5;
|
|
} catch(float f) {
|
|
}
|
|
}
|
|
|
|
#pragma acc parallel loop
|
|
for(int i = 0; i < 5; ++i) {
|
|
try {
|
|
throw 5;
|
|
} catch(float f) {
|
|
}
|
|
}
|
|
|
|
#pragma acc parallel
|
|
for(int i = 0; i < 5; ++i) {
|
|
try {
|
|
throw 5;
|
|
} catch(int f) {
|
|
}
|
|
}
|
|
|
|
#pragma acc parallel loop
|
|
for(int i = 0; i < 5; ++i) {
|
|
try {
|
|
throw 5;
|
|
} catch(int f) {
|
|
}
|
|
}
|
|
|
|
#pragma acc parallel
|
|
for(int i = 0; i < 5; ++i) {
|
|
try {
|
|
throw 5;
|
|
} catch(...) {
|
|
}
|
|
}
|
|
|
|
#pragma acc parallel loop
|
|
for(int i = 0; i < 5; ++i) {
|
|
try {
|
|
throw 5;
|
|
} catch(...) {
|
|
}
|
|
}
|
|
|
|
#pragma acc parallel
|
|
for(int i = 0; i < 5; ++i) {
|
|
try {
|
|
throw;
|
|
} catch(...) {
|
|
}
|
|
}
|
|
|
|
#pragma acc parallel loop
|
|
for(int i = 0; i < 5; ++i) {
|
|
try {
|
|
throw;
|
|
} catch(...) {
|
|
}
|
|
}
|
|
|
|
#pragma acc parallel
|
|
for(int i = 0; i < 5; ++i) {
|
|
try {
|
|
throw;
|
|
} catch(...) {
|
|
throw; // expected-error{{invalid throw out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
}
|
|
#pragma acc parallel loop
|
|
for(int i = 0; i < 5; ++i) {
|
|
try {
|
|
throw;
|
|
} catch(...) {
|
|
throw; // expected-error{{invalid throw out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
}
|
|
#pragma acc parallel
|
|
for(int i = 0; i < 5; ++i) {
|
|
try {
|
|
throw;
|
|
} catch(int f) {
|
|
throw; // expected-error{{invalid throw out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
}
|
|
#pragma acc parallel loop
|
|
for(int i = 0; i < 5; ++i) {
|
|
try {
|
|
throw;
|
|
} catch(int f) {
|
|
throw; // expected-error{{invalid throw out of OpenACC Compute/Combined Construct}}
|
|
}
|
|
}
|
|
}
|
|
|
|
void Instantiate() {
|
|
BreakContinue<int>();
|
|
DuffsDevice<int>();
|
|
}
|