summaryrefslogtreecommitdiff
path: root/test/CodeGenInAction/arrayAssignment.f95
diff options
context:
space:
mode:
authorarphaman <arphaman@gmail.com>2013-08-31 13:27:48 +0100
committerarphaman <arphaman@gmail.com>2013-08-31 13:28:12 +0100
commite42579c1835162d7d82ab7a973049c8753f76a2b (patch)
tree1c40028d77fba78aacd2ad6539b975bb8476a37a /test/CodeGenInAction/arrayAssignment.f95
parent3e049f0a6c78958b355dc96fbc050cf621180aa4 (diff)
downloadflang-e42579c1835162d7d82ab7a973049c8753f76a2b.tar.gz
fixed codegen for array assignment implicit conversions
Diffstat (limited to 'test/CodeGenInAction/arrayAssignment.f95')
-rw-r--r--test/CodeGenInAction/arrayAssignment.f9516
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGenInAction/arrayAssignment.f95 b/test/CodeGenInAction/arrayAssignment.f95
index 3ec5d1be54..fe65b8bc28 100644
--- a/test/CodeGenInAction/arrayAssignment.f95
+++ b/test/CodeGenInAction/arrayAssignment.f95
@@ -9,6 +9,7 @@ end
program test
integer i_mat(3,3), i_mat2(3,3)
+ real r_mat(3,3)
integer i
data i_mat2 / 1, 0, 0, 0, 1, 0, 0, 0, 1 /
@@ -32,4 +33,19 @@ program test
i_mat(1,3), ', ', i_mat(2,3), ', ', i_mat(3,3)
continue ! CHECK-NEXT: 1, 0, 0, 0, 1, 0, 0, 0, 1
+ i_mat = 1.0
+ print *, i_mat(1,1), ', ', i_mat(2,1), ', ', i_mat(3,1), ', ', &
+ i_mat(1,2), ', ', i_mat(2,2), ', ', i_mat(3,2), ', ', &
+ i_mat(1,3), ', ', i_mat(2,3), ', ', i_mat(3,3)
+ continue ! CHECK-NEXT: 1, 1, 1, 1, 1, 1, 1, 1, 1
+
+ r_mat = 2.0
+ r_mat(1,1) = 3.0
+ r_mat(2,2) = 4.0
+ i_mat = r_mat
+ print *, i_mat(1,1), ', ', i_mat(2,1), ', ', i_mat(3,1), ', ', &
+ i_mat(1,2), ', ', i_mat(2,2), ', ', i_mat(3,2), ', ', &
+ i_mat(1,3), ', ', i_mat(2,3), ', ', i_mat(3,3)
+ continue ! CHECK-NEXT: 3, 2, 2, 2, 4, 2, 2, 2, 2
+
end