Add function merger to be run during LTO link with gold plugin (#121343)
[llvm-project.git] / flang / test / Parser / assume-aligned.f90
blobc61c10d61d72feea453dd3825dc0ba5dd855be53
1 ! RUN: %flang_fc1 -fdebug-unparse-no-sema %s 2>&1 | FileCheck %s
3 SUBROUTINE aa(a, nn)
4 IMPLICIT NONE
5 INTEGER, INTENT(IN) :: nn
6 COMPLEX(8), INTENT(INOUT), DIMENSION(1:nn) :: a
7 INTEGER :: i
8 !DIR$ assume_aligned a:16
9 !CHECK: !DIR$ ASSUME_ALIGNED a:16
10 !DIR$ assume_aligned a (1):16
11 !CHECK: !DIR$ ASSUME_ALIGNED a(1):16
12 !DIR$ assume_aligned a(1):16
13 !CHECK: !DIR$ ASSUME_ALIGNED a(1):16
14 !DIR$ assume_aligned a(nn):16
15 !CHECK: !DIR$ ASSUME_ALIGNED a(nn):16
16 !DIR$ assume_aligned a(44):16
17 !CHECK: !DIR$ ASSUME_ALIGNED a(44):16
18 DO i=1,nn
19 a(i)=a(i)+1.5
20 END DO
21 END SUBROUTINE aa
23 SUBROUTINE bb(v, s, e)
24 IMPLICIT NONE
25 INTEGER, INTENT(IN) :: s(3), e(3)
26 INTEGER :: y,z
27 REAL(8), INTENT(IN) :: v(s(1):e(1),s(2):e(2),s(3):e(3))
28 !DIR$ assume_aligned v(s(1),y,z) :64
29 !CHECK: !DIR$ ASSUME_ALIGNED v(s(1),y,z):64
30 END SUBROUTINE bb
32 SUBROUTINE f(n)
33 IMPLICIT NONE
34 TYPE node
35 REAL(KIND=8), POINTER :: a(:,:)
36 END TYPE NODE
38 TYPE(NODE), POINTER :: nodes
39 INTEGER :: i
40 INTEGER, INTENT(IN) :: n
42 ALLOCATE(nodes)
43 ALLOCATE(nodes%a(1000,1000))
45 !DIR$ ASSUME_ALIGNED nodes%a(1,1) : 16
46 !CHECK: !DIR$ ASSUME_ALIGNED nodes%a(1,1):16
47 DO i=1,n
48 nodes%a(1,i) = nodes%a(1,i)+1
49 END DO
50 END SUBROUTINE f
52 SUBROUTINE g(a, b)
53 IMPLICIT NONE
54 INTEGER, INTENT(in) :: a(128), b(128)
55 !DIR$ ASSUME_ALIGNED a:32, b:64
56 !CHECK: !DIR$ ASSUME_ALIGNED a:32, b:64
57 END SUBROUTINE g