Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / sso / r7.c
blobf9ed1c7901ec8076131764226a49568325304512
1 /* { dg-do run } */
3 #include <stdio.h>
5 #include "init7.h"
6 #include "dump.h"
8 #ifdef __cplusplus
9 extern "C"
10 #endif
11 void abort (void);
13 int Get_Elem1 (struct R1 R)
15 struct R1 Tmp = R;
16 return Tmp.N.C1;
19 void Set_Elem1 (struct R1 *R, int I)
21 struct R1 Tmp = *R;
22 Tmp.N.C1 = I;
23 *R = Tmp;
26 int Get_Elem2 (struct R2 R)
28 struct R2 Tmp = R;
29 return Tmp.N.C1;
32 void Set_Elem2 (struct R2 *R, int I)
34 struct R2 Tmp = *R;
35 Tmp.N.C1 = I;
36 *R = Tmp;
39 int main (void)
41 struct R1 A1 = My_R1;
42 struct R2 A2 = My_R2;
44 put ("A1 :");
45 dump (&A1, sizeof (struct R1));
46 new_line ();
47 /* { dg-output "A1 : 78 56 34 12 12 00 ab 00 34 00 cd 00 56 00 ef 00.*\n" } */
49 put ("A2 :");
50 dump (&A2, sizeof (struct R2));
51 new_line ();
52 /* { dg-output "A2 : 12 34 56 78 00 ab 00 12 00 cd 00 34 00 ef 00 56.*\n" } */
54 if (Get_Elem1 (A1) != 0xAB0012) abort ();
56 Set_Elem1 (&A1, 0xCD0034);
57 if (Get_Elem1 (A1) != 0xCD0034) abort ();
59 if (Get_Elem2 (A2) != 0xAB0012) abort ();
61 Set_Elem2 (&A2, 0xCD0034);
62 if (Get_Elem2 (A2) != 0xCD0034) abort ();
64 new_line ();
65 return 0;