annotate run/align_07.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 ec5e144583ea
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
374
f87ba6507260 added missing meta-data
thomask
parents: 60
diff changeset
1 // $HeadURL$
f87ba6507260 added missing meta-data
thomask
parents: 60
diff changeset
2 // $Date$
f87ba6507260 added missing meta-data
thomask
parents: 60
diff changeset
3 // $Author$
f87ba6507260 added missing meta-data
thomask
parents: 60
diff changeset
4
60
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
5 // copied from gcc-3.4.2/gcc/testsuite/gcc.c-torture/execute/align-2.c
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
6 module dstress.run.align_07;
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
7
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
8 /* Simple alignment checks;
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
9 looking for compiler/assembler alignment disagreements,
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
10 agreement between struct initialization and access. */
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
11
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
12 struct a_short { char c; short s; }
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
13 static a_short s_c_s = { 'a', 13 };
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
14
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
15 struct a_int { char c ; int i; }
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
16 static a_int s_c_i = { 'b', 14 };
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
17
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
18 struct b_int { short s; int i; }
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
19 b_int s_s_i = { 15, 16 };
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
20
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
21 struct a_float { char c; float f; }
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
22 a_float s_c_f = { 'c', 17.0 };
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
23
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
24 struct b_float { short s; float f; }
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
25 b_float s_s_f = { 18, 19.0 };
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
26
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
27 struct a_double { char c; double d; }
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
28 a_double s_c_d = { 'd', 20.0 };
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
29
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
30 struct b_double { short s; double d; }
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
31 b_double s_s_d = { 21, 22.0 };
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
32
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
33 struct c_double { int i; double d; }
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
34 c_double s_i_d = { 23, 24.0 };
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
35
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
36 struct d_double { float f; double d; }
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
37 d_double s_f_d = { 25.0, 26.0 };
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
38
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
39 struct a_real { char c; real ld; }
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
40 a_real s_c_ld = { 'e', 27.0 };
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
41
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
42 struct b_real { short s; real ld; }
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
43 b_real s_s_ld = { 28, 29.0 };
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
44
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
45 struct c_real { int i; real ld; }
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
46 c_real s_i_ld = { 30, 31.0 };
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
47
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
48 struct d_real { float f; real ld; }
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
49 d_real s_f_ld = { 32.0, 33.0 };
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
50
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
51 struct e_real { double d; real ld; }
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
52 e_real s_d_ld = { 34.0, 35.0 };
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
53
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
54 int main (){
1559
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
55 if('a' != s_c_s.c){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
56 if(13 != s_c_s.s){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
57 if('b' != s_c_i.c){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
58 if(14 != s_c_i.i){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
59 if(15 != s_s_i.s){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
60 if(16 != s_s_i.i){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
61 if('c' != s_c_f.c){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
62 if(17.0 != s_c_f.f){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
63 if(18 != s_s_f.s){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
64 if(19.0 != s_s_f.f){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
65 if('d' != s_c_d.c){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
66 if(20.0 != s_c_d.d){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
67 if(21 != s_s_d.s){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
68 if(22.0 != s_s_d.d){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
69 if(23 != s_i_d.i){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
70 if(24.0 != s_i_d.d){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
71 if(25.0 != s_f_d.f){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
72 if(26.0 != s_f_d.d){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
73 if('e' != s_c_ld.c){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
74 if(27.0 != s_c_ld.ld){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
75 if(28 != s_s_ld.s){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
76 if(29.0 != s_s_ld.ld){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
77 if(30 != s_i_ld.i){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
78 if(31.0 != s_i_ld.ld){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
79 if(32.0 != s_f_ld.f){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
80 if(33.0 != s_f_ld.ld){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
81 if(34.0 != s_d_ld.d){ assert(0); }
ec5e144583ea D1 -> D2 : 1/N
thomask
parents: 374
diff changeset
82 if(35.0 != s_d_ld.ld){ assert(0); }
60
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
83 return 0;
0d02c5cd0a6f added gcc's align test
thomask
parents:
diff changeset
84 }