brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 56a10f9 Raw
106 lines · plain
1! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s2 3! Test that compiler directives can appear in various places.4 5#define PROC(KIND) \6  interface; integer(KIND) function foo(a); \7    integer(KIND), intent(in) :: a; \8    !dir$ ignore_tkr a; \9  end; end interface10 11!dir$ integer12module m13  !dir$ integer14  use iso_fortran_env15  !dir$ integer16  implicit integer(a-z)17  !dir$ integer18  !dir$ integer=6419  !dir$ integer = 6420  !dir$  integer = 6421  PROC(4)22  !dir$ optimize:123  !dir$ optimize : 124  !dir$ loop count (10000)25  !dir$ loop count (1, 500, 5000, 10000)26  type stuff27     real(8), allocatable :: d(:)28     !dir$  align : 1024 :: d29  end type stuff30end31 32subroutine vector_always33  !dir$ vector always34  ! CHECK: !DIR$ VECTOR ALWAYS35  do i=1,1036  enddo37end subroutine38 39subroutine unroll40  !dir$ unroll41  ! CHECK: !DIR$ UNROLL42  do i=1,1043  enddo44  !dir$ unroll 245  ! CHECK: !DIR$ UNROLL 246  do i=1,1047  enddo48  !dir$ nounroll49  ! CHECK: !DIR$ NOUNROLL 50  do i=1,1051  enddo52end subroutine53 54subroutine unroll_and_jam55  !dir$ unroll_and_jam56  ! CHECK: !DIR$ UNROLL_AND_JAM57  do i=1,1058  enddo59  !dir$ unroll_and_jam 260  ! CHECK: !DIR$ UNROLL_AND_JAM 261  do i=1,1062  enddo63  !dir$ nounroll_and_jam64  ! CHECK: !DIR$ NOUNROLL_AND_JAM 65  do i=1,1066  enddo67end subroutine68 69subroutine no_vector70  !dir$ novector71  ! CHECK: !DIR$ NOVECTOR72  do i=1,1073  enddo74end subroutine75 76subroutine inline77  integer :: a78  !dir$ forceinline 79  ! CHECK: !DIR$ FORCEINLINE 80  a = f(2)81 82  !dir$ inline 83  ! CHECK: !DIR$ INLINE 84  call g()85 86  !dir$ noinline 87  ! CHECK: !DIR$ NOINLINE 88  call g()89 90  contains91    function f(x)92      integer :: x93      f = x**294    end function95 96    subroutine g()97    end subroutine98end subroutine99 100subroutine ivdep 101  !dir$ ivdep 102  ! CHECK: !DIR$ IVDEP 103  do i=1,10104  enddo105end subroutine106