annotate gcc/testsuite/gfortran.dg/fmt_error_2.f90 @ 132:d34655255c78

update gcc-8.2
author mir3636
date Thu, 25 Oct 2018 10:21:07 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 ! { dg-options "-std=legacy" }
kono
parents:
diff changeset
3 !
kono
parents:
diff changeset
4 ! PR 33269: we used to not simplify format strings before checking if
kono
parents:
diff changeset
5 ! they were valid, leading to a missed error.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 IMPLICIT CHARACTER*5 (h-z)
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 CHARACTER*5 f
kono
parents:
diff changeset
10 CHARACTER*5 bad, good
kono
parents:
diff changeset
11 parameter(bad="a", good="(a)")
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 PRINT ('a'), "hello" ! { dg-error "Missing leading left parenthesis in format string" }
kono
parents:
diff changeset
14 WRITE (*, ("a")) "error" ! { dg-error "Missing leading left parenthesis in format string" }
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 PRINT 'a', "hello" ! { dg-error "Missing leading left parenthesis in format string" }
kono
parents:
diff changeset
17 WRITE (*, "a") "error" ! { dg-error "Missing leading left parenthesis in format string" }
kono
parents:
diff changeset
18 WRITE (*, bad) "error" ! { dg-error "Missing leading left parenthesis in format string" }
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 PRINT 'a' // ', a', "err", "or" ! { dg-error "Missing leading left parenthesis in format string" }
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 PRINT '(' // 'a' ! { dg-error "Unexpected end of format string in format string" }
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 ! the following are ok
kono
parents:
diff changeset
25 PRINT "(2f5.3)", bar, foo
kono
parents:
diff changeset
26 PRINT ' (a)', "hello"
kono
parents:
diff changeset
27 WRITE (*, " ((a))") "hello"
kono
parents:
diff changeset
28 print "(a" // ")", "all is fine"
kono
parents:
diff changeset
29 print good, "great"
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 ! verify that we haven't broken non-constant expressions
kono
parents:
diff changeset
32 f = "(f5.3)"
kono
parents:
diff changeset
33 print f, 3.14159
kono
parents:
diff changeset
34 print (f), 2.71813
kono
parents:
diff changeset
35 print implicitly_typed, "something"
kono
parents:
diff changeset
36 write (*, implicitly_typed_as_well) "something else"
kono
parents:
diff changeset
37 END