Skip to content

Commit 6c9d9f5

Browse files
[Test] Add and update tests
1 parent 2236526 commit 6c9d9f5

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

flang/test/Fir/basic-program.fir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ func.func @_QQmain() {
4444
// PASSES-NEXT: 'omp.private' Pipeline
4545
// PASSES-NEXT: OptimizedBufferization
4646
// PASSES-NEXT: LowerHLFIROrderedAssignments
47+
// PASSES-NEXT: LowerWorkshare
4748
// PASSES-NEXT: LowerHLFIRIntrinsics
4849
// PASSES-NEXT: BufferizeHLFIR
4950
// PASSES-NEXT: ConvertHLFIRtoFIR
50-
// PASSES-NEXT: LowerWorkshare
5151
// PASSES-NEXT: CSE
5252
// PASSES-NEXT: (S) 0 num-cse'd - Number of operations CSE'd
5353
// PASSES-NEXT: (S) 0 num-dce'd - Number of operations DCE'd
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
!===----------------------------------------------------------------------===!
2+
! This directory can be used to add Integration tests involving multiple
3+
! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
4+
! contain executable tests. We should only add tests here sparingly and only
5+
! if there is no other way to test. Repeat this message in each test that is
6+
! added to this directory and sub-directories.
7+
!===----------------------------------------------------------------------===!
8+
9+
!RUN: %flang_fc1 -emit-mlir -fopenmp -O3 %s -o - | FileCheck %s --check-prefix MLIR
10+
11+
program test_ws_01
12+
implicit none
13+
real(8) :: arr_01(10), x
14+
arr_01 = [0.347,0.892,0.573,0.126,0.788,0.412,0.964,0.205,0.631,0.746]
15+
16+
!$omp parallel workshare
17+
x = sum(arr_01)
18+
!$omp end parallel workshare
19+
end program test_ws_01
20+
21+
! MLIR: func.func @_QQmain
22+
! MLIR: omp.parallel {
23+
! [...]
24+
! MLIR: omp.wsloop {
25+
! MLIR: omp.loop_nest {{.*}}
26+
! [...]
27+
! MLIR: %[[SUM:.*]] = arith.addf {{.*}}
28+
! [...]
29+
! MLIR: omp.yield
30+
! MLIR: }
31+
! MLIR: }
32+
! MLIR: omp.barrier
33+
! MLIR: omp.terminator
34+
! MLIR: }
35+
! MLIR: return
36+
! MLIR: }

0 commit comments

Comments
 (0)