Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / io07.f90
blob1c13c7df20a31cbc36476c4716b78f69d7a7a569
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
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 2051 format(1X3/)
27 2052 format(1X003/)
28 2053 format(3P7I2)
29 2054 format(3PI2)
31 !ERROR: Expected ',' or ')' in format expression
32 2101 format(3I83Z8, 'abc')
34 !ERROR: Expected ',' or ')' in format expression
35 2102 format( 3 I 8 3 Z 8 )
37 !ERROR: Expected ',' or ')' in format expression
38 2103 format(3I8 3Z8)
40 !ERROR: Expected ',' or ')' in format expression
41 2104 format(3I8 Z8)
43 3001 format(*(I3))
44 3002 format(5X,*(2(A)))
46 !ERROR: Unlimited format item list must contain a data edit descriptor
47 3101 format(*(X))
49 !ERROR: Unlimited format item list must contain a data edit descriptor
50 3102 format(5X,*(2(/)))
52 !ERROR: Unlimited format item list must contain a data edit descriptor
53 3103 format(5X, 'abc', *((:)))
55 4001 format(2(X))
57 !ERROR: List repeat specifier must be positive
58 !ERROR: 'DT' edit descriptor repeat specifier must be positive
59 4101 format(0(X), 0dt)
61 6001 format(((I0, B0)))
63 !ERROR: 'A' edit descriptor 'w' value must be positive
64 !ERROR: 'L' edit descriptor 'w' value must be positive
65 6101 format((A0), ((L0)))
67 !ERROR: 'L' edit descriptor 'w' value must be positive
68 6102 format((3(((L 0 0 0)))))
70 7001 format(17G8.1, 17G8.1e3)
72 !ERROR: Expected 'G' edit descriptor '.d' value
73 7101 format(17G8)
75 8001 format(9G0.5)
77 !ERROR: A 'G0' edit descriptor must not have an 'e' value
78 8101 format(9(G0.5e1))
80 !ERROR: A 'G0' edit descriptor must not have an 'e' value
81 8102 format(9(G0.5 E 1))
82 end