diff --git a/5-add-test-cases-for-flang.patch b/5-add-test-cases-for-flang.patch new file mode 100644 index 0000000000000000000000000000000000000000..e8e385c1a0621ee42bb61a63811b933fbf0856e2 --- /dev/null +++ b/5-add-test-cases-for-flang.patch @@ -0,0 +1,749 @@ +From bbec620af63928c9b26a8b6f1853e35df21fb523 Mon Sep 17 00:00:00 2001 +From: Koty_C <837009319@qq.com> +Date: Mon, 17 Oct 2022 20:08:39 +0800 +Subject: [PATCH] add test cases for flang + +--- + test/Semantics/fortran_test001.f90 | 11 +++++++++++ + test/Semantics/fortran_test002.f90 | 11 +++++++++++ + test/Semantics/fortran_test003.f90 | 12 ++++++++++++ + test/Semantics/fortran_test004.f90 | 12 ++++++++++++ + test/Semantics/fortran_test005.f90 | 11 +++++++++++ + test/Semantics/fortran_test006.f90 | 14 ++++++++++++++ + test/Semantics/fortran_test007.f90 | 10 ++++++++++ + test/Semantics/fortran_test008.f90 | 10 ++++++++++ + test/Semantics/fortran_test009.f90 | 19 +++++++++++++++++++ + test/Semantics/fortran_test010.f90 | 18 ++++++++++++++++++ + test/Semantics/fortran_test011.f90 | 23 +++++++++++++++++++++++ + test/Semantics/fortran_test012.f90 | 20 ++++++++++++++++++++ + test/Semantics/fortran_test013.f90 | 11 +++++++++++ + test/Semantics/fortran_test014.f90 | 14 ++++++++++++++ + test/Semantics/fortran_test015.f90 | 14 ++++++++++++++ + test/Semantics/fortran_test016.f90 | 17 +++++++++++++++++ + test/Semantics/fortran_test017.f90 | 17 +++++++++++++++++ + test/Semantics/fortran_test018.f90 | 12 ++++++++++++ + test/Semantics/fortran_test019.f90 | 11 +++++++++++ + test/Semantics/fortran_test020.f90 | 26 ++++++++++++++++++++++++++ + test/Semantics/fortran_test021.f90 | 11 +++++++++++ + test/Semantics/fortran_test022.f90 | 10 ++++++++++ + test/Semantics/fortran_test023.f90 | 12 ++++++++++++ + test/Semantics/fortran_test024.f90 | 16 ++++++++++++++++ + test/Semantics/fortran_test025.f90 | 15 +++++++++++++++ + test/Semantics/fortran_test026.f90 | 15 +++++++++++++++ + test/Semantics/fortran_test027.f90 | 14 ++++++++++++++ + test/Semantics/fortran_test028.f90 | 14 ++++++++++++++ + test/Semantics/fortran_test029.f90 | 14 ++++++++++++++ + test/Semantics/fortran_test030.f90 | 14 ++++++++++++++ + test/Semantics/fortran_test031.f90 | 16 ++++++++++++++++ + test/Semantics/fortran_test032.f90 | 19 +++++++++++++++++++ + 32 files changed, 463 insertions(+) + create mode 100644 test/Semantics/fortran_test001.f90 + create mode 100644 test/Semantics/fortran_test002.f90 + create mode 100644 test/Semantics/fortran_test003.f90 + create mode 100644 test/Semantics/fortran_test004.f90 + create mode 100644 test/Semantics/fortran_test005.f90 + create mode 100644 test/Semantics/fortran_test006.f90 + create mode 100644 test/Semantics/fortran_test007.f90 + create mode 100644 test/Semantics/fortran_test008.f90 + create mode 100644 test/Semantics/fortran_test009.f90 + create mode 100644 test/Semantics/fortran_test010.f90 + create mode 100644 test/Semantics/fortran_test011.f90 + create mode 100644 test/Semantics/fortran_test012.f90 + create mode 100644 test/Semantics/fortran_test013.f90 + create mode 100644 test/Semantics/fortran_test014.f90 + create mode 100644 test/Semantics/fortran_test015.f90 + create mode 100644 test/Semantics/fortran_test016.f90 + create mode 100644 test/Semantics/fortran_test017.f90 + create mode 100644 test/Semantics/fortran_test018.f90 + create mode 100644 test/Semantics/fortran_test019.f90 + create mode 100644 test/Semantics/fortran_test020.f90 + create mode 100644 test/Semantics/fortran_test021.f90 + create mode 100644 test/Semantics/fortran_test022.f90 + create mode 100644 test/Semantics/fortran_test023.f90 + create mode 100644 test/Semantics/fortran_test024.f90 + create mode 100644 test/Semantics/fortran_test025.f90 + create mode 100644 test/Semantics/fortran_test026.f90 + create mode 100644 test/Semantics/fortran_test027.f90 + create mode 100644 test/Semantics/fortran_test028.f90 + create mode 100644 test/Semantics/fortran_test029.f90 + create mode 100644 test/Semantics/fortran_test030.f90 + create mode 100644 test/Semantics/fortran_test031.f90 + create mode 100644 test/Semantics/fortran_test032.f90 + +diff --git a/test/Semantics/fortran_test001.f90 b/test/Semantics/fortran_test001.f90 +new file mode 100644 +index 0000000..e567d02 +--- /dev/null ++++ b/test/Semantics/fortran_test001.f90 +@@ -0,0 +1,11 @@ ++! Test C729: A derived type type-name shall not be DOUBLEPRECISION or the same ++! as the name of any intrinsic type defined in this document. ++ ++program main ++implicit none ++ !ERROR: A derived type name cannot be the name of an intrinsic type ++ type :: DOUBLEPRECISION ++ integer :: test ++ end type DOUBLEPRECISION ++ !ERROR: A derived type name cannot be the name of an intrinsic type ++end +diff --git a/test/Semantics/fortran_test002.f90 b/test/Semantics/fortran_test002.f90 +new file mode 100644 +index 0000000..4ef0c43 +--- /dev/null ++++ b/test/Semantics/fortran_test002.f90 +@@ -0,0 +1,11 @@ ++! Test C730: The same type-attr-spec shall not appear more ++! than once in a given derived-type-stmt. ++ ++program main ++implicit none ++ !warning: Attribute 'ABSTRACT' cannot be used more than once ++ type,ABSTRACT,ABSTRACT:: person ++ character(len=20) :: name ++ integer :: age ++ end type person ++end +diff --git a/test/Semantics/fortran_test003.f90 b/test/Semantics/fortran_test003.f90 +new file mode 100644 +index 0000000..6833e4a +--- /dev/null ++++ b/test/Semantics/fortran_test003.f90 +@@ -0,0 +1,12 @@ ++! Test C730: The same type-attr-spec shall not appear more ++! than once in a given derived-type-stmt. ++ ++program main ++implicit none ++ !error: PUBLIC attribute may only appear in the specification part of a module ++ !warning: Attribute 'PUBLIC' cannot be used more than once ++ type,PUBLIC,PUBLIC:: person ++ character(len=20) :: name ++ integer :: age ++ end type person ++end +diff --git a/test/Semantics/fortran_test004.f90 b/test/Semantics/fortran_test004.f90 +new file mode 100644 +index 0000000..71058f4 +--- /dev/null ++++ b/test/Semantics/fortran_test004.f90 +@@ -0,0 +1,12 @@ ++! Test C730: The same type-attr-spec shall not appear more ++! than once in a given derived-type-stmt. ++ ++program main ++implicit none ++ !error: PRIVATE attribute may only appear in the specification part of a module ++ !warning: Attribute 'PRIVATE' cannot be used more than once ++ type,PRIVATE,PRIVATE:: person ++ character(len=20) :: name ++ integer :: age ++ end type person ++end +diff --git a/test/Semantics/fortran_test005.f90 b/test/Semantics/fortran_test005.f90 +new file mode 100644 +index 0000000..24aff43 +--- /dev/null ++++ b/test/Semantics/fortran_test005.f90 +@@ -0,0 +1,11 @@ ++! Test C730: The same type-attr-spec shall not appear more ++! than once in a given derived-type-stmt. ++ ++program main ++implicit none ++ !warning: Attribute 'BIND(C)' cannot be used more than once ++ type,BIND(C),BIND(C):: person ++ character(len=20) :: name ++ integer :: age ++ end type person ++end +diff --git a/test/Semantics/fortran_test006.f90 b/test/Semantics/fortran_test006.f90 +new file mode 100644 +index 0000000..a90a200 +--- /dev/null ++++ b/test/Semantics/fortran_test006.f90 +@@ -0,0 +1,14 @@ ++! Test C730: The same type-attr-spec shall not appear more ++! than once in a given derived-type-stmt. ++ ++program main ++implicit none ++ type:: person ++ character :: name ++ integer :: age ++ end type person ++ !error: Attribute 'EXTENDS' cannot be used more than once ++ type,extends(person),extends(person) :: woman ++ integer :: salary ++ end type woman ++end +diff --git a/test/Semantics/fortran_test007.f90 b/test/Semantics/fortran_test007.f90 +new file mode 100644 +index 0000000..4dc9e87 +--- /dev/null ++++ b/test/Semantics/fortran_test007.f90 +@@ -0,0 +1,10 @@ ++! Test C731: The same type-param-name shall not appear ++! more than once in a given derived-type-stmt ++ ++program main ++ !error: Duplicate type parameter name: 'dim' ++ TYPE general_point(dim,dim) ++ INTEGER, KIND :: dim ++ REAL :: coordinates(dim) ++ END TYPE ++end +diff --git a/test/Semantics/fortran_test008.f90 b/test/Semantics/fortran_test008.f90 +new file mode 100644 +index 0000000..0dc58a4 +--- /dev/null ++++ b/test/Semantics/fortran_test008.f90 +@@ -0,0 +1,10 @@ ++! Test C732: A parent-type-name shall be the name of a previously defined extensible type ++ ++program main ++implicit none ++ !error: Derived type 'man' not found ++ type,extends(man):: person ++ character ::name ++ integer :: age ++ end type person ++end +diff --git a/test/Semantics/fortran_test009.f90 b/test/Semantics/fortran_test009.f90 +new file mode 100644 +index 0000000..bae0388 +--- /dev/null ++++ b/test/Semantics/fortran_test009.f90 +@@ -0,0 +1,19 @@ ++! Test C733: If the type definition contains or inherits a deferred ++! type-bound procedure, ABSTRACT shall appear ++ ++program main ++implicit none ++ TYPE :: abstract_t ++ CONTAINS ++ !error: Procedure bound to non-ABSTRACT derived type 'abstract_t' may not be DEFERRED ++ PROCEDURE(abstract_foo), PASS, DEFERRED :: Foo ++ END TYPE ++ ABSTRACT INTERFACE ++ SUBROUTINE abstract_foo(this,a,b) ++ import :: abstract_t ++ class(abstract_t),intent(in)::this ++ real,intent(in)::a ++ real,intent(out)::b ++ END SUBROUTINE abstract_foo ++ END INTERFACE ++end +diff --git a/test/Semantics/fortran_test010.f90 b/test/Semantics/fortran_test010.f90 +new file mode 100644 +index 0000000..b3ac943 +--- /dev/null ++++ b/test/Semantics/fortran_test010.f90 +@@ -0,0 +1,18 @@ ++! Test C733: If the type definition contains or inherits a deferred ++! type-bound procedure, ABSTRACT shall appear ++program main ++implicit none ++ !error: loc not yet implemented: support for polymorphic types ++ TYPE,ABSTRACT :: abstract_t ++ CONTAINS ++ PROCEDURE(abstract_foo), PASS, DEFERRED :: Foo ++ END TYPE ++ ABSTRACT INTERFACE ++ SUBROUTINE abstract_foo(this,a,b) ++ import :: abstract_t ++ class(abstract_t),intent(in)::this ++ real,intent(in)::a ++ real,intent(out)::b ++ END SUBROUTINE abstract_foo ++ END INTERFACE ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test011.f90 b/test/Semantics/fortran_test011.f90 +new file mode 100644 +index 0000000..5c61135 +--- /dev/null ++++ b/test/Semantics/fortran_test011.f90 +@@ -0,0 +1,23 @@ ++! Test C733: If the type definition contains or inherits a deferred ++! type-bound procedure, ABSTRACT shall appear ++program main ++implicit none ++ TYPE,ABSTRACT :: abstract_t ++ CONTAINS ++ PROCEDURE(abstract_foo), PASS, DEFERRED :: Foo ++ END TYPE ++ ! error: Non-ABSTRACT extension of ABSTRACT derived type ++ ! 'abstract_t' lacks a binding for DEFERRED procedure 'foo' ++ TYPE,EXTENDS(abstract_t) :: abstract_s ++ REAL :: x ++ END TYPE ++ ABSTRACT INTERFACE ++ SUBROUTINE abstract_foo(this,a,b) ++ import :: abstract_t ++ class(abstract_t),intent(in)::this ++ real,intent(in)::a ++ real,intent(out)::b ++ ! Procedure 'foo' of type 'abstract_t' is bound to 'abstract_foo' ++ END SUBROUTINE abstract_foo ++ END INTERFACE ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test012.f90 b/test/Semantics/fortran_test012.f90 +new file mode 100644 +index 0000000..40b50a7 +--- /dev/null ++++ b/test/Semantics/fortran_test012.f90 +@@ -0,0 +1,20 @@ ++! Test C734: If ABSTRACT appears, the type shall be extensible ++ ++program main ++implicit none ++ TYPE,ABSTRACT,BIND(C) :: abstract_t ++ CONTAINS ++ ! error: Passed-object dummy argument 'this' of procedure 'foo' may ++ ! not be polymorphic because 'abstract_t' is not extensible ++ PROCEDURE(abstract_foo), PASS, DEFERRED :: Foo ++ END TYPE ++ ABSTRACT INTERFACE ++ SUBROUTINE abstract_foo(this,a,b) ++ import :: abstract_t ++ ! error: Non-extensible derived type 'abstract_t' may not be used with CLASS keyword ++ class(abstract_t),intent(in)::this ++ real,intent(in)::a ++ real,intent(out)::b ++ END SUBROUTINE abstract_foo ++ END INTERFACE ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test013.f90 b/test/Semantics/fortran_test013.f90 +new file mode 100644 +index 0000000..0c3e35b +--- /dev/null ++++ b/test/Semantics/fortran_test013.f90 +@@ -0,0 +1,11 @@ ++! Test C734: If ABSTRACT appears, the type shall be extensible ++ ++program main ++implicit none ++ ! error: An ABSTRACT derived type must be extensible ++ TYPE,ABSTRACT:: abstract_t ++ SEQUENCE ++ INTEGER :: INT_V ++ REAL :: REAL_V ++ END TYPE ++end +diff --git a/test/Semantics/fortran_test014.f90 b/test/Semantics/fortran_test014.f90 +new file mode 100644 +index 0000000..69d2197 +--- /dev/null ++++ b/test/Semantics/fortran_test014.f90 +@@ -0,0 +1,14 @@ ++! Test C735: If EXTENDS appears, SEQUENCE shall not appear. ++ ++program main ++implicit none ++ TYPE:: abstract_t ++ INTEGER :: INT_V ++ REAL :: REAL_V ++ END TYPE ++ ! error: A sequence type may not have the EXTENDS attribute ++ TYPE,EXTENDS(abstract_t)::test ++ SEQUENCE ++ REAL :: va ++ END TYPE ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test015.f90 b/test/Semantics/fortran_test015.f90 +new file mode 100644 +index 0000000..6123aef +--- /dev/null ++++ b/test/Semantics/fortran_test015.f90 +@@ -0,0 +1,14 @@ ++! Test C735: If EXTENDS appears, SEQUENCE shall not appear. ++ ++program main ++implicit none ++ TYPE:: abstract_t ++ SEQUENCE ++ INTEGER :: INT_V ++ REAL :: REAL_V ++ END TYPE ++ ! error: The parent type is not extensible ++ TYPE,EXTENDS(abstract_t)::test ++ REAL :: va ++ END TYPE ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test016.f90 b/test/Semantics/fortran_test016.f90 +new file mode 100644 +index 0000000..8c4beed +--- /dev/null ++++ b/test/Semantics/fortran_test016.f90 +@@ -0,0 +1,17 @@ ++! Test C738: The same private-or-sequence shall not ++! appear more than once in a given derived-type-def. ++ ++MODULE types ++implicit none ++ TYPE :: abstract_t ++ ! warning: PRIVATE may not appear more than once in derived type components ++ PRIVATE ++ PRIVATE ++ INTEGER :: INT_V ++ REAL :: REAL_V ++ END TYPE ++END MODULE types ++program main ++use types ++implicit none ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test017.f90 b/test/Semantics/fortran_test017.f90 +new file mode 100644 +index 0000000..68de55f +--- /dev/null ++++ b/test/Semantics/fortran_test017.f90 +@@ -0,0 +1,17 @@ ++! Test C738: The same private-or-sequence shall not ++! appear more than once in a given derived-type-def. ++ ++MODULE types ++implicit none ++ TYPE :: abstract_t ++ ! warning: SEQUENCE may not appear more than once in derived type components. ++ SEQUENCE ++ SEQUENCE ++ INTEGER :: INT_V ++ REAL :: REAL_V ++ END TYPE ++END MODULE types ++program main ++use types ++implicit none ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test018.f90 b/test/Semantics/fortran_test018.f90 +new file mode 100644 +index 0000000..c65837e +--- /dev/null ++++ b/test/Semantics/fortran_test018.f90 +@@ -0,0 +1,12 @@ ++! Test C739: If END TYPE is followed by a type-name, the type-name shall be ++! the same as that in the corresponding derived-type-stmt. ++ ++program main ++implicit none ++ ! error: derived type definition name mismatch ++ TYPE:: abstract_t ++ SEQUENCE ++ INTEGER :: INT_V ++ REAL :: REAL_V ++ END TYPE a ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test019.f90 b/test/Semantics/fortran_test019.f90 +new file mode 100644 +index 0000000..04f5ad3 +--- /dev/null ++++ b/test/Semantics/fortran_test019.f90 +@@ -0,0 +1,11 @@ ++! Test C740: If SEQUENCE appears, the type shall have at least one component, each data component ++! shall be declared to be of an intrinsic type or of a sequence type, the derived type shall not have ++! any type parameter, and a type-bound-procedure-part shall not appear. ++ ++program main ++implicit none ++ ! error: A sequence type must have at least one component ++ TYPE :: abstract_t ++ SEQUENCE ++ END TYPE ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test020.f90 b/test/Semantics/fortran_test020.f90 +new file mode 100644 +index 0000000..be6bed2 +--- /dev/null ++++ b/test/Semantics/fortran_test020.f90 +@@ -0,0 +1,26 @@ ++! Test C740: If SEQUENCE appears, the type shall have at least one component, each data component ++! shall be declared to be of an intrinsic type or of a sequence type, the derived type shall not have ++! any type parameter, and a type-bound-procedure-part shall not appear. ++ ++program main ++implicit none ++ TYPE,ABSTRACT :: abstract_t ++ SEQUENCE ++ REAL :: ABC ++ ! error: A sequence type may not have a CONTAINS statement ++ CONTAINS ++ ! error: Passed-object dummy argument 'this' of procedure 'foo' may not be ++ ! polymorphic because 'abstract_t' is not extensible ++ PROCEDURE(abstract_foo), PASS, DEFERRED :: Foo ++ END TYPE ++ ABSTRACT INTERFACE ++ SUBROUTINE abstract_foo(this,a,b) ++ import :: abstract_t ++ ! error: Non-extensible derived type 'abstract_t' ++ ! may not be used with CLASS keyword ++ class(abstract_t),intent(in)::this ++ real,intent(in)::a ++ real,intent(out)::b ++ END SUBROUTINE abstract_foo ++ END INTERFACE ++end +diff --git a/test/Semantics/fortran_test021.f90 b/test/Semantics/fortran_test021.f90 +new file mode 100644 +index 0000000..22ed1a7 +--- /dev/null ++++ b/test/Semantics/fortran_test021.f90 +@@ -0,0 +1,11 @@ ++! Test C741: A type-param-name in a type-param-def-stmt in a derived-type-def shall be one ++! of the type-param-names in the derived-type-stmt of that derived-type-def. ++ ++program main ++implicit none ++ ! error: No definition found for type parameter 'a' ++ TYPE matrix(k,d,a) ++ INTEGER,KIND:: k ++ INTEGER,LEN:: d ++ END TYPE ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test022.f90 b/test/Semantics/fortran_test022.f90 +new file mode 100644 +index 0000000..9ec6824 +--- /dev/null ++++ b/test/Semantics/fortran_test022.f90 +@@ -0,0 +1,10 @@ ++! Test C742: Each type-param-name in the derived-type-stmt in a derived-type-def shall ++! appear exactly once as a type-param-name in a type-param-def-stmt in that derived-type-def. ++ ++program main ++implicit none ++ ! error: No definition found for type parameter 'd' ++ TYPE matrix(k,d) ++ INTEGER,KIND:: k ++ END TYPE ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test023.f90 b/test/Semantics/fortran_test023.f90 +new file mode 100644 +index 0000000..5dfe98d +--- /dev/null ++++ b/test/Semantics/fortran_test023.f90 +@@ -0,0 +1,12 @@ ++! Test C742: Each type-param-name in the derived-type-stmt in a derived-type-def shall ++! appear exactly once as a type-param-name in a type-param-def-stmt in that derived-type-def. ++ ++program main ++implicit none ++ ! error: Type parameter, component, or procedure binding 'k' already defined in this type ++ TYPE matrix(k,d) ++ INTEGER,KIND:: k ++ INTEGER,LEN:: d ++ INTEGER,LEN:: k ++ END TYPE ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test024.f90 b/test/Semantics/fortran_test024.f90 +new file mode 100644 +index 0000000..8384911 +--- /dev/null ++++ b/test/Semantics/fortran_test024.f90 +@@ -0,0 +1,16 @@ ++! Test C743: No component-attr-spec shall appear more ++! than once in a given component-def-stmt. ++ ++MODULE types ++implicit none ++ TYPE :: abstract_t ++ ! warning: Attribute 'PUBLIC' cannot be used more than once ++ PRIVATE ++ INTEGER,PUBLIC,PUBLIC:: INT_V ++ REAL :: REAL_V ++ END TYPE ++END MODULE types ++program main ++use types ++implicit none ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test025.f90 b/test/Semantics/fortran_test025.f90 +new file mode 100644 +index 0000000..cf91d84 +--- /dev/null ++++ b/test/Semantics/fortran_test025.f90 +@@ -0,0 +1,15 @@ ++! Test C743: No component-attr-spec shall appear more ++! than once in a given component-def-stmt. ++ ++MODULE types ++implicit none ++ TYPE :: abstract_t ++ ! warning: Attribute 'PRIVATE' cannot be used more than once ++ INTEGER,PRIVATE,PRIVATE :: INT_V ++ REAL :: REAL_V ++ END TYPE ++END MODULE types ++program main ++use types ++implicit none ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test026.f90 b/test/Semantics/fortran_test026.f90 +new file mode 100644 +index 0000000..92c5fbf +--- /dev/null ++++ b/test/Semantics/fortran_test026.f90 +@@ -0,0 +1,15 @@ ++! Test C743: No component-attr-spec shall appear more ++! than once in a given component-def-stmt. ++ ++MODULE types ++implicit none ++ TYPE :: abstract_t ++ ! warning: Attribute 'ALLOCATABLE' cannot be used more than once ++ INTEGER,ALLOCATABLE,ALLOCATABLE :: INT_V ++ REAL :: REAL_V ++ END TYPE ++END MODULE types ++program main ++use types ++implicit none ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test027.f90 b/test/Semantics/fortran_test027.f90 +new file mode 100644 +index 0000000..d7816bc +--- /dev/null ++++ b/test/Semantics/fortran_test027.f90 +@@ -0,0 +1,14 @@ ++! Test C743: No component-attr-spec shall appear more ++! than once in a given component-def-stmt. ++ ++MODULE types ++implicit none ++ TYPE :: abstract_t ++ ! error: Attribute 'CODIMENSION' cannot be used more than once ++ REAL,ALLOCATABLE,CODIMENSION [:,:,:],CODIMENSION [:,:,:] :: GRID(:,:,:) ++ END TYPE ++END MODULE types ++program main ++use types ++implicit none ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test028.f90 b/test/Semantics/fortran_test028.f90 +new file mode 100644 +index 0000000..be54b8e +--- /dev/null ++++ b/test/Semantics/fortran_test028.f90 +@@ -0,0 +1,14 @@ ++! Test C743: No component-attr-spec shall appear more ++! than once in a given component-def-stmt. ++ ++MODULE types ++implicit none ++ TYPE :: abstract_t ++ ! warning: Attribute 'CONTIGUOUS' cannot be used more than once ++ REAL,POINTER,CONTIGUOUS,CONTIGUOUS :: GRID(:) ++ END TYPE ++END MODULE types ++program main ++use types ++implicit none ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test029.f90 b/test/Semantics/fortran_test029.f90 +new file mode 100644 +index 0000000..e91c767 +--- /dev/null ++++ b/test/Semantics/fortran_test029.f90 +@@ -0,0 +1,14 @@ ++! Test C743: No component-attr-spec shall appear more ++! than once in a given component-def-stmt. ++ ++MODULE types ++implicit none ++ TYPE :: abstract_t ++ ! warning: Attribute 'POINTER' cannot be used more than once ++ REAL,POINTER,CONTIGUOUS,POINTER :: GRID(:) ++ END TYPE ++END MODULE types ++program main ++use types ++implicit none ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test030.f90 b/test/Semantics/fortran_test030.f90 +new file mode 100644 +index 0000000..07049cc +--- /dev/null ++++ b/test/Semantics/fortran_test030.f90 +@@ -0,0 +1,14 @@ ++! Test C743: No component-attr-spec shall appear more ++! than once in a given component-def-stmt. ++ ++MODULE types ++implicit none ++ TYPE :: abstract_t ++ ! error: Attribute 'DIMENSION' cannot be used more than once ++ REAL,DIMENSION(2,2),DIMENSION(2,2) :: GRID ++ END TYPE ++END MODULE types ++program main ++use types ++implicit none ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test031.f90 b/test/Semantics/fortran_test031.f90 +new file mode 100644 +index 0000000..e2c16ef +--- /dev/null ++++ b/test/Semantics/fortran_test031.f90 +@@ -0,0 +1,16 @@ ++! Test C744: If neither the POINTER nor the ALLOCATABLE attribute is ++! specified, the declaration-type-spec in the component-def-stmt shall ++! specify an intrinsic type or a previously defined derived type. ++ ++MODULE types ++implicit none ++ TYPE :: abstract_t ++ ! error: CLASS entity 'grid' must be a dummy argument or ++ ! have ALLOCATABLE or POINTER attribute ++ CLASS(*) :: GRID ++ END TYPE ++END MODULE types ++program main ++use types ++implicit none ++end +\ No newline at end of file +diff --git a/test/Semantics/fortran_test032.f90 b/test/Semantics/fortran_test032.f90 +new file mode 100644 +index 0000000..e4376e2 +--- /dev/null ++++ b/test/Semantics/fortran_test032.f90 +@@ -0,0 +1,19 @@ ++! Test C744: If neither the POINTER nor the ALLOCATABLE attribute is ++! specified, the declaration-type-spec in the component-def-stmt shall ++! specify an intrinsic type or a previously defined derived type. ++ ++MODULE types ++implicit none ++ TYPE :: AB ++ REAL:: C ++ END TYPE ++ TYPE :: abstract_t ++ ! error: CLASS entity 'grid' must be a dummy argument or ++ ! have ALLOCATABLE or POINTER attribute ++ CLASS(AB) :: GRID ++ END TYPE ++END MODULE types ++program main ++use types ++implicit none ++end +\ No newline at end of file +-- \ No newline at end of file