File: ordered-threads.f90

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (40 lines) | stat: -rw-r--r-- 1,499 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
! This test checks lowering of OpenMP ordered directive with threads Clause.
! Without clause in ordered direcitve, it behaves as if threads clause is
! specified.

!RUN: %flang_fc1 -emit-fir -fopenmp %s -o - | FileCheck %s --check-prefix=FIRDialect
!RUN: %flang_fc1 -emit-fir -fopenmp %s -o - | fir-opt --fir-to-llvm-ir | FileCheck %s --check-prefix=LLVMIRDialect
!RUN: %flang_fc1 -emit-fir -fopenmp %s -o - | fir-opt --fir-to-llvm-ir | tco | FileCheck %s --check-prefix=LLVMIR

subroutine ordered
        integer :: i
        integer :: a(20)

!FIRDialect: omp.ordered_region  {
!LLVMIRDialect: omp.ordered_region  {
!LLVMIR: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB0:[0-9]+]])
!LLVMIR-NEXT: call void @__kmpc_ordered(ptr @[[GLOB0]], i32 [[TMP0]])
!$OMP ORDERED
        a(i) = a(i-1) + 1
!FIRDialect:   omp.terminator
!FIRDialect-NEXT: }
!LLVMIRDialect:   omp.terminator
!LLVMIRDialect-NEXT: }
!LLVMIR: call void @__kmpc_end_ordered(ptr @[[GLOB0]], i32 [[TMP0]])
!$OMP END ORDERED

!FIRDialect: omp.ordered_region  {
!LLVMIRDialect: omp.ordered_region  {
!LLVMIR: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1:[0-9]+]])
!LLVMIR-NEXT: call void @__kmpc_ordered(ptr @[[GLOB1]], i32 [[TMP1]])
!$OMP ORDERED THREADS
        a(i) = a(i-1) + 1
!FIRDialect:   omp.terminator
!FIRDialect-NEXT: }
!LLVMIRDialect:   omp.terminator
!LLVMIRDialect-NEXT: }
!LLVMIR: call void @__kmpc_end_ordered(ptr @[[GLOB1]], i32 [[TMP1]])
!LLVMIR-NEXT: ret void
!$OMP END ORDERED

end