aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/dec_structure_9.f90
blob: 34c46c61c1c37a143fc0814b670fd909cec68dfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
! { dg-do compile }
! { dg-options "-fdec-structure" }
!
! Basic compile tests for what CAN be done with dot ('.') as a member accessor.
!

logical :: l, l2 = .true., l3 = .false., and
integer i
character(5) s
real r

structure /s1/
  integer i
  character(5) s
  real r
end structure

record /s1/ r1

! Basic 
l = l .and. l2 .or. l3
l = and .and. and .and. and
l =  l2 .eqv. l3
l = (l2) .eqv. l3

! Integers
l = .not. (i .eq. 0)
l = .not. (0 .eq. i)
l = .not. (r1.i .eq. 0)
l = .not. (0 .eq. r1.i)
! Characters
l = .not. (s .eq. "hello")
l = .not. ("hello" .eq. s)
l = .not. (r1.s .eq. "hello")
l = .not. ("hello" .eq. r1.s)
! Reals
l = .not. (r .eq. 3.14)
l = .not. (3.14 .eq. r)
l = .not. (r1.r .eq. 3.14)
l = .not. (3.14 .eq. r1.r)

end