From 084be7de21b6703e710860d98949c2009ae4e57c Mon Sep 17 00:00:00 2001 From: arphaman Date: Wed, 11 Sep 2013 10:48:06 +0100 Subject: added parsing for structure components --- test/Sema/type.f95 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/Sema/type.f95 b/test/Sema/type.f95 index de2160ab3a..d140df399a 100644 --- a/test/Sema/type.f95 +++ b/test/Sema/type.f95 @@ -1,4 +1,6 @@ ! RUN: %flang -verify -fsyntax-only < %s +! RUN: %flang -fsyntax-only -verify -ast-print %s 2>&1 | %file_check %s + PROGRAM typetest INTEGER Bar ! expected-note {{previous definition is here}} @@ -32,11 +34,13 @@ PROGRAM typetest type(Point) p type(Triangle) tri integer i + character c type(zzzzz) zvar ! expected-error {{use of undeclared identifier 'zzzzz'}} type(Bar) barvar ! expected-error {{invalid type name 'bar'}} p = Point(1.0, 2.0) + p = Point(0,1) ! CHECK: point(real(0), real(1)) p = i ! expected-error {{assigning to 'type point' from incompatible type 'integer'}} i = p ! expected-error {{assigning to 'integer' from incompatible type 'type point'}} @@ -48,4 +52,14 @@ PROGRAM typetest p = Point(0.0, 1.0, 2.0) ! expected-error {{too many arguments to type constructor, expected 2, have 3}} p = Point() ! expected-error {{too few arguments to type constructor, expected 2, have 0}} + i = p%x + p%y + p%x = 1.0 + p%y = p%x + tri%vertices(1) = p + p = tri%vertices(1) + tri%vertices = Point(0,0) + + i = p%z ! expected-error {{no member named 'z' in 'type point'}} + c = p%x ! expected-error {{assigning to 'character' from incompatible type 'real'}} + END PROGRAM typetest -- cgit v1.2.1