
! executable-program		R201(a)
! program-unit			R202(a)
! main-program			R1101(e)
! program-stmt			R1102

PROGRAM prg1

! specification-part		R204(d)
! hpf-directive-line		H201
! directive-origin		H202(a)
! hpf-directive			H203(a)
! specification-directive	H204(a)
! processors-directive		H331
! processors-decl-list		xyz-list(a)
! processors-decl		H332(a)
! explicit-shape-spec-list	xyz-list(b)
! explicit-shape-spec		R513(b)
! upper-bound			R515
! specification-expr            R734
! expr                          R723(b)
! level-5-expr                  R718(b)
! equiv-operand                 R717(b)
! or-operand                    R716(b)
! and-operand                   R715(b)
! level-4-expr                  R713(b)
! level-3-expr                  R711(b)
! level-2-expr                  R707(c)
! add-operand                   R706(b)
! mult-operand                  R705(b)
! level-1-expr                  R703(b)
! primary                       R701(a)
! constant                      R305(a)
! literal-constant              R306(a)
! int-literal-constant          R404(b)
! digit-string                  R402(b)
! processors-decl		H332(b)

  !HPF$ PROCESSORS pcs1 (2), pcs2

! processors-decl-list		xyz-list(b)

  !HPF$ PROCESSORS pcs3

! explicit-shape-spec-list	xyz-list(a)

  !HPF$ PROCESSORS pcs4 (2, 2, 2, 2)
  !HPF$ PROCESSORS pcs5 (2)

! specification-directive	H204(g)
! combined-attribute-list	xyz-list(a)
! combined-attr			H302(e)
! combined-attr			H302(b)
! dist-attribute-stuff		H306(a)
! dist-directive-stuff		H305(b)
! dist-format-clause		H308(a)
! dist-format-list		xyz-list(b)
! dist-format			H309(b)
! entity-decl-list              xyz-list(b)
! entity-decl                   R504(g)

  !HPF$ TEMPLATE, DISTRIBUTE (BLOCK) :: tmp1 (2)

! specification-directive	H204(f)
! template-directive		H334
! template-decl-list		xyz-list(b)
! template-decl			H335(a)

  !HPF$ TEMPLATE tmp2 (2)
  !HPF$ TEMPLATE, DISTRIBUTE (BLOCK) :: tmp6 (2)
  !HPF$ TEMPLATE, DISTRIBUTE (BLOCK) :: tmp7 (2)
  !HPF$ TEMPLATE, DISTRIBUTE (BLOCK) :: tmp8 (2)
  !HPF$ TEMPLATE, DISTRIBUTE (BLOCK) :: tmp9 (2)
  !HPF$ TEMPLATE, DISTRIBUTE (BLOCK) :: tmp10 (2)
  !HPF$ TEMPLATE, DISTRIBUTE (CYCLIC) :: tmp11 (2)
  !HPF$ TEMPLATE, DISTRIBUTE (CYCLIC) :: tmp12 (2)
  !HPF$ TEMPLATE, DISTRIBUTE (CYCLIC) :: tmp13 (2)
  !HPF$ TEMPLATE, DISTRIBUTE (CYCLIC) :: tmp14 (2)

! declaration-construct		R207(a)
! derived-type-def		R422(d)
! derived-type-stmt		R424(c)

  TYPE typ1

! component-def-stmt		R426(a)
! type-spec			R502(b)
! component-attr-spec-list	xyz-list(b)
! component-attr-spec		R427(a)
! component-decl-list		xyz-list(b)
! component-decl		R429(d)

    INTEGER, POINTER :: cmp1

! end-type-stmt			R425(b)

  END TYPE

! declaration-construct		R207(c)
! type-declaration-stmt		R501(c)
! entity-decl                   R504(g)
! array-spec			R512(a)

  INTEGER obj1 (2, 2, 2)

! digit-string                  R402(a)

  INTEGER obj2 (2, 16, 2, 2)

! specification-directive	H204(c)
! distribute-directive		H303
! distributee			H307(a)
! dist-format-list		xyz-list(a)

  !HPF$ DISTRIBUTE obj2 (BLOCK, BLOCK, BLOCK, BLOCK)
  INTEGER obj3 (2)
  INTEGER obj4 (2)
  INTEGER obj5 (2)
  !HPF$ DISTRIBUTE obj5 (BLOCK)
  INTEGER obj6 (4, 2, 8, 4, 2)
  INTEGER obj7 (2)
  !HPF$ DISTRIBUTE obj7 (BLOCK)
  INTEGER obj8 (2)
  !HPF$ DISTRIBUTE obj8 (BLOCK)
  INTEGER obj9 (2)
  !HPF$ DISTRIBUTE obj9 (BLOCK)
  INTEGER obj10 (2)
  INTEGER obj13 (2)
  INTEGER obj14 (2)
  INTEGER obj15 (2)

! combined-attr			H302(a)
! align-attribute-stuff		H315(b)
! align-with-clause		H319
! align-spec			H320(b)
! align-target			H321(b)
! combined-attr			H302(c)

  !HPF$ ALIGN WITH tmp11, DYNAMIC :: obj15
  INTEGER obj16 (2)
  !HPF$ ALIGN WITH tmp12, DYNAMIC :: obj16
  INTEGER obj17 (2)
  !HPF$ ALIGN WITH tmp13, DYNAMIC :: obj17
  INTEGER obj18 (2)
  !HPF$ ALIGN WITH tmp14, DYNAMIC :: obj18
  INTEGER obj19 (2)

! dist-format			H309(d)

  !HPF$ DISTRIBUTE (CYCLIC), DYNAMIC :: obj19
  INTEGER obj20 (2)
  !HPF$ DISTRIBUTE (CYCLIC), DYNAMIC :: obj19
  INTEGER obj21 (2)
  !HPF$ DISTRIBUTE (CYCLIC), DYNAMIC :: obj21
  INTEGER obj22 (2)
  !HPF$ DISTRIBUTE (CYCLIC), DYNAMIC :: obj22

! entity-decl                   R504(h)

  INTEGER var1
  INTEGER var2 (2)
  INTEGER var3 (2)
  INTEGER var4 (2)
  INTEGER var5 (2)
  INTEGER var6
  INTEGER var7
  INTEGER var8
  INTEGER var9
  INTEGER var10
  INTEGER var11 (4)
  INTEGER idx1
  INTEGER idx2
  INTEGER idx3
  INTEGER idx4
  INTEGER idx5
  INTEGER idx6

! type-spec			R502(b)

  TYPE (typ1) var12 (2)

! type-declaration-stmt		R501(a)
! attr-spec			R503(k)

  INTEGER, TARGET :: var13
  INTEGER var14 (2)

! type-spec			R502(k)
! entity-decl			R504(c)
! literal-constant		R306(d)
! logical-literal-constant	R421(a)

  LOGICAL var15 (2) = .TRUE.
  INTEGER var16 (2, 2)
  LOGICAL var17 (2) = .TRUE.
  INTEGER var18 (2, 2)
  INTEGER var19 (2, 2)
  INTEGER var20

! declaration-construct		R207(d)
! specification-stmt		R214(c)
! common-stmt			R548(d)
! common-block-object-list	xyz-list(b)
! common-block-object		R549(b)

  COMMON /com1/ var20

! specification-directive	H204(b)
! align-directive		H312
! alignee			H316
! align-directive-stuff		H315
! align-source-list		xyz-list(a)
! align-source			H317(a)
! align-source			H317(b)
! align-source			H317(c)
! align-dummy			H318
! variable                      R601(a)
! align-with-clause		H319
! align-spec			H320(a)
! align-target			H321(a)
! align-subscript-list		xyz-list(a)
! align-subscript		H322(a)
! align-subscript		H322(b)
! align-subscript-use		H323(a)
! align-add-operand		H324(a)
! align-primary			H324(b)
! align-subscript-use		H323(b)
! align-add-operand		H324(b)
! align-subscript-use		H323(c)
! align-add-operand		H324(c)
! align-subscript-use		H323(d)
! align-primary			H324(a)
! align-subscript		H322(c)
! align-subscript		H322(d)

  !HPF$ ALIGN obj1 (: , *, var1) WITH obj2 (1, 1 + 2 * (+ ((var1 + 1) * 2)), :, *)

! align-source-list		xyz-list(b)
! align-spec			H320(b)
! align-target			H321(b)

  !HPF$ ALIGN obj3 (:) WITH tmp1

! align-subscript-list		xyz-list(b)

  !HPF$ ALIGN obj4 (:) WITH obj5 (:)

! specification-directive	H204(c)
! distribute-directive		H303
! distributee			H307(a)
! dist-directive-stuff		H305(a)
! dist-format-clause		H308(a)
! dist-format-list		xyz-list(a)
! dist-format			H309(a)
! dist-format			H309(b)
! dist-format			H309(c)
! dist-format			H309(d)
! dist-format			H309(e)
! dist-onto-clause		H310
! dist-target			H311(a)

  !HPF$ DISTRIBUTE obj6 (BLOCK (2), BLOCK, CYCLIC (2), CYCLIC, *) ONTO pcs4

! distributee			H307(b)
! dist-format-list		xyz-list(b)

  !HPF$ DISTRIBUTE tmp2 (BLOCK)

! specification-directive	H204(d)
! dynamic-directive		H329
! alignee-or-distributee-list	xyz-list(a)
! alignee-or-distributee	H330(a)
! alignee-or-distributee	H330(b)

  !HPF$ DYNAMIC obj7, obj8

! alignee-or-distributee-list	xyz-list(b)

  !HPF$ DYNAMIC obj9

! specification-directive	H204(f)
! template-directive		H334
! template-decl-list		xyz-list(a)
! template-decl			H335(a)
! template-decl			H335(b)

  !HPF$ TEMPLATE tmp3 (2), tmp4

! template-decl-list		xyz-list(b)

  !HPF$ TEMPLATE tmp5

! specification-directive	H204(g)
! combined-directive		H301
! combined-attribute-list	xyz-list(a)
! combined-attribute		H302(a)
! align-attribute-stuff		H315(a)
! combined-attribute		H302(c)
! entity-decl-list              xyz-list(b)
! entity-decl                   R504(h)

  !HPF$ ALIGN (:) WITH tmp6, DYNAMIC :: obj10

! combined-attribute		H302(b)
! dist-attribute-stuff		H306(a)
! combined-attribute		H302(e)

  !HPF$ DISTRIBUTE (BLOCK), TEMPLATE :: obj11

! combined-attribute		H302(f)
! combined-attribute		H302(g)

  !HPF$ PROCESSORS, DIMENSION (2) :: obj12

! combined-attribute-list	xyz-list(b)
! align-attribute-stuff		H315(a)

  !HPF$ ALIGN WITH tmp7 :: obj13

! dist-attribute-stuff		H306(b)

  !HPF$ DISTRIBUTE ONTO pcs5 :: obj14

! specification-directive	H204(h)
! sequence-directive		H701(a)
! association-name-list		xyz-list(a)
! association-name		H702(a)
! association-name		H702(b)

  !HPF$ SEQUENCE :: var2, /com1/

! sequence-directive		H701(b)
! association-name-list		xyz-list(b)

  !HPF$ SEQUENCE var3

! sequence-directive		H701(c)

  !HPF$ SEQUENCE

! sequence-directive		H701(d)

  !HPF$ NO SEQUENCE :: var4

! sequence-directive		H701(e)

  !HPF$ NO SEQUENCE var5

! execution-part		R208(a)
! hpf-directive-line		H201
! hpf-directive			H203(b)
! executable-directive		H205(a)
! realign-directive		H313(a)

  !HPF$ REALIGN obj15 (:) WITH tmp8

! realign-directive		H313(b)
! alignee-list			xyz-list(a)

  !HPF$ REALIGN WITH tmp9 :: obj16, obj17

! alignee-list			xyz-list(b)

  !HPF$ REALIGN WITH tmp10 :: obj18

! executable-directive		H205(b)
! redistribute-directive	H304(a)

  !HPF$ REDISTRIBUTE obj19 (BLOCK)

! redistribute-directive	H304(a)
! distributee-list		xyz-list(a)

  !HPF$ REDISTRIBUTE (BLOCK) :: obj20, ojb21

! distributee-list		xyz-list(b)

  !HPF$ REDISTRIBUTE (BLOCK) :: obj22

! executable-directive		H205(c)
! independent-directive		H413(a)
! new-clause			H414
! variable-list			xyz-list(a)

  !HPF$ INDEPENDENT, NEW (var6, var7)

! executable-construct		R215(c)
! do-construct			R816(a)
! block-do-construct		R817
! do-stmt			R818(b)
! nonlabel-do-stmt		R820(b)
! loop-control			R821(d)
! do-variable			R822

  DO var8 = 1, 2

! do-block			R823
! block				R801(a)
! execution-part-construct	R209(a)
! executable-construct		R215(a)
! action-stmt			R216(b)
! assignment-stmt		R735

    var6 = 0
    var7 = 0

! end-do			R824(a)
! end-do-stmt			R825(b)

  END DO

! variable-list			xyz-list(b)

  !HPF$ INDEPENDENT, NEW (var9)
  DO var10 = 1, 2
    var9 = 0
  END DO

! independent-directive		H413(b)

  !HPF$ INDEPENDENT

! forall-stmt			H401
! forall-header			H402(a)
! forall-triplet-spec-list	xyz-list(a)
! forall-triplet-spec		H403(a)
! forall-triplet-spec		H403(b)
! forall-assignment		H404(a)
! subscript			R619
! mask-expr			R741
! level-4-expr                  R713(a)
! primary			R701(c)
! rel-op			R714(a)
! variable			R601(c)
! subobject			R602(a)
! array-element			R615
! data-ref			R612(b)
! part-ref			R613(a)
! section-subscript-list	xyz-list(b)
! section-subscript		R618(a)

  FORALL (idx1 = 1 : 3 : 2, idx2 = 1 : 2, idx1 .EQ. idx2) var11 (idx1) = 0

! forall-header			H402(b)
! forall-triplet-spec-list	xyz-list(b)
! forall-assignment		H404(b)
! pointer-assignment-stmt	R736
! pointer-object		R630(b)
! structure-component		R614
! data-ref			R612(a)
! part-ref			R613(b)
! target			R737(a)

  FORALL (idx3 = 1 : 2) var12 (idx3) % cmp1 => var13

! forall-construct		H405(a)

  FORALL (idx4 = 1 : 2)

! forall-body-stmt		H406(a)

    var14 (idx4) = 0

! forall-body-stmt		H406(b)
! where-stmt			R738
! section-subscript-list	xyz-list(a)
! section-subscript		R618(b)
! subscript-triplet		R619(h)

    WHERE (var15) var16 (idx4, :) = 0

! forall-body-stmt		H406(c)
! where-construct		R739(d)
! where-construct-stmt		R740

    WHERE (var17)

! end-where-stmt		R743

    END WHERE

! forall-body-stmt		H406(d)

    FORALL (idx5 = 1 : 2) var18 (idx4, idx5) = 0

! forall-body-stmt		H406(e)
! forall-construct		H405(b)

    FORALL (idx6 = 1 : 2)
      var19 (idx4, idx6) = 0
    END FORALL
  END FORALL

! end-program-stmt		R1103(b)

END PROGRAM

! program-unit			R202(b)
! external-subprogram		R203(a)
! function-subprogram		R1215(d)
! function-stmt			H409(a)
! prefix			H407(a)
! prefix-spec			H408(a)
! prefix-spec			H408(b)
! prefix-spec			H408(c)
! function-stuff		H410(a)
! type-spec			R502(b)
! dummy-arg-name-list		xyz-list(a)

INTEGER RECURSIVE PURE FUNCTION fun1 (dum1, dum2, dum3, dum4) RESULT (res1)
  INTEGER dum1 (2)
  INTEGER dum2 (2)
  INTEGER dum3 (2)
  INTEGER dum4 (2)
  INTEGER res1

! align-spec			H320(c)

  !HPF$ ALIGN dum1 (:) WITH * dum2 (:)

! align-spec			H320(d)

  !HPF$ ALIGN dum3 (:) WITH * dum4

! sequence-directive		H701(f)

  !HPF$ NO SEQUENCE

! end-function-stmt		R1218(b)

END FUNCTION

! function-stmt			H409(b)
! function-stuff		H410(b)

FUNCTION fun2 () RESULT (res2)
  INTEGER res2
END FUNCTION

! function-stuff		H410(c)

FUNCTION fun3 (dum5, dum6, dum7, dum8)
  INTEGER dum5 (2)
  INTEGER dum6 (2)
  INTEGER dum7 (2)
  INTEGER dum8 (2)
  !HPF$ PROCESSORS pcs6 (2)

! specification-directive	H204(e)
! inherit-directive		H337
! dummy-arg-name-list		xyz-list(b)

  !HPF$ INHERIT dum5

! dist-format-clause		H308(b)
! dist-target			H311(b)

  !HPF$ DISTRIBUTE dum6 * (BLOCK) ONTO * pcs6

! dist-format-clause		H308(c)
! dist-target			H311(c)

  !HPF$ DISTRIBUTE dum7 * ONTO *

! combined-attribute		H302(d)

  !HPF$ INHERIT :: dum8
END FUNCTION

! function-stuff		H410(d)

FUNCTION fun4 ()
END FUNCTION

! external-subprogram		R203(b)
! subroutine-subprogram		R1219(d)
! subroutine-stmt		H411(a)
! prefix			H407(b)
! prefix-spec			H408(d)
! extrinsic-prefix		H601
! extrinsic-kind-keyword	H602(a)
! subroutine-stuff		H412(a)
! dummy-arg-name-list		xyz-list(b)
! dummy-arg			R1221(a)

EXTRINSIC (HPF) SUBROUTINE sub1 (dum9)
  INTEGER dum9

! end-subroutine-stmt		R1222(b)

END SUBROUTINE

! extrinsic-kind-keyword	H602(b)
! subroutine-stuff		H412(b)

EXTRINSIC (HPF_LOCAL) SUBROUTINE sub2 ()
END SUBROUTINE

! subroutine-stmt		H411(b)
! subroutine-stuff		H412(c)

SUBROUTINE sub3
END SUBROUTINE

