[flang] [OpenMP] update `declare simd` directive with exclusive set

Original-commit: flang-compiler/f18@dc1bd8edc6
This commit is contained in:
Jinxin Yang 2019-09-05 09:09:01 -07:00 committed by Jinxin (Brian) Yang
parent e902c1d6b7
commit d1bbccf1d5
2 changed files with 5 additions and 3 deletions

View File

@ -416,10 +416,11 @@ void OmpStructureChecker::Enter(const parser::OpenMPDeclareSimdConstruct &x) {
// uniform-clause |
// inbranch-clause |
// notinbranch-clause
OmpClauseSet allowed{OmpClause::LINEAR, OmpClause::ALIGNED,
OmpClause::UNIFORM, OmpClause::INBRANCH, OmpClause::NOTINBRANCH};
OmpClauseSet allowed{
OmpClause::LINEAR, OmpClause::ALIGNED, OmpClause::UNIFORM};
SetContextAllowed(allowed);
SetContextAllowedOnce({OmpClause::SIMDLEN});
SetContextAllowedExclusive({OmpClause::INBRANCH, OmpClause::NOTINBRANCH});
}
void OmpStructureChecker::Leave(const parser::OpenMPDeclareSimdConstruct &) {

View File

@ -42,7 +42,8 @@ subroutine declare_simd_2
use m1
procedure (sub) sub1
!ERROR: Internal: no symbol found for 'sub1'
!$omp declare simd(sub1)
!ERROR: NOTINBRANCH and INBRANCH are mutually exclusive and may not appear on the same DECLARE SIMD directive
!$omp declare simd(sub1) inbranch notinbranch
procedure (sub), pointer::p
p=>sub1
call p(5,10)