brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.3 KiB · 5392a31 Raw
250 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenmp2 3! OpenMP Version 5.04! Check OpenMP construct validity for the following directives:5! 2.18.2 Cancellation Point Construct6 7program main8  integer :: i, N = 109  real :: a10 11  !ERROR: CANCELLATION POINT TASKGROUP directive is not closely nested inside TASK or TASKLOOP12  !$omp cancellation point taskgroup13 14  !ERROR: CANCELLATION POINT SECTIONS directive is not closely nested inside SECTION or SECTIONS15  !$omp cancellation point sections16 17  !ERROR: CANCELLATION POINT DO directive is not closely nested inside the construct that matches the DO clause type18  !$omp cancellation point do19 20  !ERROR: CANCELLATION POINT PARALLEL directive is not closely nested inside the construct that matches the PARALLEL clause type21  !$omp cancellation point parallel22 23  !$omp parallel24  !$omp sections25  !$omp cancellation point sections26  !$omp section27  a = 3.1428  !$omp end sections29  !$omp end parallel30 31  !$omp sections32  !$omp section33  !$omp cancellation point sections34  a = 3.1435  !$omp end sections36 37  !$omp parallel38  !ERROR: With SECTIONS clause, CANCELLATION POINT construct cannot be closely nested inside PARALLEL construct39  !$omp cancellation point sections40  a = 3.1441  !$omp end parallel42 43  !$omp parallel sections44  !$omp cancellation point sections45  a = 3.1446  !$omp end parallel sections47 48  !$omp do49  do i = 1, N50    a = 3.1451    !$omp cancellation point do52  end do53  !$omp end do54 55  !$omp parallel do56  do i = 1, N57    a = 3.1458    !$omp cancellation point do59  end do60  !$omp end parallel do61 62  !$omp target63  !$omp teams64  !$omp distribute parallel do65  do i = 1, N66    a = 3.1467    !$omp cancellation point do68  end do69  !$omp end distribute parallel do70  !$omp end teams71  !$omp end target72 73  !$omp target74  !$omp teams distribute parallel do75  do i = 1, N76    a = 3.1477    !$omp cancellation point do78  end do79  !$omp end teams distribute parallel do80  !$omp end target81 82  !$omp target teams distribute parallel do83  do i = 1, N84    a = 3.1485    !$omp cancellation point do86  end do87  !$omp end target teams distribute parallel do88 89  !$omp target parallel do90  do i = 1, N91    a = 3.1492    !$omp cancellation point do93  end do94  !$omp end target parallel do95 96  !$omp parallel97  do i = 1, N98    a = 3.1499    !ERROR: With DO clause, CANCELLATION POINT construct cannot be closely nested inside PARALLEL construct100    !$omp cancellation point do101  end do102  !$omp end parallel103 104  !$omp parallel105  do i = 1, N106    a = 3.14107    !$omp cancellation point parallel108  end do109  !$omp end parallel110 111  !$omp target parallel112  do i = 1, N113    a = 3.14114    !$omp cancellation point parallel115  end do116  !$omp end target parallel117 118  !$omp target parallel do119  do i = 1, N120    a = 3.14121    !ERROR: With PARALLEL clause, CANCELLATION POINT construct cannot be closely nested inside TARGET PARALLEL DO construct122    !$omp cancellation point parallel123  end do124  !$omp end target parallel do125 126  !$omp do127  do i = 1, N128    a = 3.14129    !ERROR: With PARALLEL clause, CANCELLATION POINT construct cannot be closely nested inside DO construct130    !$omp cancellation point parallel131  end do132  !$omp end do133 134contains135  subroutine sub1()136    !$omp task137    !$omp cancellation point taskgroup138    a = 3.14139    !$omp end task140 141    !$omp taskloop142    do i = 1, N143      !$omp parallel144      !$omp end parallel145      !$omp cancellation point taskgroup146      a = 3.14147    end do148    !$omp end taskloop149 150    !$omp taskloop nogroup151    do i = 1, N152      !$omp cancellation point taskgroup153      a = 3.14154    end do155 156    !$omp parallel157    !ERROR: With TASKGROUP clause, CANCELLATION POINT construct must be closely nested inside TASK or TASKLOOP construct and CANCELLATION POINT region must be closely nested inside TASKGROUP region158    !$omp cancellation point taskgroup159    a = 3.14160    !$omp end parallel161 162    !$omp do163    do i = 1, N164      !$omp task165      !$omp cancellation point taskgroup166      a = 3.14167      !$omp end task168    end do169    !$omp end do170 171    !$omp parallel172    !$omp taskgroup173    !$omp task174    !$omp cancellation point taskgroup175    a = 3.14176    !$omp end task177    !$omp end taskgroup178    !$omp end parallel179 180    !$omp parallel181    !$omp task182    !ERROR: With TASKGROUP clause, CANCELLATION POINT construct must be closely nested inside TASK or TASKLOOP construct and CANCELLATION POINT region must be closely nested inside TASKGROUP region183    !$omp cancellation point taskgroup184    a = 3.14185    !$omp end task186    !$omp end parallel187 188    !$omp parallel189    !$omp do190    do i = 1, N191      !$omp task192      !ERROR: With TASKGROUP clause, CANCELLATION POINT construct must be closely nested inside TASK or TASKLOOP construct and CANCELLATION POINT region must be closely nested inside TASKGROUP region193      !$omp cancellation point taskgroup194      a = 3.14195      !$omp end task196    end do197    !$omp end do198    !$omp end parallel199 200    !$omp target parallel201    !$omp task202    !ERROR: With TASKGROUP clause, CANCELLATION POINT construct must be closely nested inside TASK or TASKLOOP construct and CANCELLATION POINT region must be closely nested inside TASKGROUP region203    !$omp cancellation point taskgroup204    a = 3.14205    !$omp end task206    !$omp end target parallel207 208    !$omp parallel209    !$omp taskloop private(j) nogroup210    do i = 1, N211      !ERROR: With TASKGROUP clause, CANCELLATION POINT construct must be closely nested inside TASK or TASKLOOP construct and CANCELLATION POINT region must be closely nested inside TASKGROUP region212      !$omp cancellation point taskgroup213      a = 3.14214    end do215    !$omp end taskloop216    !$omp end parallel217 218    !$omp parallel219    !$omp taskloop220    do i = 1, N221      !$omp cancellation point taskgroup222      a = 3.14223    end do224    !$omp end taskloop225    !$omp end parallel226 227    !$omp parallel228    !$omp taskgroup229    !$omp taskloop nogroup230    do i = 1, N231      !$omp cancellation point taskgroup232      a = 3.14233    end do234    !$omp end taskloop235    !$omp end taskgroup236    !$omp end parallel237 238    !$omp target parallel239    !$omp taskloop nogroup240    do i = 1, N241      !ERROR: With TASKGROUP clause, CANCELLATION POINT construct must be closely nested inside TASK or TASKLOOP construct and CANCELLATION POINT region must be closely nested inside TASKGROUP region242      !$omp cancellation point taskgroup243      a = 3.14244    end do245    !$omp end taskloop246    !$omp end target parallel247  end subroutine sub1248 249end program main250