78 lines · plain
1! RUN: %flang_fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s2! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s3 4subroutine cancellationpoint_parallel()5 !$omp parallel6 !$omp cancellationpoint parallel7 !$omp end parallel8end subroutine9! CHECK-LABEL: func.func @_QPcancellationpoint_parallel() {10! CHECK: omp.parallel {11! CHECK: omp.cancellation_point cancellation_construct_type(parallel)12! CHECK: omp.terminator13! CHECK: }14! CHECK: return15! CHECK: }16 17subroutine cancellationpoint_do()18 !$omp parallel do19 do i = 1,10020 !$omp cancellationpoint do21 enddo22 !$omp end parallel do23end subroutine24! CHECK-LABEL: func.func @_QPcancellationpoint_do() {25! CHECK: %[[VAL_0:.*]] = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFcancellationpoint_doEi"}26! CHECK: %[[VAL_1:.*]]:2 = hlfir.declare %[[VAL_0]] {uniq_name = "_QFcancellationpoint_doEi"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)27! CHECK: omp.parallel {28! CHECK: %[[VAL_2:.*]] = arith.constant 1 : i3229! CHECK: %[[VAL_3:.*]] = arith.constant 100 : i3230! CHECK: %[[VAL_4:.*]] = arith.constant 1 : i3231! CHECK: omp.wsloop private(@_QFcancellationpoint_doEi_private_i32 %[[VAL_1]]#0 -> %[[VAL_5:.*]] : !fir.ref<i32>) {32! CHECK: omp.loop_nest (%[[VAL_6:.*]]) : i32 = (%[[VAL_2]]) to (%[[VAL_3]]) inclusive step (%[[VAL_4]]) {33! CHECK: %[[VAL_7:.*]]:2 = hlfir.declare %[[VAL_5]] {uniq_name = "_QFcancellationpoint_doEi"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)34! CHECK: hlfir.assign %[[VAL_6]] to %[[VAL_7]]#0 : i32, !fir.ref<i32>35! CHECK: omp.cancellation_point cancellation_construct_type(loop)36! CHECK: omp.yield37! CHECK: }38! CHECK: }39! CHECK: omp.terminator40! CHECK: }41! CHECK: return42! CHECK: }43 44subroutine cancellationpoint_sections()45 !$omp sections46 !$omp section47 !$omp cancellationpoint sections48 !$omp end sections49end subroutine50! CHECK-LABEL: func.func @_QPcancellationpoint_sections() {51! CHECK: omp.sections {52! CHECK: omp.section {53! CHECK: omp.cancellation_point cancellation_construct_type(sections)54! CHECK: omp.terminator55! CHECK: }56! CHECK: omp.terminator57! CHECK: }58! CHECK: return59! CHECK: }60 61subroutine cancellationpoint_taskgroup()62 !$omp taskgroup63 !$omp task64 !$omp cancellationpoint taskgroup65 !$omp end task66 !$omp end taskgroup67end subroutine68! CHECK-LABEL: func.func @_QPcancellationpoint_taskgroup() {69! CHECK: omp.taskgroup {70! CHECK: omp.task {71! CHECK: omp.cancellation_point cancellation_construct_type(taskgroup)72! CHECK: omp.terminator73! CHECK: }74! CHECK: omp.terminator75! CHECK: }76! CHECK: return77! CHECK: }78