66 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 HLFIR-O310!RUN: %flang_fc1 -emit-fir -fopenmp -O3 %s -o - | FileCheck %s --check-prefix FIR-O311 12!RUN: %flang_fc1 -emit-hlfir -fopenmp -O0 %s -o - | FileCheck %s --check-prefix HLFIR-O013!RUN: %flang_fc1 -emit-fir -fopenmp -O0 %s -o - | FileCheck %s --check-prefix FIR-O014 15program test16 real :: arr_01(10)17 !$omp parallel workshare18 arr_01 = arr_01*219 !$omp end parallel workshare20end program21 22! HLFIR-O3: omp.parallel {23! HLFIR-O3: omp.workshare {24! HLFIR-O3: hlfir.elemental25! HLFIR-O3: hlfir.assign26! HLFIR-O3: hlfir.destroy27! HLFIR-O3: omp.terminator28! HLFIR-O3: omp.terminator29 30! FIR-O3: omp.parallel {31! FIR-O3: omp.wsloop nowait {32! FIR-O3: omp.loop_nest33! FIR-O3: omp.barrier34! FIR-O3: omp.terminator35 36! HLFIR-O0: omp.parallel {37! HLFIR-O0: omp.workshare {38! HLFIR-O0: hlfir.elemental39! HLFIR-O0: hlfir.assign40! HLFIR-O0: hlfir.destroy41! HLFIR-O0: omp.terminator42! HLFIR-O0: omp.terminator43 44! Check the copyprivate copy function45! FIR-O0: func.func private @_workshare_copy_heap_{{.*}}(%[[DST:.*]]: {{.*}}, %[[SRC:.*]]: {{.*}})46! FIR-O0: fir.load %[[SRC]]47! FIR-O0: fir.store {{.*}} to %[[DST]]48 49! Check that we properly handle the temporary array50! FIR-O0: omp.parallel {51! FIR-O0: %[[CP:.*]] = fir.alloca !fir.heap<!fir.array<10xf32>>52! FIR-O0: omp.single copyprivate(%[[CP]] -> @_workshare_copy_heap_53! FIR-O0: fir.allocmem54! FIR-O0: fir.store55! FIR-O0: omp.terminator56! FIR-O0: fir.load %[[CP]]57! FIR-O0: omp.wsloop {58! FIR-O0: omp.loop_nest59! FIR-O0: omp.yield60! FIR-O0: omp.single nowait {61! FIR-O0: fir.call @_FortranAAssign62! FIR-O0: fir.freemem63! FIR-O0: omp.terminator64! FIR-O0: omp.barrier65! FIR-O0: omp.terminator66