Commit 51c89186 authored by Budiardja, Reuben's avatar Budiardja, Reuben
Browse files

Added new test case with associate construct.

parent 502d6322
module CONSTANT_Singleton
implicit none
integer, public, parameter :: &
KDR = kind ( 1.d0 )
type, public :: ConstantSingleton
real ( KDR ) :: &
PI = acos ( -1.0_KDR ), &
SPEED_OF_LIGHT = 2.99792458e+8_KDR, &
PLANCK_REDUCED = 1.054571800e-34_KDR
end type ConstantSingleton
type ( ConstantSingleton ), public, parameter :: &
CONSTANT = ConstantSingleton ( )
end module CONSTANT_Singleton
program TestValue
use CONSTANT_Singleton
implicit none
associate ( Pi => CONSTANT % PI )
print*, 'Pi = ', Pi
end associate
end program TestValue
Some compiler failed to produce the correct value when associate construct is
used with member of derived type declared as module variable.
This test problem reproduce this issue with such compiler when optimization
was used.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment