brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 47d379d Raw
117 lines · plain
1! REQUIRES: openmp_runtime2 3! RUN: %flang_fc1 -emit-hlfir %openmp_flags -fopenmp-version=52 %s -o - | FileCheck %s4 5! CHECK-LABEL: func @_QPteams_simple6subroutine teams_simple()7  ! CHECK: omp.teams8  !$omp teams9  ! CHECK: fir.call10  call f1()11  ! CHECK: omp.terminator12  !$omp end teams13end subroutine teams_simple14 15!===============================================================================16! `num_teams` clause17!===============================================================================18 19! CHECK-LABEL: func @_QPteams_numteams20subroutine teams_numteams(num_teams)21  integer, intent(inout) :: num_teams22 23  ! CHECK: omp.teams24  ! CHECK-SAME: num_teams( to %{{.*}}: i32)25  !$omp teams num_teams(4)26  ! CHECK: fir.call27  call f1()28  ! CHECK: omp.terminator29  !$omp end teams30 31  ! CHECK: omp.teams32  ! CHECK-SAME: num_teams( to %{{.*}}: i32)33  !$omp teams num_teams(num_teams)34  ! CHECK: fir.call35  call f2()36  ! CHECK: omp.terminator37  !$omp end teams38 39end subroutine teams_numteams40 41!===============================================================================42! `if` clause43!===============================================================================44 45! CHECK-LABEL: func @_QPteams_if46subroutine teams_if(alpha)47  integer, intent(in) :: alpha48  logical :: condition49 50  ! CHECK: omp.teams51  ! CHECK-SAME: if(%{{.*}})52  !$omp teams if(.false.)53  ! CHECK: fir.call54  call f1()55  ! CHECK: omp.terminator56  !$omp end teams57 58  ! CHECK: omp.teams59  ! CHECK-SAME: if(%{{.*}})60  !$omp teams if(alpha .le. 0)61  ! CHECK: fir.call62  call f2()63  ! CHECK: omp.terminator64  !$omp end teams65 66  ! CHECK: omp.teams67  ! CHECK-SAME: if(%{{.*}})68  !$omp teams if(condition)69  ! CHECK: fir.call70  call f3()71  ! CHECK: omp.terminator72  !$omp end teams73end subroutine teams_if74 75!===============================================================================76! `thread_limit` clause77!===============================================================================78 79! CHECK-LABEL: func @_QPteams_threadlimit80subroutine teams_threadlimit(thread_limit)81  integer, intent(inout) :: thread_limit82 83  ! CHECK: omp.teams84  ! CHECK-SAME: thread_limit(%{{.*}}: i32)85  !$omp teams thread_limit(4)86  ! CHECK: fir.call87  call f1()88  ! CHECK: omp.terminator89  !$omp end teams90 91  ! CHECK: omp.teams92  ! CHECK-SAME: thread_limit(%{{.*}}: i32)93  !$omp teams thread_limit(thread_limit)94  ! CHECK: fir.call95  call f2()96  ! CHECK: omp.terminator97  !$omp end teams98 99end subroutine teams_threadlimit100 101!===============================================================================102! `allocate` clause103!===============================================================================104 105! CHECK-LABEL: func @_QPteams_allocate106subroutine teams_allocate()107   use omp_lib108   integer :: x109   ! CHECK: omp.teams110   ! CHECK-SAME: allocate(%{{.+}} : i64 -> %{{.+}} : !fir.ref<i32>)111   !$omp teams allocate(omp_high_bw_mem_alloc: x) private(x)112   ! CHECK: arith.addi113   x = x + 12114   ! CHECK: omp.terminator115   !$omp end teams116end subroutine teams_allocate117