[flang] Re-enable semantics/altreturn{02,03} tests
authorLuke Ireland <luke.ireland@arm.com>
Fri, 21 Feb 2020 12:28:58 +0000 (12:28 +0000)
committerLuke Ireland <luke.ireland@arm.com>
Fri, 13 Mar 2020 11:58:11 +0000 (11:58 +0000)
These tests were disabled due to https://github.com/flang-compiler/f18/issues/407.
Previously these tests caused F18 to crash as the feature was not fully
implemented.

The altreturn feature is now implemented, so these tests can be
re-enabled. altreturn03 tested some negative cases which F18 correctly
diagnoses. Modified that test to expect these new error messages. Also
make the later cases in the test reachable.

These tests can now be ported by the script to lit-style tests.

Change-Id: Ib336c10d55068d9a26fc2deb43ad052e74e73456

Original-commit: flang-compiler/f18@4de19d7ba2df892ce4361461841c3997de439532
Reviewed-on: https://github.com/flang-compiler/f18/pull/1027
Tree-same-pre-rewrite: false

flang/test/Semantics/CMakeLists.txt
flang/test/Semantics/altreturn03.f90

index 7c826d8..a241087 100644 (file)
@@ -131,9 +131,8 @@ set(ERROR_TESTS
   deallocate05.f90
   coarrays01.f90
   altreturn01.f90
-# Issue 407
-#  altreturn02.f90
-#  altreturn03.f90
+  altreturn02.f90
+  altreturn03.f90
   altreturn04.f90
   altreturn05.f90
   allocate01.f90
index 9873fb8..15410e7 100644 (file)
@@ -8,11 +8,14 @@
        IF ( N .EQ. 1 ) RETURN 1
        IF ( N .EQ. 2 ) RETURN 2
        IF ( N .EQ. 3 ) RETURN 3
-       IF ( N .EQ. 3 ) RETURN N
-       IF ( N .EQ. 3 ) RETURN N * N
-       IF ( N .EQ. 3 ) RETURN B(N)
-       IF ( N .EQ. 3 ) RETURN B
-       IF ( N .EQ. 3 ) RETURN R
-       IF ( N .EQ. 3 ) RETURN Z
+       IF ( N .EQ. 4 ) RETURN N
+       IF ( N .EQ. 5 ) RETURN N * N
+       IF ( N .EQ. 6 ) RETURN B(N)
+       !ERROR: Must be a scalar value, but is a rank-1 array
+       IF ( N .EQ. 7 ) RETURN B
+       !ERROR: Must have INTEGER type, but is REAL(4)
+       IF ( N .EQ. 8 ) RETURN R
+       !ERROR: Must have INTEGER type, but is COMPLEX(4)
+       IF ( N .EQ. 9 ) RETURN Z
        RETURN 2
        END