[flang] Fix for flang-compiler/f18#694 - Unexpected error when compiling submodule
authorkiranktp <kirankumart.tp@amd.com>
Thu, 7 Nov 2019 09:47:57 +0000 (15:17 +0530)
committerkiranktp <kirankumart.tp@amd.com>
Thu, 14 Nov 2019 05:42:39 +0000 (11:12 +0530)
Incorporated all review comments and updated the test case.

Change-Id: I03939bfc705cc5319a0b7da3305026b8403b8edc

Original-commit: flang-compiler/f18@a52b0367ea1f34e0059b0043d1f370bec5896c74
Reviewed-on: https://github.com/flang-compiler/f18/pull/817
Tree-same-pre-rewrite: false

flang/test/semantics/separate_module_procs_1.f90 [deleted file]
flang/test/semantics/separate_module_procs_2.f90 [deleted file]

diff --git a/flang/test/semantics/separate_module_procs_1.f90 b/flang/test/semantics/separate_module_procs_1.f90
deleted file mode 100644 (file)
index 96a544f..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-! Copyright (c) 2018, NVIDIA CORPORATION.  All rights reserved.
-!
-! Licensed under the Apache License, Version 2.0 (the "License");
-! you may not use this file except in compliance with the License.
-! You may obtain a copy of the License at
-!
-!     http://www.apache.org/licenses/LICENSE-2.0
-!
-! Unless required by applicable law or agreed to in writing, software
-! distributed under the License is distributed on an "AS IS" BASIS,
-! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-! See the License for the specific language governing permissions and
-! limitations under the License.
-
-!DEF: /m1 Module
-module m1
-  !DEF: /m1/ma PUBLIC (Function) Generic
-  interface ma
-    !DEF: /m1/ma_create_fun MODULE, PUBLIC (Function) Subprogram INTEGER(4)
-    !DEF: /m1/ma_create_fun/this ObjectEntity INTEGER(4)
-    module function ma_create_fun( ) result(this)
-      !REF: /m1/ma_create_fun/this
-      integer this
-    end function
-  end interface
-end module
-
-!REF: /m1
-!DEF: /m1/ma_submodule Module
-submodule (m1) ma_submodule
-  contains
-  !DEF: /m1/ma_submodule/ma_create_fun MODULE, PUBLIC (Function) Subprogram INTEGER(4)
-  !DEF: /m1/ma_submodule/ma_create_fun/this ObjectEntity INTEGER(4)
-  module function ma_create_fun() result(this)
-    !REF: /m1/ma_submodule/ma_create_fun/this
-    integer this
-    print *, "Hello"
-  end function
-end submodule
-
-!DEF: /m2 Module
-module m2
-  !DEF: /m2/mb PUBLIC (Subroutine) Generic
-  interface mb
-    !DEF: /m2/mb_create_sub MODULE, PUBLIC (Subroutine) Subprogram
-    module subroutine  mb_create_sub
-    end subroutine mb_create_sub
-  end interface
-end module
-
-!REF: /m2
-!DEF: /m2/mb_submodule Module
-submodule (m2) mb_submodule
-  contains
-  !DEF: /m2/mb_submodule/mb_create_sub MODULE, PUBLIC (Subroutine) Subprogram
-  module subroutine  mb_create_sub
-    !DEF: /m2/mb_submodule/mb_create_sub/this ObjectEntity INTEGER(4)
-    integer this
-    print *, "Hello"
-  end subroutine mb_create_sub
-end submodule
diff --git a/flang/test/semantics/separate_module_procs_2.f90 b/flang/test/semantics/separate_module_procs_2.f90
deleted file mode 100644 (file)
index c2ae1b6..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-! Copyright (c) 2018, NVIDIA CORPORATION.  All rights reserved.
-!
-! Licensed under the Apache License, Version 2.0 (the "License");
-! you may not use this file except in compliance with the License.
-! You may obtain a copy of the License at
-!
-!     http://www.apache.org/licenses/LICENSE-2.0
-!
-! Unless required by applicable law or agreed to in writing, software
-! distributed under the License is distributed on an "AS IS" BASIS,
-! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-! See the License for the specific language governing permissions and
-! limitations under the License.
-
-module m1
-  interface ma
-  end interface
-end module
-
-submodule (m1) ma_submodule
-  contains
-  !ERROR: 'ma_create_new_fun' was not declared a separate module procedure
-  module function ma_create_new_fun() result(this)
-    integer :: this
-    print *, "Hello"
-  end function
-end submodule
-
-module m2
-  interface mb
-  end interface
-end module
-
-submodule (m2) mb_submodule
-  contains
-  !ERROR: 'mb_create_new_sub' was not declared a separate module procedure
-  module SUBROUTINE  mb_create_new_sub() 
-    integer :: this
-    print *, "Hello"
-  end SUBROUTINE mb_create_new_sub
-end submodule