[clang][bytecode] Implement __builtin_reduce_mul (#118287)
[llvm-project.git] / flang / test / Driver / omp-cse-region-boundary.f90
blob726ac4899ba708afe89c549e2725c56d5a8ab806
1 !This test checks that when compiling an OpenMP program for the target device
2 !CSE is not done across target op region boundaries. It also checks that when
3 !compiling for the host CSE is done.
4 !RUN: %flang_fc1 -fopenmp-is-target-device -emit-mlir -fopenmp %s -o - | fir-opt -cse | FileCheck %s -check-prefix=CHECK-DEVICE
5 !RUN: %flang_fc1 -emit-mlir -fopenmp %s -o - | fir-opt -cse | FileCheck %s -check-prefix=CHECK-HOST
6 !RUN: bbc -fopenmp-is-target-device -emit-fir -fopenmp %s -o - | fir-opt -cse | FileCheck %s -check-prefix=CHECK-DEVICE
7 !RUN: bbc -emit-fir -fopenmp %s -o - | fir-opt -cse | FileCheck %s -check-prefix=CHECK-HOST
9 !Constant should be present inside target region.
10 !CHECK-DEVICE: omp.target
11 !CHECK-DEVICE: arith.constant 10
12 !CHECK-DEVICE: omp.terminator
14 !Constant should not be present inside target region.
15 !CHECK-HOST: omp.target
16 !CHECK-NOT-HOST: arith.constant 10
17 !CHECK-HOST: omp.terminator
19 subroutine writeIndex(sum)
20 integer :: sum
21 integer :: myconst1
22 integer :: myconst2
23 myconst1 = 10
24 !$omp target map(from:myconst2)
25 myconst2 = 10
26 !$omp end target
27 sum = myconst2 + myconst2
28 end subroutine writeIndex