[ORC] Merge ostream operators for SymbolStringPtrs into SymbolStringPool.h. NFC.
[llvm-project.git] / flang / test / Semantics / io07.f90
blob64a32c9959287c6ade3417430999535d4e58aeaf
1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
2 1001 format(A)
4 !ERROR: Format statement must be labeled
5 format(A)
7 2001 format(3I8, 3Z8)
8 2002 format(DC, F8.2, 3I8, Z8)
9 2003 format( D C , F 8 . 2 , 3 I 8 , 3 Z 8 )
10 2004 format(20PF10.2)
11 2005 format(20P,F10.2)
12 2006 format(20P7F10.2)
13 2007 format(1X/)
14 2008 format(/02x)
15 2009 format(1x/02x)
16 2010 format(2L2:)
17 2011 format(:2L2)
18 2012 format(2L2 : 2L2)
20 write(*,2013) 'Hello'
21 if (2+2.eq.4) then
22 2013 format(A10) ! ok to reference outside the if block
23 endif
25 ! C1302 warnings; no errors
26 !WARNING: Expected ',' or ')' in format expression
27 2051 format(1X3/)
28 !WARNING: Expected ',' or ')' in format expression
29 2052 format(1X003/)
30 !WARNING: Expected ',' or ')' in format expression
31 2053 format(3P7I2)
32 !WARNING: Expected ',' or ')' in format expression
33 2054 format(3PI2)
35 !ERROR: Expected ',' or ')' in format expression
36 2101 format(3I83Z8, 'abc')
38 !ERROR: Expected ',' or ')' in format expression
39 2102 format( 3 I 8 3 Z 8 )
41 !ERROR: Expected ',' or ')' in format expression
42 2103 format(3I8 3Z8)
44 !WARNING: Expected ',' or ')' in format expression
45 2104 format(3I8 Z8)
47 3001 format(*(I3))
48 3002 format(5X,*(2(A)))
50 !ERROR: Unlimited format item list must contain a data edit descriptor
51 !WARNING: 'X' edit descriptor must have a positive position value
52 3101 format(*(X))
54 !ERROR: Unlimited format item list must contain a data edit descriptor
55 3102 format(5X,*(2(/)))
57 !ERROR: Unlimited format item list must contain a data edit descriptor
58 3103 format(5X, 'abc', *((:)))
60 !WARNING: 'X' edit descriptor must have a positive position value
61 4001 format(2(X))
63 !ERROR: List repeat specifier must be positive
64 !WARNING: 'X' edit descriptor must have a positive position value
65 !ERROR: 'DT' edit descriptor repeat specifier must be positive
66 4101 format(0(X), 0dt)
68 6001 format(((I0, B0)))
70 !ERROR: 'A' edit descriptor 'w' value must be positive
71 !ERROR: 'L' edit descriptor 'w' value must be positive
72 6101 format((A0), ((L0)))
74 !ERROR: 'L' edit descriptor 'w' value must be positive
75 6102 format((3(((L 0 0 0)))))
77 7001 format(17G8.1, 17G8.1e3)
79 !ERROR: Expected 'G' edit descriptor '.d' value
80 7101 format(17G8)
82 8001 format(9G0.5)
84 !ERROR: A 'G0' edit descriptor must not have an 'e' value
85 8101 format(9(G0.5e1))
87 !ERROR: A 'G0' edit descriptor must not have an 'e' value
88 8102 format(9(G0.5 E 1))
89 end