summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorarphaman <arphaman@gmail.com>2013-09-08 18:57:41 +0100
committerarphaman <arphaman@gmail.com>2013-09-08 18:57:41 +0100
commit4a3b07263c53885cfee0a528f798f1a0cdb0c3ac (patch)
tree0d20671f369849a3ba586379da9d0e517428068b /test
parent986509873c206cfce542dbc89e23dbaea10dcbf6 (diff)
downloadflang-4a3b07263c53885cfee0a528f798f1a0cdb0c3ac.tar.gz
started parsing and sema for type declarations
Diffstat (limited to 'test')
-rw-r--r--test/Parser/type.f956
-rw-r--r--test/Sema/type.f9516
2 files changed, 21 insertions, 1 deletions
diff --git a/test/Parser/type.f95 b/test/Parser/type.f95
index 092f1b31b7..8cf7410fdc 100644
--- a/test/Parser/type.f95
+++ b/test/Parser/type.f95
@@ -1,6 +1,10 @@
-! RUN: %flang -fsyntax-only < %s
+! RUN: %flang -verify -fsyntax-only < %s
PROGRAM typetest
TYPE Point
REAL X, Y
END TYPE Point
+
+ TYPE foo 22 ! expected-error {{expected line break or ';' at end of statement}}
+ INTEGER K
+ END TYPE
END PROGRAM typetest
diff --git a/test/Sema/type.f95 b/test/Sema/type.f95
new file mode 100644
index 0000000000..43d9188139
--- /dev/null
+++ b/test/Sema/type.f95
@@ -0,0 +1,16 @@
+! RUN: %flang -verify -fsyntax-only < %s
+PROGRAM typetest
+
+ INTEGER Bar ! expected-note {{previous definition is here}}
+ TYPE Point
+ REAL X, Y
+ END TYPE Point
+
+ TYPE foo
+ INTEGER K
+ END TYPE bar ! expected-error {{expected type name 'foo'}}
+
+ type Bar ! expected-error {{redefinition of 'bar'}}
+ real x
+ endtype
+END PROGRAM typetest