File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed
Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -4766,13 +4766,17 @@ StmtResult Sema::ActOnOpenMPExecutableDirective(
47664766 case OMPC_num_threads:
47674767 case OMPC_dist_schedule:
47684768 // Do not analyse if no parent teams directive.
4769- if (isOpenMPTeamsDirective(DSAStack->getCurrentDirective() ))
4769+ if (isOpenMPTeamsDirective(Kind ))
47704770 break;
47714771 continue;
47724772 case OMPC_if:
4773- if (isOpenMPTeamsDirective(DSAStack->getCurrentDirective() ) &&
4773+ if (isOpenMPTeamsDirective(Kind ) &&
47744774 cast<OMPIfClause>(C)->getNameModifier() != OMPD_target)
47754775 break;
4776+ if (isOpenMPParallelDirective(Kind) &&
4777+ isOpenMPTaskLoopDirective(Kind) &&
4778+ cast<OMPIfClause>(C)->getNameModifier() != OMPD_parallel)
4779+ break;
47764780 continue;
47774781 case OMPC_schedule:
47784782 break;
@@ -4781,7 +4785,7 @@ StmtResult Sema::ActOnOpenMPExecutableDirective(
47814785 case OMPC_final:
47824786 case OMPC_priority:
47834787 // Do not analyze if no parent parallel directive.
4784- if (isOpenMPParallelDirective(DSAStack->getCurrentDirective() ))
4788+ if (isOpenMPParallelDirective(Kind ))
47854789 break;
47864790 continue;
47874791 case OMPC_ordered:
Original file line number Diff line number Diff line change @@ -733,9 +733,19 @@ void test_loop_eh() {
733733
734734void test_loop_firstprivate_lastprivate () {
735735 S s (4 );
736+ int c;
736737#pragma omp parallel
737738#pragma omp parallel master taskloop lastprivate(s) firstprivate(s)
738739 for (int i = 0 ; i < 16 ; ++i)
739740 ;
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+ ;
740750}
741751
Original file line number Diff line number Diff line change @@ -728,9 +728,19 @@ void test_loop_eh() {
728728
729729void test_loop_firstprivate_lastprivate () {
730730 S s (4 );
731+ int c;
731732#pragma omp parallel
732733#pragma omp parallel master taskloop simd lastprivate(s) firstprivate(s)
733734 for (int i = 0 ; i < 16 ; ++i)
734735 ;
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+ ;
735745}
736746
You can’t perform that action at this time.
0 commit comments