90 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic21001 format(A)3 4 !ERROR: Format statement must be labeled5 format(A)6 72001 format(3I8, 3Z8)82002 format(DC, F8.2, 3I8, Z8)92003 format( D C , F 8 . 2 , 3 I 8 , 3 Z 8 )102004 format(20PF10.2)112005 format(20P,F10.2)122006 format(20P7F10.2)132007 format(1X/)142008 format(/02x)152009 format(1x/02x)162010 format(2L2:)172011 format(:2L2)182012 format(2L2 : 2L2)19 20 write(*,2013) 'Hello'21 if (2+2.eq.4) then222013 format(A10) ! ok to reference outside the if block23 endif24 25 ! C1302 warnings; no errors26 !WARNING: Expected ',' or ')' in format expression272051 format(1X3/)28 !WARNING: Expected ',' or ')' in format expression292052 format(1X003/)30 !WARNING: Expected ',' or ')' in format expression312053 format(3P7I2)32 !WARNING: Expected ',' or ')' in format expression332054 format(3PI2)34 35 !ERROR: Expected ',' or ')' in format expression362101 format(3I83Z8, 'abc')37 38 !ERROR: Expected ',' or ')' in format expression392102 format( 3 I 8 3 Z 8 )40 41 !ERROR: Expected ',' or ')' in format expression422103 format(3I8 3Z8)43 44 !WARNING: Expected ',' or ')' in format expression452104 format(3I8 Z8)46 473001 format(*(I3))483002 format(5X,*(2(A)))49 50 !ERROR: Unlimited format item list must contain a data edit descriptor51 !WARNING: 'X' edit descriptor must have a positive position value523101 format(*(X))53 54 !ERROR: Unlimited format item list must contain a data edit descriptor553102 format(5X,*(2(/)))56 57 !ERROR: Unlimited format item list must contain a data edit descriptor583103 format(5X, 'abc', *((:)))59 60 !WARNING: 'X' edit descriptor must have a positive position value614001 format(2(X))62 63 !ERROR: List repeat specifier must be positive64 !WARNING: 'X' edit descriptor must have a positive position value65 !ERROR: 'DT' edit descriptor repeat specifier must be positive664101 format(0(X), 0dt)67 686001 format(((I0, B0)))69 70 !ERROR: 'A' edit descriptor 'w' value must be positive71 !WARNING: 'L' edit descriptor 'w' value should be positive726101 format((A0), ((L0)))73 74 !WARNING: 'L' edit descriptor 'w' value should be positive756102 format((3(((L 0 0 0)))))76 777001 format(17G8.1, 17G8.1e3)78 79 !ERROR: Expected 'G' edit descriptor '.d' value807101 format(17G8)81 828001 format(9G0.5)83 84 !ERROR: A 'G0' edit descriptor must not have an 'e' value858101 format(9(G0.5e1))86 87 !ERROR: A 'G0' edit descriptor must not have an 'e' value888102 format(9(G0.5 E 1))89end90