[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Semantics / resolve85.f90
blobd1720bd5aef8a018fa3be3d26956b29046cc34b3
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 module m
3 ! C730 The same type-attr-spec shall not appear more than once in a given
4 ! derived-type-stmt.
6 ! R727 derived-type-stmt ->
7 ! TYPE [[, type-attr-spec-list] ::] type-name [( type-param-name-list )]
8 ! type-attr-spec values are:
9 ! ABSTRACT, PUBLIC, PRIVATE, BIND(C), EXTENDS(parent-type-name)
10 !WARNING: Attribute 'ABSTRACT' cannot be used more than once
11 type, abstract, public, abstract :: derived1
12 end type derived1
14 !WARNING: Attribute 'PUBLIC' cannot be used more than once
15 type, public, abstract, public :: derived2
16 end type derived2
18 !WARNING: Attribute 'PRIVATE' cannot be used more than once
19 type, private, abstract, private :: derived3
20 end type derived3
22 !ERROR: Attributes 'PUBLIC' and 'PRIVATE' conflict with each other
23 type, public, abstract, private :: derived4
24 end type derived4
26 !WARNING: Attribute 'BIND(C)' cannot be used more than once
27 type, bind(c), public, bind(c) :: derived5
28 end type derived5
30 type, public :: derived6
31 end type derived6
33 !ERROR: Attribute 'EXTENDS' cannot be used more than once
34 type, extends(derived6), public, extends(derived6) :: derived7
35 end type derived7
37 end module m