annotate run/creal_13.d @ 1597:8b9d4d2f925a

Fix typos in complex tests. See D bug 614.
author Christian Kamm <kamm incasoftware de>
date Tue, 09 Sep 2008 16:53:58 +0200
parents 5511f9277078
children 56d43974b468
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
374
f87ba6507260 added missing meta-data
thomask
parents: 97
diff changeset
1 // $HeadURL$
f87ba6507260 added missing meta-data
thomask
parents: 97
diff changeset
2 // $Date$
f87ba6507260 added missing meta-data
thomask
parents: 97
diff changeset
3 // $Author$
f87ba6507260 added missing meta-data
thomask
parents: 97
diff changeset
4
95
f4dcf89f7796 extended creal tests
thomask
parents:
diff changeset
5 module dstress.run.creal_13;
f4dcf89f7796 extended creal tests
thomask
parents:
diff changeset
6
f4dcf89f7796 extended creal tests
thomask
parents:
diff changeset
7 int main(){
528
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
8 creal a;
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
9 creal b;
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
10 byte* X = cast(byte*)(cast(void*)&a);
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
11
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
12 b = real.init + ireal.init;
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
13 byte* Y = cast(byte*)(cast(void*)&b);
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
14
920
5511f9277078 testcase review
thomask
parents: 528
diff changeset
15 for(size_t i=0; i<a.sizeof; i++){
528
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
16 assert(X[i]==Y[i]);
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
17 }
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
18
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
19 real c;
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
20 real d=a.re;
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
21 X = cast(byte*)(cast(void*)&c);
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
22 Y = cast(byte*)(cast(void*)&d);
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
23
920
5511f9277078 testcase review
thomask
parents: 528
diff changeset
24 for(size_t i=0; i<c.sizeof; i++){
528
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
25 assert(X[i]==Y[i]);
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
26 }
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
27
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
28 d=a.im;
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
29 X = cast(byte*)(cast(void*)&c);
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
30 Y = cast(byte*)(cast(void*)&d);
920
5511f9277078 testcase review
thomask
parents: 528
diff changeset
31 for(size_t i=0; i<c.sizeof; i++){
528
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
32 assert(X[i]==Y[i]);
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
33 }
9e0847cf535a pre DMD-0.123 review
thomask
parents: 374
diff changeset
34
95
f4dcf89f7796 extended creal tests
thomask
parents:
diff changeset
35 return 0;
f4dcf89f7796 extended creal tests
thomask
parents:
diff changeset
36 }