summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/logint-2.f
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-01 19:17:37 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-01 19:17:37 +0000
commitebcbc3356a31213c614cd9067a88d7b42eebe9ec (patch)
treeaca5715d2e2402e23f8d6fcb8a69bdb7516dab2e /gcc/testsuite/gfortran.dg/logint-2.f
parentb012e613100d33f9621f1a9594086450864cad13 (diff)
downloadgcc-ebcbc3356a31213c614cd9067a88d7b42eebe9ec.tar.gz
* intrinsic.c (add_conv): No longer take a "simplify" argument as
its always gfc_convert_constant, instead take a "standard" argument. (add_conversions): Change all existing calls of add_conv to pass GFC_STD_F77 as appropriate. Additionally, if we're allowing GNU extensions support integer-logical and logical-integer conversions. (gfc_convert_type_warn): Warn about use the use of these conversions as a extension when appropriate, i.e. with -pedantic. * simplify.c (gfc_convert_constant): Add support for integer to logical and logical to integer conversions, using gfc_int2log and gfc_log2int. * arith.c (gfc_log2int, gfc_int2log): New functions. * arith.h (gfc_log2int, gfc_int2log): Prototype here. * gfortran.texi: Document this new GNU extension. * gfortran.dg/logint-1.f: New test case. * gfortran.dg/logint-2.f: Likewise. * gfortran.dg/logint-3.f: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100461 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg/logint-2.f')
-rw-r--r--gcc/testsuite/gfortran.dg/logint-2.f43
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/logint-2.f b/gcc/testsuite/gfortran.dg/logint-2.f
new file mode 100644
index 00000000000..a5fcf230a91
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/logint-2.f
@@ -0,0 +1,43 @@
+c { dg-do compile }
+c { dg-options "-O2 -std=f95" }
+ LOGICAL*1 l1
+ LOGICAL*2 l2
+ LOGICAL*4 l4
+ INTEGER*1 i1
+ INTEGER*2 i2
+ INTEGER*4 i4
+
+ i1 = .TRUE. ! { dg-error "convert" }
+ i2 = .TRUE. ! { dg-error "convert" }
+ i4 = .TRUE. ! { dg-error "convert" }
+
+ i1 = .FALSE. ! { dg-error "convert" }
+ i2 = .FALSE. ! { dg-error "convert" }
+ i4 = .FALSE. ! { dg-error "convert" }
+
+ i1 = l1 ! { dg-error "convert" }
+ i2 = l1 ! { dg-error "convert" }
+ i4 = l1 ! { dg-error "convert" }
+
+ i1 = l2 ! { dg-error "convert" }
+ i2 = l2 ! { dg-error "convert" }
+ i4 = l2 ! { dg-error "convert" }
+
+ i1 = l4 ! { dg-error "convert" }
+ i2 = l4 ! { dg-error "convert" }
+ i4 = l4 ! { dg-error "convert" }
+
+ l1 = i1 ! { dg-error "convert" }
+ l2 = i1 ! { dg-error "convert" }
+ l4 = i1 ! { dg-error "convert" }
+
+ l1 = i2 ! { dg-error "convert" }
+ l2 = i2 ! { dg-error "convert" }
+ l4 = i2 ! { dg-error "convert" }
+
+ l1 = i4 ! { dg-error "convert" }
+ l2 = i4 ! { dg-error "convert" }
+ l4 = i4 ! { dg-error "convert" }
+
+ END
+