2 ! { dg-options "-std=f2003" }
5 ! Check for errors with ASSOCIATE during parsing.
10 ASSOCIATE ! { dg-error "Expected association list" }
12 ASSOCIATE () ! { dg-error "Expected association" }
14 ASSOCIATE (a => 1) 5 ! { dg-error "Junk after ASSOCIATE" }
16 ASSOCIATE (x =>) ! { dg-error "Invalid association target" }
18 ASSOCIATE (=> 5) ! { dg-error "Expected association" }
20 ASSOCIATE (x => 5, ) ! { dg-error "Expected association" }
22 myname: ASSOCIATE (a => 1)
23 END ASSOCIATE ! { dg-error "Expected block name of 'myname'" }
26 END ASSOCIATE myname ! { dg-error "Syntax error in END ASSOCIATE" }
28 myname2: ASSOCIATE (c => 3)
29 END ASSOCIATE myname3 ! { dg-error "Expected label 'myname2'" }
31 ASSOCIATE (a => 1, b => 2, a => 3) ! { dg-error "Duplicate name 'a'" }
34 INTEGER :: b ! { dg-error "Unexpected data declaration statement" }
36 END PROGRAM main ! { dg-error "Expecting END ASSOCIATE" }
37 ! { dg-excess-errors "Unexpected end of file" }