~ubuntu-branches/ubuntu/edgy/ftnchek/edgy

« back to all changes in this revision

Viewing changes to test/iffy.f

  • Committer: Bazaar Package Importer
  • Author(s): Mark Brown
  • Date: 2002-03-28 10:49:50 UTC
  • Revision ID: james.westby@ubuntu.com-20020328104950-kssfxlf8u0qsfelr
Tags: upstream-3.1.2
ImportĀ upstreamĀ versionĀ 3.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      SUBROUTINE IFFY ( USE1, USE2, L )
 
2
* Tests parsing & type-checking of various IF forms.
 
3
*
 
4
      LOGICAL USE1, USE2
 
5
      INTEGER L
 
6
      INTEGER M
 
7
      REAL X
 
8
* this block-if statement is OK
 
9
      IF ( USE1 ) THEN
 
10
         M = 1
 
11
* else-if statement is OK
 
12
      ELSE IF ( USE2 ) THEN
 
13
         M = 2
 
14
      ELSE
 
15
         M = 3
 
16
      END IF
 
17
* this logical if is OK
 
18
      IF( M .eq. 3 ) L = L+1
 
19
* this arithmetic if is OK
 
20
      IF( L ) 100, 100, 100
 
21
 100  X = L
 
22
* this arithmetic if is OK
 
23
      IF( X ) 150, 150, 150
 
24
 150  CONTINUE
 
25
* violate a block if statement
 
26
      IF ( L ) THEN
 
27
         M = M+1
 
28
* violate an elseif statement
 
29
      ELSE IF ( M ) THEN
 
30
         M = M+2
 
31
      ELSE
 
32
         M = M+3
 
33
      END IF
 
34
* violate a logical if statement
 
35
      IF( M ) L = L+1
 
36
* violate an arithmetic if statement
 
37
      IF( L .EQ. 3 ) 200, 200, 200
 
38
 200  CONTINUE
 
39
      END
 
40