diff options
author | arphaman <arphaman@gmail.com> | 2013-09-13 13:44:56 +0100 |
---|---|---|
committer | arphaman <arphaman@gmail.com> | 2013-09-13 13:44:56 +0100 |
commit | f4debe09e4275ff0c2d046b1d6c029ff265578d4 (patch) | |
tree | d959fa1338e26af030565f12a4aae2aa10047157 | |
parent | b91022b3f88ebedd2e405857862b11f0d26ad489 (diff) | |
download | flang-f4debe09e4275ff0c2d046b1d6c029ff265578d4.tar.gz |
added test for aggregate initialization
-rw-r--r-- | test/CodeGen/type.f95 | 13 | ||||
-rw-r--r-- | test/CodeGenInAction/data.f95 | 9 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGen/type.f95 b/test/CodeGen/type.f95 index 8c7b1221a9..b9d04b4cfc 100644 --- a/test/CodeGen/type.f95 +++ b/test/CodeGen/type.f95 @@ -28,3 +28,16 @@ program typeTest t%color = 0 end program + +subroutine foo + + type Point + real x,y + end type + + type(Point) p1, p2 + + data p1 / Point(1, 2) / ! CHECK: store { float, float } + data p2%x, p2%y / 2.0, 4.0 / ! CHECK: store { float, float } + +end diff --git a/test/CodeGenInAction/data.f95 b/test/CodeGenInAction/data.f95 index 67e59ff72b..e2b7c3f994 100644 --- a/test/CodeGenInAction/data.f95 +++ b/test/CodeGenInAction/data.f95 @@ -22,6 +22,12 @@ program datatest data strArr2(2)(2:4) / '+' / data (strArr2(i), i = 3,3) / 'funke' / + type point + integer x,y + end type + type(point) p1, p2 + + data p1 / Point(-1,1) / p2%x, p2%y / 13, 42 / print *, 'START' ! CHECK: START print *, i ! CHECK-NEXT: 1 @@ -45,4 +51,7 @@ program datatest print *, strArr2(2) ! CHECK-NEXT: + print *, strArr2(3) ! CHECK-NEXT: funke + print *, p1%x, ', ', p1%y ! CHECK-NEXT: -1, 1 + print *, p2%x, ', ', p2%y ! CHECK-NEXT: 13, 42 + end program |