summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg
diff options
context:
space:
mode:
authorkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-05 22:16:41 +0000
committerkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-05 22:16:41 +0000
commit6003287601f491b20444ab3bcdc17ed6dec1f63c (patch)
tree0999f8686d5ab706f2cfcdce52a41c2e24d77f38 /gcc/testsuite/gfortran.dg
parente0cf8f9cd292491edaf60974c49d9fc6a1eb0395 (diff)
downloadgcc-6003287601f491b20444ab3bcdc17ed6dec1f63c.tar.gz
* PR19754_1.f90: New test.
* PR19754_2.f90: ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95946 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r--gcc/testsuite/gfortran.dg/PR19754_1.f909
-rw-r--r--gcc/testsuite/gfortran.dg/PR19754_2.f9022
2 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/PR19754_1.f90 b/gcc/testsuite/gfortran.dg/PR19754_1.f90
new file mode 100644
index 00000000000..b554d1094c5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/PR19754_1.f90
@@ -0,0 +1,9 @@
+! { dg-do compile }
+! Test of fix to PR19754
+program PR19754_1
+ real x(3,3),y(2,2)
+ x = 1.
+ y = 2.
+ x = x + y ! { dg-error "Shapes for operands at" }
+end program PR19754_1
+
diff --git a/gcc/testsuite/gfortran.dg/PR19754_2.f90 b/gcc/testsuite/gfortran.dg/PR19754_2.f90
new file mode 100644
index 00000000000..9b71bd02ba0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/PR19754_2.f90
@@ -0,0 +1,22 @@
+! { dg-do run }
+! Test of Steve Kargl's fix to PR19754
+! This exercises bugs that the original patch caused
+!
+program PR19754_2
+ real a(2,2), b(2,2),c(2,2),d(2,2)
+ integer i(2,2),j(2,2),k(2,2)
+ a = 1. ; b = 2. ; i = 4
+ c = b - floor( a / b ) ! this caused an ICE
+ d = b - real(floor( a / b ))
+ if (any (c/=d)) call abort ()
+ j = aint(b) - floor( a / b ) ! this caused an ICE
+ if (any(real(j)/=d)) call abort ()
+ c = i
+ if (any(real(i)/=c)) call abort ()
+ c = i + b ! this caused an ICE
+ d = real(i) + b
+ if (any(c/=d)) call abort ()
+ j = i + aint (a)
+ k = i + a ! this caused an ICE
+ if (any(j/=k)) call abort ()
+end program PR19754_2