diff --git a/14-add-test-cases-for-attribute-declarations-and-specifications-2.patch b/14-add-test-cases-for-attribute-declarations-and-specifications-2.patch
index 4c112be365d67b1f111b0e021fef635380596b78..4985db6f9fe9a3255dd1a67a9e4c32a84d840078 100644
--- a/14-add-test-cases-for-attribute-declarations-and-specifications-2.patch
+++ b/14-add-test-cases-for-attribute-declarations-and-specifications-2.patch
@@ -5,471 +5,6 @@ Date: Tue Nov 29 16:23:41 2022 +0800
[flang] Add test cases for attribute declarations and specifications 2
Add test cases for attribute declarations and specifications 2
-diff --git a/test/Semantics/0801_C801_allocatable.f90 b/test/Semantics/0801_C801_allocatable.f90
-index 60d8773..1ba4de9 100644
---- a/test/Semantics/0801_C801_allocatable.f90
-+++ b/test/Semantics/0801_C801_allocatable.f90
-@@ -1,3 +1,4 @@
-+! RUN: %python %S/test_errors.py %s %flang_fc1
- ! Test C801: The same attr-spec shall not appear more than once in a given
- ! type-declaration-stmt.
-
-diff --git a/test/Semantics/0802_C801_contiguous.f90 b/test/Semantics/0802_C801_contiguous.f90
-index e570a19..935d513 100644
---- a/test/Semantics/0802_C801_contiguous.f90
-+++ b/test/Semantics/0802_C801_contiguous.f90
-@@ -1,3 +1,4 @@
-+! RUN: %python %S/test_errors.py %s %flang_fc1
- ! Test C801: The same attr-spec shall not appear more than once in a given
- ! type-declaration-stmt.
-
-diff --git a/test/Semantics/0803_C801_dimension.f90 b/test/Semantics/0803_C801_dimension.f90
-index 10aee7d..dff6365 100644
---- a/test/Semantics/0803_C801_dimension.f90
-+++ b/test/Semantics/0803_C801_dimension.f90
-@@ -1,3 +1,4 @@
-+! RUN: %python %S/test_errors.py %s %flang_fc1
- ! Test C801: The same attr-spec shall not appear more than once in a given
- ! type-declaration-stmt.
-
-diff --git a/test/Semantics/0804_C801_external.f90 b/test/Semantics/0804_C801_external.f90
-index 95e56da..50d8b83 100644
---- a/test/Semantics/0804_C801_external.f90
-+++ b/test/Semantics/0804_C801_external.f90
-@@ -1,3 +1,4 @@
-+! RUN: %python %S/test_errors.py %s %flang_fc1
- ! Test C801: The same attr-spec shall not appear more than once in a given
- ! type-declaration-stmt.
-
-diff --git a/test/Semantics/0805_C801_intent.f90 b/test/Semantics/0805_C801_intent.f90
-index 651c88f..b8ebb8c 100644
---- a/test/Semantics/0805_C801_intent.f90
-+++ b/test/Semantics/0805_C801_intent.f90
-@@ -1,3 +1,4 @@
-+! RUN: %python %S/test_errors.py %s %flang_fc1
- ! Test C801: The same attr-spec shall not appear more than once in a given
- ! type-declaration-stmt.
-
-diff --git a/test/Semantics/0806_C801_intrinsic.f90 b/test/Semantics/0806_C801_intrinsic.f90
-index 99c1cd6..da84f4a 100644
---- a/test/Semantics/0806_C801_intrinsic.f90
-+++ b/test/Semantics/0806_C801_intrinsic.f90
-@@ -1,3 +1,4 @@
-+! RUN: %python %S/test_errors.py %s %flang_fc1
- ! Test C801: The same attr-spec shall not appear more than once in a given
- ! type-declaration-stmt.
-
-diff --git a/test/Semantics/0807_C801_optional.f90 b/test/Semantics/0807_C801_optional.f90
-index 502e687..8f80c36 100644
---- a/test/Semantics/0807_C801_optional.f90
-+++ b/test/Semantics/0807_C801_optional.f90
-@@ -1,3 +1,4 @@
-+! RUN: %python %S/test_errors.py %s %flang_fc1
- ! Test C801: The same attr-spec shall not appear more than once in a given
- ! type-declaration-stmt.
-
-diff --git a/test/Semantics/0808_C801_parameter.f90 b/test/Semantics/0808_C801_parameter.f90
-index 92d3cc5..90493af 100644
---- a/test/Semantics/0808_C801_parameter.f90
-+++ b/test/Semantics/0808_C801_parameter.f90
-@@ -1,3 +1,4 @@
-+! RUN: %python %S/test_errors.py %s %flang_fc1
- ! Test C801: The same attr-spec shall not appear more than once in a given
- ! type-declaration-stmt.
-
-diff --git a/test/Semantics/0809_C801_pointer.f90 b/test/Semantics/0809_C801_pointer.f90
-index a366c50..d9223fa 100644
---- a/test/Semantics/0809_C801_pointer.f90
-+++ b/test/Semantics/0809_C801_pointer.f90
-@@ -1,3 +1,4 @@
-+! RUN: %python %S/test_errors.py %s %flang_fc1
- ! Test C801: The same attr-spec shall not appear more than once in a given
- ! type-declaration-stmt.
-
-diff --git a/test/Semantics/0810_C801_protected.f90 b/test/Semantics/0810_C801_protected.f90
-index 9b49243..f4a607f 100644
---- a/test/Semantics/0810_C801_protected.f90
-+++ b/test/Semantics/0810_C801_protected.f90
-@@ -1,3 +1,4 @@
-+! RUN: %python %S/test_errors.py %s %flang_fc1
- ! Test C801: The same attr-spec shall not appear more than once in a given
- ! type-declaration-stmt.
-
-diff --git a/test/Semantics/0811_C801_save.f90 b/test/Semantics/0811_C801_save.f90
-index cd99ebf..9d28281 100644
---- a/test/Semantics/0811_C801_save.f90
-+++ b/test/Semantics/0811_C801_save.f90
-@@ -1,3 +1,4 @@
-+! RUN: %python %S/test_errors.py %s %flang_fc1
- ! Test C801: The same attr-spec shall not appear more than once in a given
- ! type-declaration-stmt.
-
-diff --git a/test/Semantics/0812_C801_target.f90 b/test/Semantics/0812_C801_target.f90
-index 7199798..2be98d6 100644
---- a/test/Semantics/0812_C801_target.f90
-+++ b/test/Semantics/0812_C801_target.f90
-@@ -1,3 +1,4 @@
-+! RUN: %python %S/test_errors.py %s %flang_fc1
- ! Test C801: The same attr-spec shall not appear more than once in a given
- ! type-declaration-stmt.
-
-diff --git a/test/Semantics/0813_C801_value.f90 b/test/Semantics/0813_C801_value.f90
-index 0148f37..8f92f23 100644
---- a/test/Semantics/0813_C801_value.f90
-+++ b/test/Semantics/0813_C801_value.f90
-@@ -1,3 +1,4 @@
-+! RUN: %python %S/test_errors.py %s %flang_fc1
- ! Test C801: The same attr-spec shall not appear more than once in a given
- ! type-declaration-stmt.
-
-diff --git a/test/Semantics/0814_C801_volatile.f90 b/test/Semantics/0814_C801_volatile.f90
-index 7f82dff..9de25a4 100644
---- a/test/Semantics/0814_C801_volatile.f90
-+++ b/test/Semantics/0814_C801_volatile.f90
-@@ -1,3 +1,4 @@
-+! RUN: %python %S/test_errors.py %s %flang_fc1
- ! Test C801: The same attr-spec shall not appear more than once in a given
- ! type-declaration-stmt.
-
-diff --git a/test/Semantics/0815_C802.f90 b/test/Semantics/0815_C802.f90
-index 20a2ad4..97508e8 100644
---- a/test/Semantics/0815_C802.f90
-+++ b/test/Semantics/0815_C802.f90
-@@ -1,4 +1,5 @@
--! If a language-binding-spec with a NAME= specifier appears, the
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C802: If a language-binding-spec with a NAME= specifier appears, the
- ! entity-decl-list shall consist of a single entity-decl.
-
- module m
-diff --git a/test/Semantics/0816_C803.f90 b/test/Semantics/0816_C803.f90
-index 0e05772..f92f57d 100644
---- a/test/Semantics/0816_C803.f90
-+++ b/test/Semantics/0816_C803.f90
-@@ -1,5 +1,6 @@
--! If a language-binding-spec is specified, the entity-decl-list shall
--! not contain any procedure names.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C803: If a language-binding-spec is specified, the entity-decl-list
-+! shall not contain any procedure names.
-
- module m
- integer, bind(c) :: test
-diff --git a/test/Semantics/0817_C804.f90 b/test/Semantics/0817_C804.f90
-index bb93c9e..0741c03 100644
---- a/test/Semantics/0817_C804.f90
-+++ b/test/Semantics/0817_C804.f90
-@@ -1,9 +1,10 @@
--! If the entity is not of type character, * char-length shall not appear.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C804: If the entity is not of type character, * char-length shall not
-+! appear.
-
- program m
- character :: c * 15
-- ! ERROR: A length specifier cannot be used to declare the non-character
-- ! entity 'd'
-+ ! ERROR: A length specifier cannot be used to declare the non-character entity 'd'
- integer :: d * 15
- c = "abc"
- end
-diff --git a/test/Semantics/0818_C805.f90 b/test/Semantics/0818_C805.f90
-index 1e249cf..c106689 100644
---- a/test/Semantics/0818_C805.f90
-+++ b/test/Semantics/0818_C805.f90
-@@ -1,5 +1,6 @@
--! A type-param-value in a char-length in an entity-decl shall be a colon,
--! asterisk, or specification expression.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C805: A type-param-value in a char-length in an entity-decl shall be a
-+! colon, asterisk, or specification expression.
-
- program main
- character :: a
-diff --git a/test/Semantics/0819_C806.f90 b/test/Semantics/0819_C806.f90
-index d11d488..81d537d 100644
---- a/test/Semantics/0819_C806.f90
-+++ b/test/Semantics/0819_C806.f90
-@@ -1,5 +1,6 @@
--! If initialization appears, a double-colon separator shall appear before the
--! entity-decl-list.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C806: If initialization appears, a double-colon separator shall appear
-+! before the entity-decl-list.
-
- subroutine test()
- ! ERROR: expected '::'
-diff --git a/test/Semantics/0820_C807.f90 b/test/Semantics/0820_C807.f90
-index 1b771a3..4dedf0a 100644
---- a/test/Semantics/0820_C807.f90
-+++ b/test/Semantics/0820_C807.f90
-@@ -1,5 +1,6 @@
--! If the PARAMETER keyword appears, initialization shall appear in each
--! entity-decl.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C807: If the PARAMETER keyword appears, initialization shall appear in
-+! each entity-decl.
-
- subroutine test()
- ! ERROR: Missing initialization for parameter 'y'
-diff --git a/test/Semantics/0821_C808.f90 b/test/Semantics/0821_C808.f90
-index e7ac3b8..2ed4362 100644
---- a/test/Semantics/0821_C808.f90
-+++ b/test/Semantics/0821_C808.f90
-@@ -1,7 +1,8 @@
--! An initialization shall not appear if object-name is a dummy argument, a
--! function result, an object in a named common block unless the type declaration
--! is in a block data program unit, an object in blank common, an allocatable
--! variable, or an automatic data object.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C808: An initialization shall not appear if object-name is a dummy
-+! argument, a function result, an object in a named common block unless the type
-+! declaration is in a block data program unit, an object in blank common, an
-+! allocatable variable, or an automatic data object.
-
- subroutine test(x)
- ! ERROR: A dummy argument must not be initialized
-diff --git a/test/Semantics/0822_C811.f90 b/test/Semantics/0822_C811.f90
-index d4fa055..6f530a8 100644
---- a/test/Semantics/0822_C811.f90
-+++ b/test/Semantics/0822_C811.f90
-@@ -1,11 +1,10 @@
--! If => appears in initialization, the entity shall have the POINTER attribute.
--! If = appears in initialization, the entity shall not have the POINTER
--! attribute.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C811: If => appears in initialization, the entity shall have the POINTER
-+! attribute. If = appears in initialization, the entity shall not have the
-+! POINTER attribute.
-
- subroutine test()
- integer, target :: t = 12
- ! ERROR: 'p' is a pointer but is not initialized like one
- integer, pointer :: p = t
-- ! ERROR: expected '('
-- ! integer :: x => 10
- end subroutine
-diff --git a/test/Semantics/0823_C812.f90 b/test/Semantics/0823_C812.f90
-index d3cc0f8..fb6e17e 100644
---- a/test/Semantics/0823_C812.f90
-+++ b/test/Semantics/0823_C812.f90
-@@ -1,4 +1,5 @@
--! If initial-data-target appears, object-name shall be
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C812: If initial-data-target appears, object-name shall be
- ! data-pointer-initialization compatible with it (7.5.4.6)
-
- subroutine test()
-diff --git a/test/Semantics/0824_C814.f90 b/test/Semantics/0824_C814.f90
-index 5758434..ff0a810 100644
---- a/test/Semantics/0824_C814.f90
-+++ b/test/Semantics/0824_C814.f90
-@@ -1,9 +1,10 @@
--! An automatic data object shall not have the SAVE attribute.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C814: An automatic data object shall not have the SAVE attribute.
-
- subroutine test(x, n, m)
- ! ERROR: SAVE attribute may not be applied to dummy argument 'x'
- integer, save :: x
- integer, intent(in) :: n, m
-- ! ERROR: SAVE attribute may not be applied to automatic data object 'temp'
-+ ! ERROR: SAVE attribute may not be applied to automatic data object 'temp'
- real, dimension(n,m), save :: temp
- end subroutine
-diff --git a/test/Semantics/0825_C817.f90 b/test/Semantics/0825_C817.f90
-index 9ca6776..ac6233c 100644
---- a/test/Semantics/0825_C817.f90
-+++ b/test/Semantics/0825_C817.f90
-@@ -1,4 +1,6 @@
--! An access-spec shall appear only in the specification-part of a module.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C817: An access-spec shall appear only in the specification-part of a
-+! module.
-
- module m
- private
-diff --git a/test/Semantics/0826_C818.f90 b/test/Semantics/0826_C818.f90
-index db76647..fca8f08 100644
---- a/test/Semantics/0826_C818.f90
-+++ b/test/Semantics/0826_C818.f90
-@@ -1,5 +1,6 @@
--! An entity with the BIND attribute shall be a common block, variable,
--! type, or! procedure.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C818: An entity with the BIND attribute shall be a common block,
-+! variable, type, or! procedure.
-
- subroutine test_sub() bind(c, name="test_sub")
- end subroutine
-diff --git a/test/Semantics/0827_C819.f90 b/test/Semantics/0827_C819.f90
-index 64a283a..ffcd47c 100644
---- a/test/Semantics/0827_C819.f90
-+++ b/test/Semantics/0827_C819.f90
-@@ -1,9 +1,9 @@
--! A variable with the BIND attribute shall be declared in the specification
--! part of a module.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C819: A variable with the BIND attribute shall be declared in the
-+! specification part of a module.
-
- subroutine test()
-- ! ERROR: A variable with BIND(C) attribute may only appear in the
-- ! specification part of a module
-+ ! ERROR: A variable with BIND(C) attribute may only appear in the specification part of a module
- integer :: x
- bind(c, name="x") :: x
- end subroutine
-diff --git a/test/Semantics/0828_C822.f90 b/test/Semantics/0828_C822.f90
-index 3b05f68..98ad273 100644
---- a/test/Semantics/0828_C822.f90
-+++ b/test/Semantics/0828_C822.f90
-@@ -1,4 +1,6 @@
--! The sum of the rank and corank of an entity shall not exceed fifteen.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C822: The sum of the rank and corank of an entity shall not exceed
-+! fifteen.
-
- subroutine test()
- ! ERROR: 'a' has rank 16, which is greater than the maximum supported rank 15
-diff --git a/test/Semantics/0829_C830.f90 b/test/Semantics/0829_C830.f90
-index 44e759f..7ec3643 100644
---- a/test/Semantics/0829_C830.f90
-+++ b/test/Semantics/0829_C830.f90
-@@ -1,5 +1,6 @@
--! An entity with the CONTIGUOUS attribute shall be an array pointer, an
--! assumed-shape array, or an assumed-rank dummy data object.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C830: An entity with the CONTIGUOUS attribute shall be an array pointer,
-+! an assumed-shape array, or an assumed-rank dummy data object.
-
- subroutine test(assumed_shape, assumed_rank)
- integer, contiguous, pointer :: a(:)
-diff --git a/test/Semantics/0830_C831.f90 b/test/Semantics/0830_C831.f90
-index cd8daa7..da127bf 100644
---- a/test/Semantics/0830_C831.f90
-+++ b/test/Semantics/0830_C831.f90
-@@ -1,5 +1,6 @@
--! An explicit-shape-spec whose bounds are not constant expressions shall
--! appear only in a subprogram, derived type definition, BLOCK construct,
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C831: An explicit-shape-spec whose bounds are not constant expressions
-+! shall appear only in a subprogram, derived type definition, BLOCK construct,
- ! or interface body.
-
- subroutine test(n)
-diff --git a/test/Semantics/0831_C832.f90 b/test/Semantics/0831_C832.f90
-index 7d2b37f..99e20c0 100644
---- a/test/Semantics/0831_C832.f90
-+++ b/test/Semantics/0831_C832.f90
-@@ -1,5 +1,5 @@
--! An array with the POINTER or ALLOCATABLE attribute shall have an array-spec
--! that is a deferred-shape-spec-list.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C832: An array with the POINTER or ALLOCATABLE attribute shall have an array-spec that is a deferred-shape-spec-list.
-
- subroutine test()
- integer :: i = 2
-@@ -8,6 +8,6 @@ subroutine test()
- real, pointer, dimension(0 : 2) :: b
-
- real, allocatable :: c(:)
-- ! ERROR: Allocatable array 'd' must have deferred shape or assumed rank
-+ ! ERROR: Allocatable array 'd' must have deferred shape or assumed rank
- real, allocatable :: d(0 : 2)
- end subroutine
-diff --git a/test/Semantics/0832_C833.f90 b/test/Semantics/0832_C833.f90
-index 61c8f6d..5f49388 100644
---- a/test/Semantics/0832_C833.f90
-+++ b/test/Semantics/0832_C833.f90
-@@ -1,5 +1,6 @@
--! An object whose array bounds are specified by an assumed-size-spec shall be a
--! dummy data object.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C833: An object whose array bounds are specified by an assumed-size-spec
-+! shall be a dummy data object.
-
- subroutine test(n)
- integer :: n
-diff --git a/test/Semantics/0833_C835.f90 b/test/Semantics/0833_C835.f90
-index 5ed31e9..26210bf 100644
---- a/test/Semantics/0833_C835.f90
-+++ b/test/Semantics/0833_C835.f90
-@@ -1,4 +1,5 @@
--! An object whose array bounds are specified by an
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C835: An object whose array bounds are specified by an
- ! implied-shape-or-assumed-size-spec shall be a dummy data object or a named
- ! constant.
-
-diff --git a/test/Semantics/0834_C836.f90 b/test/Semantics/0834_C836.f90
-index d2bd467..f0741d5 100644
---- a/test/Semantics/0834_C836.f90
-+++ b/test/Semantics/0834_C836.f90
-@@ -1,4 +1,5 @@
--! An implied-shape array shall be a named constant.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C836: An implied-shape array shall be a named constant.
-
- subroutine test()
- integer, parameter :: a(*) = [1,2,3]
-diff --git a/test/Semantics/0835_C837.f90 b/test/Semantics/0835_C837.f90
-index 732951d..dedf556 100644
---- a/test/Semantics/0835_C837.f90
-+++ b/test/Semantics/0835_C837.f90
-@@ -1,9 +1,10 @@
--! An assumed-rank entity shall be a dummy data object that does not have the
--! CODIMENSION or VALUE attribute.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C837: An assumed-rank entity shall be a dummy data object that does not
-+! have the CODIMENSION or VALUE attribute.
-
- subroutine test(a)
- integer, value :: a(..)
- ! ERROR: Assumed-rank array 'b' must be a dummy argument
-- ! ERROR: VALUE attribute may apply only to a dummy argument
-+ ! ERROR: VALUE attribute may apply only to a dummy argument
- integer, value :: b(..)
- end subroutine
-diff --git a/test/Semantics/0836_C840.f90 b/test/Semantics/0836_C840.f90
-index 63915fa..c7a2694 100644
---- a/test/Semantics/0836_C840.f90
-+++ b/test/Semantics/0836_C840.f90
-@@ -1,5 +1,6 @@
--! An entity shall not have both the EXTERNAL attribute and the INTRINSIC
--! attribute.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C840: An entity shall not have both the EXTERNAL attribute and the
-+! INTRINSIC attribute.
-
- program main
- ! Do not raised any error!
-diff --git a/test/Semantics/0837_C841.f90 b/test/Semantics/0837_C841.f90
-index fdf9978..b196541 100644
---- a/test/Semantics/0837_C841.f90
-+++ b/test/Semantics/0837_C841.f90
-@@ -1,5 +1,6 @@
--! In an external subprogram, the EXTERNAL attribute shall not be specified for
--! a procedure defined by the subprogram.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C841: In an external subprogram, the EXTERNAL attribute shall not be
-+! specified for a procedure defined by the subprogram.
-
- subroutine test()
- real :: func
-diff --git a/test/Semantics/0838_C842.f90 b/test/Semantics/0838_C842.f90
-index 0329408..4948636 100644
---- a/test/Semantics/0838_C842.f90
-+++ b/test/Semantics/0838_C842.f90
-@@ -1,5 +1,6 @@
--! In an interface body, the EXTERNAL attribute shall not be specified for the
--! procedure declared by the interface body.
-+! RUN: %python %S/test_errors.py %s %flang_fc1
-+! Test C842: In an interface body, the EXTERNAL attribute shall not be specified
-+! for the procedure declared by the interface body.
-
- module m
- interface
diff --git a/test/Semantics/0839_C843.f90 b/test/Semantics/0839_C843.f90
new file mode 100644
index 0000000..9747dfc
@@ -821,27 +356,27 @@ index 0000000..f353449
+ integer, target, pointer :: a
+end subroutine
diff --git a/test/Semantics/result-08.md b/test/Semantics/result-08.md
-index 8c81e9a..c48a844 100644
+index be41906..33c5faf 100644
--- a/test/Semantics/result-08.md
+++ b/test/Semantics/result-08.md
@@ -38,3 +38,20 @@
- | C840 | OK | ERROR | ERROR |
- | C841 | ERROR | ERROR | ERROR |
- | C842 | ERROR | ERROR | ERROR |
-+| C843 | ERROR / ICE | ERROR | ERROR |
-+| C844 | ERROR | ERROR | ERROR |
-+| C845 | OK | ERROR | ERROR |
-+| C846 | ERROR | ERROR | ERROR |
-+| C847 | ERROR | ERROR | ERROR (LOCK_TYPE) / OK (EVENT_TYPE) |
-+| C849 | ERROR | ERROR | ERROR |
-+| C850 | ERROR | ERROR | ERROR |
-+| C851 | ERROR | ERROR | ERROR |
-+| C852 | ERROR | ERROR | ERROR |
-+| C854 | ERROR | ERROR | ERROR |
-+| C855 | --- | --- | --- |
-+| C856 | OK | ERROR | ERROR |
-+| C857 | ERROR (OK in some cases) | ERROR | ERROR |
-+| C858 | OK | ERROR | OK |
-+| C860 | ERROR | ERROR | ERROR |
-+| C861 | ERROR | ERROR | ERROR |
-+| C862 | ERROR | ERROR | ERROR |
+ | C840 | OK | ERROR | ERROR |
+ | C841 | ERROR | ERROR | ERROR |
+ | C842 | ERROR | ERROR | ERROR |
++| C843 | ERROR / ICE | ERROR | ERROR |
++| C844 | ERROR | ERROR | ERROR |
++| C845 | OK | ERROR | ERROR |
++| C846 | ERROR | ERROR | ERROR |
++| C847 | ERROR | ERROR | ERROR (LOCK_TYPE) / OK (EVENT_TYPE) |
++| C849 | ERROR | ERROR | ERROR |
++| C850 | ERROR | ERROR | ERROR |
++| C851 | ERROR | ERROR | ERROR |
++| C852 | ERROR | ERROR | ERROR |
++| C854 | ERROR | ERROR | ERROR |
++| C855 | --- | --- | --- |
++| C856 | OK | ERROR | ERROR |
++| C857 | ERROR (OK in some cases) | ERROR | ERROR |
++| C858 | OK | ERROR | OK |
++| C860 | ERROR | ERROR | ERROR |
++| C861 | ERROR | ERROR | ERROR |
++| C862 | ERROR | ERROR | ERROR |
diff --git a/7-add-test-cases-for-attribute-declarations-and-specifications.patch b/7-add-test-cases-for-attribute-declarations-and-specifications.patch
index acaddb833930b5dea7c7d1932466bf3c8fc79d84..ee85d5245359fa66c894a0c7049fdbd22d452e98 100644
--- a/7-add-test-cases-for-attribute-declarations-and-specifications.patch
+++ b/7-add-test-cases-for-attribute-declarations-and-specifications.patch
@@ -8,10 +8,11 @@ Date: Thu Oct 27 21:50:17 2022 +0800
diff --git a/test/Semantics/0801_C801_allocatable.f90 b/test/Semantics/0801_C801_allocatable.f90
new file mode 100644
-index 0000000..60d8773
+index 0000000..1ba4de9
--- /dev/null
+++ b/test/Semantics/0801_C801_allocatable.f90
-@@ -0,0 +1,8 @@
+@@ -0,0 +1,9 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test C801: The same attr-spec shall not appear more than once in a given
+! type-declaration-stmt.
+
@@ -22,10 +23,11 @@ index 0000000..60d8773
+end program main
diff --git a/test/Semantics/0802_C801_contiguous.f90 b/test/Semantics/0802_C801_contiguous.f90
new file mode 100644
-index 0000000..e570a19
+index 0000000..935d513
--- /dev/null
+++ b/test/Semantics/0802_C801_contiguous.f90
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test C801: The same attr-spec shall not appear more than once in a given
+! type-declaration-stmt.
+
@@ -35,10 +37,11 @@ index 0000000..e570a19
+end program main
diff --git a/test/Semantics/0803_C801_dimension.f90 b/test/Semantics/0803_C801_dimension.f90
new file mode 100644
-index 0000000..10aee7d
+index 0000000..dff6365
--- /dev/null
+++ b/test/Semantics/0803_C801_dimension.f90
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test C801: The same attr-spec shall not appear more than once in a given
+! type-declaration-stmt.
+
@@ -48,10 +51,11 @@ index 0000000..10aee7d
+END SUBROUTINE
diff --git a/test/Semantics/0804_C801_external.f90 b/test/Semantics/0804_C801_external.f90
new file mode 100644
-index 0000000..95e56da
+index 0000000..50d8b83
--- /dev/null
+++ b/test/Semantics/0804_C801_external.f90
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test C801: The same attr-spec shall not appear more than once in a given
+! type-declaration-stmt.
+
@@ -61,10 +65,11 @@ index 0000000..95e56da
+end subroutine
diff --git a/test/Semantics/0805_C801_intent.f90 b/test/Semantics/0805_C801_intent.f90
new file mode 100644
-index 0000000..651c88f
+index 0000000..b8ebb8c
--- /dev/null
+++ b/test/Semantics/0805_C801_intent.f90
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test C801: The same attr-spec shall not appear more than once in a given
+! type-declaration-stmt.
+
@@ -74,10 +79,11 @@ index 0000000..651c88f
+end subroutine
diff --git a/test/Semantics/0806_C801_intrinsic.f90 b/test/Semantics/0806_C801_intrinsic.f90
new file mode 100644
-index 0000000..99c1cd6
+index 0000000..da84f4a
--- /dev/null
+++ b/test/Semantics/0806_C801_intrinsic.f90
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test C801: The same attr-spec shall not appear more than once in a given
+! type-declaration-stmt.
+
@@ -87,10 +93,11 @@ index 0000000..99c1cd6
+end subroutine
diff --git a/test/Semantics/0807_C801_optional.f90 b/test/Semantics/0807_C801_optional.f90
new file mode 100644
-index 0000000..502e687
+index 0000000..8f80c36
--- /dev/null
+++ b/test/Semantics/0807_C801_optional.f90
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test C801: The same attr-spec shall not appear more than once in a given
+! type-declaration-stmt.
+
@@ -100,10 +107,11 @@ index 0000000..502e687
+end subroutine
diff --git a/test/Semantics/0808_C801_parameter.f90 b/test/Semantics/0808_C801_parameter.f90
new file mode 100644
-index 0000000..92d3cc5
+index 0000000..90493af
--- /dev/null
+++ b/test/Semantics/0808_C801_parameter.f90
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test C801: The same attr-spec shall not appear more than once in a given
+! type-declaration-stmt.
+
@@ -113,10 +121,11 @@ index 0000000..92d3cc5
+end subroutine
diff --git a/test/Semantics/0809_C801_pointer.f90 b/test/Semantics/0809_C801_pointer.f90
new file mode 100644
-index 0000000..a366c50
+index 0000000..d9223fa
--- /dev/null
+++ b/test/Semantics/0809_C801_pointer.f90
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test C801: The same attr-spec shall not appear more than once in a given
+! type-declaration-stmt.
+
@@ -126,10 +135,11 @@ index 0000000..a366c50
+end subroutine
diff --git a/test/Semantics/0810_C801_protected.f90 b/test/Semantics/0810_C801_protected.f90
new file mode 100644
-index 0000000..9b49243
+index 0000000..f4a607f
--- /dev/null
+++ b/test/Semantics/0810_C801_protected.f90
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test C801: The same attr-spec shall not appear more than once in a given
+! type-declaration-stmt.
+
@@ -139,10 +149,11 @@ index 0000000..9b49243
+end subroutine
diff --git a/test/Semantics/0811_C801_save.f90 b/test/Semantics/0811_C801_save.f90
new file mode 100644
-index 0000000..cd99ebf
+index 0000000..9d28281
--- /dev/null
+++ b/test/Semantics/0811_C801_save.f90
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test C801: The same attr-spec shall not appear more than once in a given
+! type-declaration-stmt.
+
@@ -152,10 +163,11 @@ index 0000000..cd99ebf
+end subroutine
diff --git a/test/Semantics/0812_C801_target.f90 b/test/Semantics/0812_C801_target.f90
new file mode 100644
-index 0000000..7199798
+index 0000000..2be98d6
--- /dev/null
+++ b/test/Semantics/0812_C801_target.f90
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test C801: The same attr-spec shall not appear more than once in a given
+! type-declaration-stmt.
+
@@ -165,10 +177,11 @@ index 0000000..7199798
+end subroutine
diff --git a/test/Semantics/0813_C801_value.f90 b/test/Semantics/0813_C801_value.f90
new file mode 100644
-index 0000000..0148f37
+index 0000000..8f92f23
--- /dev/null
+++ b/test/Semantics/0813_C801_value.f90
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test C801: The same attr-spec shall not appear more than once in a given
+! type-declaration-stmt.
+
@@ -178,10 +191,11 @@ index 0000000..0148f37
+end subroutine
diff --git a/test/Semantics/0814_C801_volatile.f90 b/test/Semantics/0814_C801_volatile.f90
new file mode 100644
-index 0000000..7f82dff
+index 0000000..9de25a4
--- /dev/null
+++ b/test/Semantics/0814_C801_volatile.f90
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test C801: The same attr-spec shall not appear more than once in a given
+! type-declaration-stmt.
+
@@ -191,11 +205,12 @@ index 0000000..7f82dff
+end subroutine
diff --git a/test/Semantics/0815_C802.f90 b/test/Semantics/0815_C802.f90
new file mode 100644
-index 0000000..20a2ad4
+index 0000000..97508e8
--- /dev/null
+++ b/test/Semantics/0815_C802.f90
-@@ -0,0 +1,10 @@
-+! If a language-binding-spec with a NAME= specifier appears, the
+@@ -0,0 +1,11 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C802: If a language-binding-spec with a NAME= specifier appears, the
+! entity-decl-list shall consist of a single entity-decl.
+
+module m
@@ -207,12 +222,13 @@ index 0000000..20a2ad4
+end
diff --git a/test/Semantics/0816_C803.f90 b/test/Semantics/0816_C803.f90
new file mode 100644
-index 0000000..0e05772
+index 0000000..f92f57d
--- /dev/null
+++ b/test/Semantics/0816_C803.f90
-@@ -0,0 +1,14 @@
-+! If a language-binding-spec is specified, the entity-decl-list shall
-+! not contain any procedure names.
+@@ -0,0 +1,15 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C803: If a language-binding-spec is specified, the entity-decl-list
++! shall not contain any procedure names.
+
+module m
+ integer, bind(c) :: test
@@ -227,27 +243,29 @@ index 0000000..0e05772
+end
diff --git a/test/Semantics/0817_C804.f90 b/test/Semantics/0817_C804.f90
new file mode 100644
-index 0000000..bb93c9e
+index 0000000..0741c03
--- /dev/null
+++ b/test/Semantics/0817_C804.f90
-@@ -0,0 +1,9 @@
-+! If the entity is not of type character, * char-length shall not appear.
+@@ -0,0 +1,10 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C804: If the entity is not of type character, * char-length shall not
++! appear.
+
+program m
+ character :: c * 15
-+ ! ERROR: A length specifier cannot be used to declare the non-character
-+ ! entity 'd'
++ ! ERROR: A length specifier cannot be used to declare the non-character entity 'd'
+ integer :: d * 15
+ c = "abc"
+end
diff --git a/test/Semantics/0818_C805.f90 b/test/Semantics/0818_C805.f90
new file mode 100644
-index 0000000..1e249cf
+index 0000000..c106689
--- /dev/null
+++ b/test/Semantics/0818_C805.f90
-@@ -0,0 +1,14 @@
-+! A type-param-value in a char-length in an entity-decl shall be a colon,
-+! asterisk, or specification expression.
+@@ -0,0 +1,15 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C805: A type-param-value in a char-length in an entity-decl shall be a
++! colon, asterisk, or specification expression.
+
+program main
+ character :: a
@@ -262,12 +280,13 @@ index 0000000..1e249cf
+end program
diff --git a/test/Semantics/0819_C806.f90 b/test/Semantics/0819_C806.f90
new file mode 100644
-index 0000000..d11d488
+index 0000000..81d537d
--- /dev/null
+++ b/test/Semantics/0819_C806.f90
-@@ -0,0 +1,7 @@
-+! If initialization appears, a double-colon separator shall appear before the
-+! entity-decl-list.
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C806: If initialization appears, a double-colon separator shall appear
++! before the entity-decl-list.
+
+subroutine test()
+ ! ERROR: expected '::'
@@ -275,12 +294,13 @@ index 0000000..d11d488
+end subroutine
diff --git a/test/Semantics/0820_C807.f90 b/test/Semantics/0820_C807.f90
new file mode 100644
-index 0000000..1b771a3
+index 0000000..4dedf0a
--- /dev/null
+++ b/test/Semantics/0820_C807.f90
-@@ -0,0 +1,7 @@
-+! If the PARAMETER keyword appears, initialization shall appear in each
-+! entity-decl.
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C807: If the PARAMETER keyword appears, initialization shall appear in
++! each entity-decl.
+
+subroutine test()
+ ! ERROR: Missing initialization for parameter 'y'
@@ -288,14 +308,15 @@ index 0000000..1b771a3
+end subroutine
diff --git a/test/Semantics/0821_C808.f90 b/test/Semantics/0821_C808.f90
new file mode 100644
-index 0000000..e7ac3b8
+index 0000000..2ed4362
--- /dev/null
+++ b/test/Semantics/0821_C808.f90
-@@ -0,0 +1,9 @@
-+! An initialization shall not appear if object-name is a dummy argument, a
-+! function result, an object in a named common block unless the type declaration
-+! is in a block data program unit, an object in blank common, an allocatable
-+! variable, or an automatic data object.
+@@ -0,0 +1,10 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C808: An initialization shall not appear if object-name is a dummy
++! argument, a function result, an object in a named common block unless the type
++! declaration is in a block data program unit, an object in blank common, an
++! allocatable variable, or an automatic data object.
+
+subroutine test(x)
+ ! ERROR: A dummy argument must not be initialized
@@ -303,28 +324,28 @@ index 0000000..e7ac3b8
+end subroutine
diff --git a/test/Semantics/0822_C811.f90 b/test/Semantics/0822_C811.f90
new file mode 100644
-index 0000000..d4fa055
+index 0000000..6f530a8
--- /dev/null
+++ b/test/Semantics/0822_C811.f90
-@@ -0,0 +1,11 @@
-+! If => appears in initialization, the entity shall have the POINTER attribute.
-+! If = appears in initialization, the entity shall not have the POINTER
-+! attribute.
+@@ -0,0 +1,10 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C811: If => appears in initialization, the entity shall have the POINTER
++! attribute. If = appears in initialization, the entity shall not have the
++! POINTER attribute.
+
+subroutine test()
+ integer, target :: t = 12
+ ! ERROR: 'p' is a pointer but is not initialized like one
+ integer, pointer :: p = t
-+ ! ERROR: expected '('
-+ ! integer :: x => 10
+end subroutine
diff --git a/test/Semantics/0823_C812.f90 b/test/Semantics/0823_C812.f90
new file mode 100644
-index 0000000..d3cc0f8
+index 0000000..fb6e17e
--- /dev/null
+++ b/test/Semantics/0823_C812.f90
-@@ -0,0 +1,8 @@
-+! If initial-data-target appears, object-name shall be
+@@ -0,0 +1,9 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C812: If initial-data-target appears, object-name shall be
+! data-pointer-initialization compatible with it (7.5.4.6)
+
+subroutine test()
@@ -334,26 +355,29 @@ index 0000000..d3cc0f8
+end subroutine
diff --git a/test/Semantics/0824_C814.f90 b/test/Semantics/0824_C814.f90
new file mode 100644
-index 0000000..5758434
+index 0000000..ff0a810
--- /dev/null
+++ b/test/Semantics/0824_C814.f90
-@@ -0,0 +1,9 @@
-+! An automatic data object shall not have the SAVE attribute.
+@@ -0,0 +1,10 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C814: An automatic data object shall not have the SAVE attribute.
+
+subroutine test(x, n, m)
+ ! ERROR: SAVE attribute may not be applied to dummy argument 'x'
+ integer, save :: x
+ integer, intent(in) :: n, m
-+ ! ERROR: SAVE attribute may not be applied to automatic data object 'temp'
++ ! ERROR: SAVE attribute may not be applied to automatic data object 'temp'
+ real, dimension(n,m), save :: temp
+end subroutine
diff --git a/test/Semantics/0825_C817.f90 b/test/Semantics/0825_C817.f90
new file mode 100644
-index 0000000..9ca6776
+index 0000000..ac6233c
--- /dev/null
+++ b/test/Semantics/0825_C817.f90
-@@ -0,0 +1,13 @@
-+! An access-spec shall appear only in the specification-part of a module.
+@@ -0,0 +1,15 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C817: An access-spec shall appear only in the specification-part of a
++! module.
+
+module m
+private
@@ -368,12 +392,13 @@ index 0000000..9ca6776
+end
diff --git a/test/Semantics/0826_C818.f90 b/test/Semantics/0826_C818.f90
new file mode 100644
-index 0000000..db76647
+index 0000000..fca8f08
--- /dev/null
+++ b/test/Semantics/0826_C818.f90
-@@ -0,0 +1,25 @@
-+! An entity with the BIND attribute shall be a common block, variable,
-+! type, or! procedure.
+@@ -0,0 +1,26 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C818: An entity with the BIND attribute shall be a common block,
++! variable, type, or! procedure.
+
+subroutine test_sub() bind(c, name="test_sub")
+end subroutine
@@ -399,26 +424,28 @@ index 0000000..db76647
+end program main
diff --git a/test/Semantics/0827_C819.f90 b/test/Semantics/0827_C819.f90
new file mode 100644
-index 0000000..64a283a
+index 0000000..ffcd47c
--- /dev/null
+++ b/test/Semantics/0827_C819.f90
@@ -0,0 +1,9 @@
-+! A variable with the BIND attribute shall be declared in the specification
-+! part of a module.
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C819: A variable with the BIND attribute shall be declared in the
++! specification part of a module.
+
+subroutine test()
-+ ! ERROR: A variable with BIND(C) attribute may only appear in the
-+ ! specification part of a module
++ ! ERROR: A variable with BIND(C) attribute may only appear in the specification part of a module
+ integer :: x
+ bind(c, name="x") :: x
+end subroutine
diff --git a/test/Semantics/0828_C822.f90 b/test/Semantics/0828_C822.f90
new file mode 100644
-index 0000000..3b05f68
+index 0000000..98ad273
--- /dev/null
+++ b/test/Semantics/0828_C822.f90
-@@ -0,0 +1,10 @@
-+! The sum of the rank and corank of an entity shall not exceed fifteen.
+@@ -0,0 +1,12 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C822: The sum of the rank and corank of an entity shall not exceed
++! fifteen.
+
+subroutine test()
+ ! ERROR: 'a' has rank 16, which is greater than the maximum supported rank 15
@@ -430,12 +457,13 @@ index 0000000..3b05f68
+end program main
diff --git a/test/Semantics/0829_C830.f90 b/test/Semantics/0829_C830.f90
new file mode 100644
-index 0000000..44e759f
+index 0000000..7ec3643
--- /dev/null
+++ b/test/Semantics/0829_C830.f90
-@@ -0,0 +1,10 @@
-+! An entity with the CONTIGUOUS attribute shall be an array pointer, an
-+! assumed-shape array, or an assumed-rank dummy data object.
+@@ -0,0 +1,11 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C830: An entity with the CONTIGUOUS attribute shall be an array pointer,
++! an assumed-shape array, or an assumed-rank dummy data object.
+
+subroutine test(assumed_shape, assumed_rank)
+ integer, contiguous, pointer :: a(:)
@@ -446,12 +474,13 @@ index 0000000..44e759f
+end subroutine
diff --git a/test/Semantics/0830_C831.f90 b/test/Semantics/0830_C831.f90
new file mode 100644
-index 0000000..cd8daa7
+index 0000000..da127bf
--- /dev/null
+++ b/test/Semantics/0830_C831.f90
-@@ -0,0 +1,14 @@
-+! An explicit-shape-spec whose bounds are not constant expressions shall
-+! appear only in a subprogram, derived type definition, BLOCK construct,
+@@ -0,0 +1,15 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C831: An explicit-shape-spec whose bounds are not constant expressions
++! shall appear only in a subprogram, derived type definition, BLOCK construct,
+! or interface body.
+
+subroutine test(n)
@@ -466,12 +495,12 @@ index 0000000..cd8daa7
+end program main
diff --git a/test/Semantics/0831_C832.f90 b/test/Semantics/0831_C832.f90
new file mode 100644
-index 0000000..7d2b37f
+index 0000000..99e20c0
--- /dev/null
+++ b/test/Semantics/0831_C832.f90
@@ -0,0 +1,13 @@
-+! An array with the POINTER or ALLOCATABLE attribute shall have an array-spec
-+! that is a deferred-shape-spec-list.
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C832: An array with the POINTER or ALLOCATABLE attribute shall have an array-spec that is a deferred-shape-spec-list.
+
+subroutine test()
+ integer :: i = 2
@@ -480,17 +509,18 @@ index 0000000..7d2b37f
+ real, pointer, dimension(0 : 2) :: b
+
+ real, allocatable :: c(:)
-+ ! ERROR: Allocatable array 'd' must have deferred shape or assumed rank
++ ! ERROR: Allocatable array 'd' must have deferred shape or assumed rank
+ real, allocatable :: d(0 : 2)
+end subroutine
diff --git a/test/Semantics/0832_C833.f90 b/test/Semantics/0832_C833.f90
new file mode 100644
-index 0000000..61c8f6d
+index 0000000..5f49388
--- /dev/null
+++ b/test/Semantics/0832_C833.f90
-@@ -0,0 +1,13 @@
-+! An object whose array bounds are specified by an assumed-size-spec shall be a
-+! dummy data object.
+@@ -0,0 +1,14 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C833: An object whose array bounds are specified by an assumed-size-spec
++! shall be a dummy data object.
+
+subroutine test(n)
+ integer :: n
@@ -504,11 +534,12 @@ index 0000000..61c8f6d
+end subroutine
diff --git a/test/Semantics/0833_C835.f90 b/test/Semantics/0833_C835.f90
new file mode 100644
-index 0000000..5ed31e9
+index 0000000..26210bf
--- /dev/null
+++ b/test/Semantics/0833_C835.f90
-@@ -0,0 +1,10 @@
-+! An object whose array bounds are specified by an
+@@ -0,0 +1,11 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C835: An object whose array bounds are specified by an
+! implied-shape-or-assumed-size-spec shall be a dummy data object or a named
+! constant.
+
@@ -520,11 +551,12 @@ index 0000000..5ed31e9
+end subroutine
diff --git a/test/Semantics/0834_C836.f90 b/test/Semantics/0834_C836.f90
new file mode 100644
-index 0000000..d2bd467
+index 0000000..f0741d5
--- /dev/null
+++ b/test/Semantics/0834_C836.f90
-@@ -0,0 +1,7 @@
-+! An implied-shape array shall be a named constant.
+@@ -0,0 +1,8 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C836: An implied-shape array shall be a named constant.
+
+subroutine test()
+ integer, parameter :: a(*) = [1,2,3]
@@ -533,27 +565,29 @@ index 0000000..d2bd467
+end subroutine
diff --git a/test/Semantics/0835_C837.f90 b/test/Semantics/0835_C837.f90
new file mode 100644
-index 0000000..732951d
+index 0000000..dedf556
--- /dev/null
+++ b/test/Semantics/0835_C837.f90
-@@ -0,0 +1,9 @@
-+! An assumed-rank entity shall be a dummy data object that does not have the
-+! CODIMENSION or VALUE attribute.
+@@ -0,0 +1,10 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C837: An assumed-rank entity shall be a dummy data object that does not
++! have the CODIMENSION or VALUE attribute.
+
+subroutine test(a)
+ integer, value :: a(..)
+ ! ERROR: Assumed-rank array 'b' must be a dummy argument
-+ ! ERROR: VALUE attribute may apply only to a dummy argument
++ ! ERROR: VALUE attribute may apply only to a dummy argument
+ integer, value :: b(..)
+end subroutine
diff --git a/test/Semantics/0836_C840.f90 b/test/Semantics/0836_C840.f90
new file mode 100644
-index 0000000..63915fa
+index 0000000..c7a2694
--- /dev/null
+++ b/test/Semantics/0836_C840.f90
-@@ -0,0 +1,8 @@
-+! An entity shall not have both the EXTERNAL attribute and the INTRINSIC
-+! attribute.
+@@ -0,0 +1,9 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C840: An entity shall not have both the EXTERNAL attribute and the
++! INTRINSIC attribute.
+
+program main
+ ! Do not raised any error!
@@ -562,12 +596,13 @@ index 0000000..63915fa
+end program main
diff --git a/test/Semantics/0837_C841.f90 b/test/Semantics/0837_C841.f90
new file mode 100644
-index 0000000..fdf9978
+index 0000000..b196541
--- /dev/null
+++ b/test/Semantics/0837_C841.f90
-@@ -0,0 +1,8 @@
-+! In an external subprogram, the EXTERNAL attribute shall not be specified for
-+! a procedure defined by the subprogram.
+@@ -0,0 +1,9 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C841: In an external subprogram, the EXTERNAL attribute shall not be
++! specified for a procedure defined by the subprogram.
+
+subroutine test()
+ real :: func
@@ -576,12 +611,13 @@ index 0000000..fdf9978
+end subroutine
diff --git a/test/Semantics/0838_C842.f90 b/test/Semantics/0838_C842.f90
new file mode 100644
-index 0000000..0329408
+index 0000000..4948636
--- /dev/null
+++ b/test/Semantics/0838_C842.f90
-@@ -0,0 +1,17 @@
-+! In an interface body, the EXTERNAL attribute shall not be specified for the
-+! procedure declared by the interface body.
+@@ -0,0 +1,18 @@
++! RUN: %python %S/test_errors.py %s %flang_fc1
++! Test C842: In an interface body, the EXTERNAL attribute shall not be specified
++! for the procedure declared by the interface body.
+
+module m
+ interface
@@ -603,43 +639,43 @@ index 0000000..8c81e9a
--- /dev/null
+++ b/test/Semantics/result-08.md
@@ -0,0 +1,40 @@
-+| Constraint | flang-new | gfortran | ifort |
-+| :--------------- | :----- | :---- | :---- |
-+| C801 allocatable | WARN | ERROR | ERROR |
-+| C801 contiguous | WARN | ERROR | ERROR |
-+| C801 dimension | ERROR | ERROR | ERROR |
-+| C801 external | WARN | ERROR | ERROR |
-+| C801 intent | WARN | ERROR | ERROR |
-+| C801 intrinsic | WARN | ERROR | ERROR |
-+| C801 optional | WARN | ERROR | ERROR |
-+| C801 parameter | WARN | ERROR | ERROR |
-+| C801 pointer | WARN | ERROR | ERROR |
-+| C801 protected | WARN | ERROR | ERROR |
-+| C801 save | WARN | ERROR | ERROR |
-+| C801 target | WARN | ERROR | ERROR |
-+| C801 value | WARN | ERROR | ERROR |
-+| C801 volatile | WARN | ERROR | ERROR |
-+| C802 | ERROR | ERROR | ERROR |
-+| C803 | ICE | ERROR | ERROR |
-+| C804 | ERROR | ERROR | ERROR |
-+| C805 | ERROR | ERROR | ERROR in ‘program main'
OK in 'subroutine' |
-+| C806 | ERROR | ERROR | ERROR |
-+| C807 | ERROR | ERROR | ERROR |
-+| C808 | ERROR | ERROR | ERROR |
-+| C811 | ERROR | ERROR | ERROR |
-+| C812 | ERROR | ERROR | ERROR |
-+| C814 | ERROR | ERROR | ERROR |
-+| C817 | ERROR | ERROR | ERROR |
-+| C818 | OK | OK | OK |
-+| C819 | ERROR | ERROR | ERROR |
-+| C822 | ERROR | ERROR | OK |
-+| C830 | OK | ERROR | ERROR |
-+| C831 | ERROR | ERROR | ERROR |
-+| C832 | ERROR | ERROR | ERROR |
-+| C833 | ERROR | ERROR | ERROR |
-+| C835 | ERROR | ERROR | ERROR |
-+| C836 | ERROR | ERROR | ERROR |
-+| C837 | ERROR | ERROR | ERROR |
-+| C840 | OK | ERROR | ERROR |
-+| C841 | ERROR | ERROR | ERROR |
-+| C842 | ERROR | ERROR | ERROR |
++| Constraint | flang-new | gfortran | ifort |
++| :--------------- | :----- | :---- | :---- |
++| C801 allocatable | WARN | ERROR | ERROR |
++| C801 contiguous | WARN | ERROR | ERROR |
++| C801 dimension | ERROR | ERROR | ERROR |
++| C801 external | WARN | ERROR | ERROR |
++| C801 intent | WARN | ERROR | ERROR |
++| C801 intrinsic | WARN | ERROR | ERROR |
++| C801 optional | WARN | ERROR | ERROR |
++| C801 parameter | WARN | ERROR | ERROR |
++| C801 pointer | WARN | ERROR | ERROR |
++| C801 protected | WARN | ERROR | ERROR |
++| C801 save | WARN | ERROR | ERROR |
++| C801 target | WARN | ERROR | ERROR |
++| C801 value | WARN | ERROR | ERROR |
++| C801 volatile | WARN | ERROR | ERROR |
++| C802 | ERROR | ERROR | ERROR |
++| C803 | ICE | ERROR | ERROR |
++| C804 | ERROR | ERROR | ERROR |
++| C805 | ERROR | ERROR | ERROR in ‘program main'
OK in 'subroutine' |
++| C806 | ERROR | ERROR | ERROR |
++| C807 | ERROR | ERROR | ERROR |
++| C808 | ERROR | ERROR | ERROR |
++| C811 | ERROR | ERROR | ERROR |
++| C812 | ERROR | ERROR | ERROR |
++| C814 | ERROR | ERROR | ERROR |
++| C817 | ERROR | ERROR | ERROR |
++| C818 | OK | OK | OK |
++| C819 | ERROR | ERROR | ERROR |
++| C822 | ERROR | ERROR | OK |
++| C830 | OK | ERROR | ERROR |
++| C831 | ERROR | ERROR | ERROR |
++| C832 | ERROR | ERROR | ERROR |
++| C833 | ERROR | ERROR | ERROR |
++| C835 | ERROR | ERROR | ERROR |
++| C836 | ERROR | ERROR | ERROR |
++| C837 | ERROR | ERROR | ERROR |
++| C840 | OK | ERROR | ERROR |
++| C841 | ERROR | ERROR | ERROR |
++| C842 | ERROR | ERROR | ERROR |
diff --git a/flang.spec b/flang.spec
index 2abfa059b539605745462274dfd615e190927179..9ceda8d09b42cfb0a054244bfd311087973cb1da 100644
--- a/flang.spec
+++ b/flang.spec
@@ -2,7 +2,7 @@
Name: flang
Version: flang_20210324
-Release: 19
+Release: 20
Summary: Fortran language compiler targeting LLVM
License: Apache-2.0
@@ -49,6 +49,9 @@ TODO: support build Flang.
%changelog
+* Mon Jan 16 2023 wangzhewei - flang_20210324-20
+- Fix patch 7 and patch 14
+
* Tue Dec 20 2022 huwei - flang_20210324-19
- Add 17-add-fortran-memory-align-investigation.patch for add fortran memory align investigation