brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 6c180cd Raw
46 lines · plain
1!===----------------------------------------------------------------------===!2! This directory can be used to add Integration tests involving multiple3! stages of the compiler (for eg. from Fortran to LLVM IR). It should not4! contain executable tests. We should only add tests here sparingly and only5! if there is no other way to test. Repeat this message in each test that is6! added to this directory and sub-directories.7!===----------------------------------------------------------------------===!8 9!RUN: %flang_fc1 -emit-hlfir -fopenmp -O3 %s -o - | FileCheck %s --check-prefix HLFIR10!RUN: %flang_fc1 -emit-fir -fopenmp -O3 %s -o - | FileCheck %s --check-prefix FIR11 12subroutine sb1(a, x)13  integer :: a14  integer :: x(:)15  !$omp parallel workshare16  x = a17  !$omp end parallel workshare18end subroutine19 20! HLFIR:     omp.parallel {21! HLFIR:       omp.workshare {22! HLFIR:         %[[SCALAR:.*]] = fir.load %1#0 : !fir.ref<i32>23! HLFIR:         hlfir.assign %[[SCALAR]] to24! HLFIR:         omp.terminator25! HLFIR:       }26! HLFIR:       omp.terminator27! HLFIR:     }28 29! FIR:     omp.parallel {30! FIR:       %[[SCALAR_ALLOCA:.*]] = fir.alloca i3231! FIR:       omp.single copyprivate(%[[SCALAR_ALLOCA]] -> @_workshare_copy_i32 : !fir.ref<i32>) {32! FIR:         %[[SCALAR_LOAD:.*]] = fir.load %{{.*}} : !fir.ref<i32>33! FIR:         fir.store %[[SCALAR_LOAD]] to %[[SCALAR_ALLOCA]] : !fir.ref<i32>34! FIR:         omp.terminator35! FIR:       }36! FIR:       %[[SCALAR_RELOAD:.*]] = fir.load %[[SCALAR_ALLOCA]] : !fir.ref<i32>37! FIR:       %6:3 = fir.box_dims %3, %c0 : (!fir.box<!fir.array<?xi32>>, index) -> (index, index, index)38! FIR:       omp.wsloop nowait {39! FIR:         omp.loop_nest (%arg2) : index = (%c1) to (%6#1) inclusive step (%c1) {40! FIR:           fir.store %[[SCALAR_RELOAD]]41! FIR:           omp.yield42! FIR:         }43! FIR:       }44! FIR:       omp.barrier45! FIR:       omp.terminator46