summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorarphaman <arphaman@gmail.com>2013-08-09 10:08:03 +0100
committerarphaman <arphaman@gmail.com>2013-08-09 10:08:03 +0100
commit14ce2ed4387161a94cf8c8a1799b25a759f15722 (patch)
treecf5d74cfb308a384113a3fb141b83bf23c83895c /test
parentb1d39d5fd112b6939050464a7f12b0d5c87b24fb (diff)
downloadflang-14ce2ed4387161a94cf8c8a1799b25a759f15722.tar.gz
started sema for EQUIVALENCE stmt
Diffstat (limited to 'test')
-rw-r--r--test/Sema/equivalence.f9524
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Sema/equivalence.f95 b/test/Sema/equivalence.f95
new file mode 100644
index 0000000000..8c30e80928
--- /dev/null
+++ b/test/Sema/equivalence.f95
@@ -0,0 +1,24 @@
+! RUN: %flang -verify -fsyntax-only < %s
+
+SUBROUTINE equivtest(JJ) ! expected-note {{'jj' is an argument defined here}}
+ REAL A, B
+ EQUIVALENCE (A,B)
+ INTEGER I, J, JJ, K, M, N, O(3)
+ CHARACTER STR*10
+ INTEGER(Kind=8) FOO
+ PARAMETER(II = 111) ! expected-note {{'ii' is a parameter constant defined here}}
+ EQUIVALENCE (A, I), (B, K)
+
+ EQUIVALENCE (I, O(1))
+ EQUIVALENCE (N, O(I)) ! expected-error {{statement requires a constant expression}}
+
+ EQUIVALENCE (II, I) ! expected-error {{specification statement requires a local variable}}
+ EQUIVALENCE (I, jj) ! expected-error {{specification statement requires a local variable}}
+
+ EQUIVALENCE (I, 22) ! expected-error {{specification statement requires a variable or an array element expression}}
+
+ EQUIVALENCE (I, STR) ! expected-error {{expected an expression of integer, real, complex or logical type ('character (Len=10)' invalid)}}
+ EQUIVALENCE (STR, A) ! expected-error {{expected an expression of character type ('real' invalid)}}
+ EQUIVALENCE (I, FOO) ! expected-error {{expected an expression with default type kind ('integer (Kind=8)' invalid)}}
+
+END