Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
b1fc7763
Commit
b1fc7763
authored
Oct 04, 2019
by
Mark Eggleston
Committed by
Mark Eggleston
Oct 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace test cases for using automatic variables in equivalence statements.
From-SVN: r276580
parent
3694418a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
62 deletions
+43
-62
gcc/testsuite/ChangeLog
+6
-0
gcc/testsuite/gfortran.dg/auto_in_equiv_1.f90
+26
-27
gcc/testsuite/gfortran.dg/auto_in_equiv_2.f90
+11
-35
No files found.
gcc/testsuite/ChangeLog
View file @
b1fc7763
2019-10-04 Mark Eggleston <mark.eggleston@codethink.com>
* gfortran.dg/auto_in_equiv_1.f90: Replaced.
* gfortran.dg/auto_in_equiv_2.f90: Replaced.
* gfortran.dg/auto_in_equiv_3.f90: Deleted.
2019-10-04 Richard Sandiford <richard.sandiford@arm.com>
* gcc.target/aarch64/torture/simd-abi-8.c: Use -mlittle-endian.
...
...
gcc/testsuite/gfortran.dg/auto_in_equiv_1.f90
View file @
b1fc7763
! { dg-do compile }
! { dg-do run }
! { dg-options "-fdec-static -frecursive" }
! Contributed by Mark Eggleston <mark.eggleston@codethink.com>
!
! Check automatic variables can be used in equivalence statements.
! Any other variables that do not explicitly have the automatic
! attribute will be given the automatic attribute.
!
! Check that variables are on the stack by incorporating the
! equivalence in a recursive function.
!
program
test
call
suba
(
0
)
call
subb
(
0
)
call
suba
(
1
)
integer
::
f
f
=
factorial
(
5
)
if
(
f
.ne.
120
)
stop
2
contains
subroutine
suba
(
option
)
integer
,
intent
(
in
)
::
option
integer
,
automatic
::
a
! { dg-error "AUTOMATIC at \\(1\\) is a DEC extension" }
function
factorial
(
n
)
result
(
f
)
integer
::
f
integer
,
intent
(
in
)
::
n
integer
,
automatic
::
a
integer
::
b
integer
::
c
equivalence
(
a
,
b
)
if
(
option
.eq.
0
)
then
! initialise a and c
a
=
9
c
=
99
if
(
a
.ne.
b
)
stop
1
if
(
loc
(
a
)
.ne.
loc
(
b
))
stop
2
equivalence
(
a
,
b
)
if
(
loc
(
a
)
.ne.
loc
(
b
))
stop
1
b
=
n
if
(
a
.eq.
1
)
then
f
=
1
else
! a should've been overwritten
if
(
a
.eq.
9
)
stop
3
f
=
a
*
factorial
(
b
-1
)
end
if
end
subroutine
suba
subroutine
subb
(
dummy
)
integer
,
intent
(
in
)
::
dummy
integer
,
automatic
::
x
! { dg-error "AUTOMATIC at \\(1\\) is a DEC extension" }
integer
::
y
x
=
77
y
=
7
end
subroutine
subb
end
function
end
program
test
gcc/testsuite/gfortran.dg/auto_in_equiv_2.f90
View file @
b1fc7763
! { dg-do run }
! { dg-options "-fdec-static" }
! { dg-options "-fdec-static
-frecursive -fno-automatic
" }
! Contributed by Mark Eggleston <mark.eggleston@codethink.com>
program
test
call
suba
(
0
)
call
subb
(
0
)
call
suba
(
1
)
contains
subroutine
suba
(
option
)
integer
,
intent
(
in
)
::
option
integer
,
automatic
::
a
integer
::
b
integer
::
c
equivalence
(
a
,
b
)
if
(
option
.eq.
0
)
then
! initialise a and c
a
=
9
c
=
99
if
(
a
.ne.
b
)
stop
1
if
(
loc
(
a
)
.ne.
loc
(
b
))
stop
2
else
! a should've been overwritten
if
(
a
.eq.
9
)
stop
3
end
if
end
subroutine
suba
subroutine
subb
(
dummy
)
integer
,
intent
(
in
)
::
dummy
integer
,
automatic
::
x
integer
::
y
x
=
77
y
=
7
end
subroutine
subb
end
program
test
!
! Check that -fno-automatic does not break recursion. The recursive
! function is not marked with the resursive key word consequently
! local variables can be made static when -fno-automatic is used. The
! recursive function contains an equivalence that has a variable with
! the automatic attribute and one without.
!
include
"auto_in_equiv_1.f90"
! { dg-warning "Flag '-fno-automatic' overwrites '-frecursive'" "warning" { target *-*-* } 0 }
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment