diff mbox

[Fortran] Test for implied sequence in structures in common blocks

Message ID ebfe7141-74b7-3633-e631-7f175a6776b4@codethink.co.uk
State New
Headers show

Commit Message

Jim MacArthur Sept. 13, 2016, 1:51 p.m. UTC
Hi, I'd like to contribute this small test. I have legacy code which 
uses STRUCTURE statements in common blocks, and was happy to find 
Fritz's DEC support assumes ordering in STRUCTUREs, as the Oracle 
compiler does.

Jim MacArthur

--

2016-09-13  Jim MacArthur  <jim.macarthur@codethink.co.uk>

        * gfortran.dg/dec_structure_14.f90: New testcase.

Comments

Fritz Reese Sept. 13, 2016, 2:33 p.m. UTC | #1
Jim,

While the test exhibits no particular regression, IMVHO I don't see
any reason not to add it. None of my previous testcases include a
STRUCTURE within a COMMON block so this would certainly tickle some
new code paths, which could expose a future regression.

I'll give this through the weekend or so to see if any official
maintainers have a comment otherwise I wouldn't mind committing it as
trivial.

---
Fritz Reese


On Tue, Sep 13, 2016 at 9:51 AM, Jim MacArthur
<jim.macarthur@codethink.co.uk> wrote:
> Hi, I'd like to contribute this small test. I have legacy code which uses
> STRUCTURE statements in common blocks, and was happy to find Fritz's DEC
> support assumes ordering in STRUCTUREs, as the Oracle compiler does.
>
> Jim MacArthur
>
> --
>
> 2016-09-13  Jim MacArthur  <jim.macarthur@codethink.co.uk>
>
>        * gfortran.dg/dec_structure_14.f90: New testcase.
>
Jerry DeLisle Sept. 13, 2016, 2:52 p.m. UTC | #2
On 09/13/2016 07:33 AM, Fritz Reese wrote:
> Jim,
>
> While the test exhibits no particular regression, IMVHO I don't see
> any reason not to add it. None of my previous testcases include a
> STRUCTURE within a COMMON block so this would certainly tickle some
> new code paths, which could expose a future regression.
>
> I'll give this through the weekend or so to see if any official
> maintainers have a comment otherwise I wouldn't mind committing it as
> trivial.
>

No problem with the test case being added.

Jerry
Fritz Reese Sept. 14, 2016, 12:13 p.m. UTC | #3
Committed revision 240134.

---
Fritz Reese


On Tue, Sep 13, 2016 at 10:52 AM, Jerry DeLisle <jvdelisle@charter.net> wrote:
> On 09/13/2016 07:33 AM, Fritz Reese wrote:
>>
>> Jim,
>>
>> While the test exhibits no particular regression, IMVHO I don't see
>> any reason not to add it. None of my previous testcases include a
>> STRUCTURE within a COMMON block so this would certainly tickle some
>> new code paths, which could expose a future regression.
>>
>> I'll give this through the weekend or so to see if any official
>> maintainers have a comment otherwise I wouldn't mind committing it as
>> trivial.
>>
>
> No problem with the test case being added.
>
> Jerry
diff mbox

Patch

diff --git a/gcc/testsuite/gfortran.dg/dec_structure_14.f90 b/gcc/testsuite/gfortran.dg/dec_structure_14.f90
new file mode 100644
index 0000000..4e271b73
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dec_structure_14.f90
@@ -0,0 +1,18 @@ 
+  ! { dg-do "compile" }
+  ! { dg-options "-fdec-structure" }
+  !
+  ! Test that structures inside a common block do not require the
+  ! SEQUENCE attribute, as derived types do.
+  !
+
+common var
+
+structure /s/
+  integer i
+  integer j
+  real r
+end structure
+
+record /s/ var
+
+end
--