Skip to content

Commit

Permalink
[OpenACC] Fix branch-in/out to not refer to a 'region'
Browse files Browse the repository at this point in the history
'region' is not a term of art in OpenACC, so switch it to refer to
'Compute Construct', which is accurate/reflects the standard.
  • Loading branch information
erichkeane committed Feb 23, 2024
1 parent 3e9e5e2 commit 8fe4487
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -12204,5 +12204,5 @@ def err_acc_construct_appertainment
: Error<"OpenACC construct '%0' cannot be used here; it can only "
"be used in a statement context">;
def err_acc_branch_in_out
: Error<"invalid branch %select{out of|into}0 OpenACC region">;
: Error<"invalid branch %select{out of|into}0 OpenACC Compute Construct">;
} // end of sema component.
14 changes: 7 additions & 7 deletions clang/test/SemaOpenACC/no-branch-in-out.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ void BreakContinue() {
if (i == 2)
continue;

break; // expected-error{{invalid branch out of OpenACC region}}
break; // expected-error{{invalid branch out of OpenACC Compute Construct}}
}

int j;
switch(j) {
case 0:
#pragma acc parallel
{
break; // expected-error{{invalid branch out of OpenACC region}}
break; // expected-error{{invalid branch out of OpenACC Compute Construct}}
}
case 1:
#pragma acc parallel
Expand All @@ -34,7 +34,7 @@ void BreakContinue() {
#pragma acc parallel
for(int i = 0; i < 5; ++i) {
if (i > 1)
break; // expected-error{{invalid branch out of OpenACC region}}
break; // expected-error{{invalid branch out of OpenACC Compute Construct}}
}

#pragma acc parallel
Expand All @@ -54,7 +54,7 @@ void BreakContinue() {
for (int i =0; i < 5; ++i) {
#pragma acc parallel
{
continue; // expected-error{{invalid branch out of OpenACC region}}
continue; // expected-error{{invalid branch out of OpenACC Compute Construct}}
}
}

Expand All @@ -73,22 +73,22 @@ void BreakContinue() {
for (int i =0; i < 5; ++i) {
#pragma acc parallel
{
break; // expected-error{{invalid branch out of OpenACC region}}
break; // expected-error{{invalid branch out of OpenACC Compute Construct}}
}
}

#pragma acc parallel
while (j) {
--j;
if (j > 4)
break; // expected-error{{invalid branch out of OpenACC region}}
break; // expected-error{{invalid branch out of OpenACC Compute Construct}}
}

#pragma acc parallel
do {
--j;
if (j > 4)
break; // expected-error{{invalid branch out of OpenACC region}}
break; // expected-error{{invalid branch out of OpenACC Compute Construct}}
} while (j );

}
Expand Down

0 comments on commit 8fe4487

Please sign in to comment.