xref: /llvm-project/flang/test/Lower/vector-always.f90 (revision c6b6e18c4d25305ab98b6eab752de99ea4e15344)
1! RUN: %flang_fc1 -emit-hlfir -o - %s | FileCheck %s
2
3! CHECK: #loop_vectorize = #llvm.loop_vectorize<disable = false>
4! CHECK: #loop_annotation = #llvm.loop_annotation<vectorize = #loop_vectorize>
5
6! CHECK-LABEL: vector_always
7subroutine vector_always
8  integer :: a(10)
9  !dir$ vector always
10  !CHECK: fir.do_loop {{.*}} attributes {loopAnnotation = #loop_annotation}
11  do i=1,10
12     a(i)=i
13  end do
14end subroutine vector_always
15
16
17! CHECK-LABEL: intermediate_directive
18subroutine intermediate_directive
19  integer :: a(10)
20  !dir$ vector always
21  !dir$ unknown
22  !CHECK: fir.do_loop {{.*}} attributes {loopAnnotation = #loop_annotation}
23  do i=1,10
24     a(i)=i
25  end do
26end subroutine intermediate_directive
27