File tree 3 files changed +27
-3
lines changed
3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -4766,13 +4766,17 @@ StmtResult Sema::ActOnOpenMPExecutableDirective(
4766
4766
case OMPC_num_threads:
4767
4767
case OMPC_dist_schedule:
4768
4768
// Do not analyse if no parent teams directive.
4769
- if (isOpenMPTeamsDirective(DSAStack->getCurrentDirective() ))
4769
+ if (isOpenMPTeamsDirective(Kind ))
4770
4770
break;
4771
4771
continue;
4772
4772
case OMPC_if:
4773
- if (isOpenMPTeamsDirective(DSAStack->getCurrentDirective() ) &&
4773
+ if (isOpenMPTeamsDirective(Kind ) &&
4774
4774
cast<OMPIfClause>(C)->getNameModifier() != OMPD_target)
4775
4775
break;
4776
+ if (isOpenMPParallelDirective(Kind) &&
4777
+ isOpenMPTaskLoopDirective(Kind) &&
4778
+ cast<OMPIfClause>(C)->getNameModifier() != OMPD_parallel)
4779
+ break;
4776
4780
continue;
4777
4781
case OMPC_schedule:
4778
4782
break;
@@ -4781,7 +4785,7 @@ StmtResult Sema::ActOnOpenMPExecutableDirective(
4781
4785
case OMPC_final:
4782
4786
case OMPC_priority:
4783
4787
// Do not analyze if no parent parallel directive.
4784
- if (isOpenMPParallelDirective(DSAStack->getCurrentDirective() ))
4788
+ if (isOpenMPParallelDirective(Kind ))
4785
4789
break;
4786
4790
continue;
4787
4791
case OMPC_ordered:
Original file line number Diff line number Diff line change @@ -733,9 +733,19 @@ void test_loop_eh() {
733
733
734
734
void test_loop_firstprivate_lastprivate () {
735
735
S s (4 );
736
+ int c;
736
737
#pragma omp parallel
737
738
#pragma omp parallel master taskloop lastprivate(s) firstprivate(s)
738
739
for (int i = 0 ; i < 16 ; ++i)
739
740
;
741
+ #pragma omp parallel master taskloop if(c) default(none) // expected-error {{variable 'c' must have explicitly specified data sharing attributes}} expected-note {{explicit data sharing attribute requested here}}
742
+ for (int i = 0 ; i < 16 ; ++i)
743
+ ;
744
+ #pragma omp parallel master taskloop if(taskloop:c) default(none) // expected-error {{variable 'c' must have explicitly specified data sharing attributes}} expected-note {{explicit data sharing attribute requested here}}
745
+ for (int i = 0 ; i < 16 ; ++i)
746
+ ;
747
+ #pragma omp parallel master taskloop if(parallel:c) default(none)
748
+ for (int i = 0 ; i < 16 ; ++i)
749
+ ;
740
750
}
741
751
Original file line number Diff line number Diff line change @@ -728,9 +728,19 @@ void test_loop_eh() {
728
728
729
729
void test_loop_firstprivate_lastprivate () {
730
730
S s (4 );
731
+ int c;
731
732
#pragma omp parallel
732
733
#pragma omp parallel master taskloop simd lastprivate(s) firstprivate(s)
733
734
for (int i = 0 ; i < 16 ; ++i)
734
735
;
736
+ #pragma omp parallel master taskloop simd if(c) default(none) // expected-error {{variable 'c' must have explicitly specified data sharing attributes}} expected-note {{explicit data sharing attribute requested here}}
737
+ for (int i = 0 ; i < 16 ; ++i)
738
+ ;
739
+ #pragma omp parallel master taskloop simd if(taskloop:c) default(none) // expected-error {{variable 'c' must have explicitly specified data sharing attributes}} expected-note {{explicit data sharing attribute requested here}}
740
+ for (int i = 0 ; i < 16 ; ++i)
741
+ ;
742
+ #pragma omp parallel master taskloop simd if(parallel:c) default(none)
743
+ for (int i = 0 ; i < 16 ; ++i)
744
+ ;
735
745
}
736
746
You can’t perform that action at this time.
0 commit comments