1 /* { dg-do run } */
2 
3 #include <stdio.h>
4 
5 #include "init2.h"
6 #include "dump.h"
7 
main(void)8 int main (void)
9 {
10   struct R1 Local_R1;
11   struct R2 Local_R2;
12 
13   put ("My_R1    :");
14   dump (&My_R1, sizeof (struct R1));
15   new_line ();
16   /* { dg-output "My_R1    : e2 59 d1 48 b4 aa d9 bb.*\n" } */
17 
18   put ("My_R2    :");
19   dump (&My_R2, sizeof (struct R2));
20   new_line ();
21   /* { dg-output "My_R2    : 84 8d 15 9e 15 5b 35 df.*\n" } */
22 
23   Local_R1 = My_R1;
24   put ("Local_R1 :");
25   dump (&Local_R1, sizeof (struct R1));
26   new_line ();
27   /* { dg-output "Local_R1 : e2 59 d1 48 b4 aa d9 bb.*\n" } */
28 
29   Local_R2 = My_R2;
30   put ("Local_R2 :");
31   dump (&Local_R2, sizeof (struct R2));
32   new_line ();
33   /* { dg-output "Local_R2 : 84 8d 15 9e 15 5b 35 df.*\n" } */
34 
35   Local_R1.S1 = 2;
36   Local_R1.I  = 0x12345678;
37   Local_R1.S2 = 1;
38   Local_R1.A1 = 0xAB;
39   Local_R1.A2 = 0xCD;
40   Local_R1.A3 = 0xEF;
41   Local_R1.B  = 1;
42 
43   put ("Local_R1 :");
44   dump (&Local_R1, sizeof (struct R1));
45   new_line ();
46   /* { dg-output "Local_R1 : e2 59 d1 48 b4 aa d9 bb.*\n" } */
47 
48   Local_R2.S1 = 2;
49   Local_R2.I  = 0x12345678;
50   Local_R2.S2 = 1;
51   Local_R2.A1 = 0xAB;
52   Local_R2.A2 = 0xCD;
53   Local_R2.A3 = 0xEF;
54   Local_R2.B  = 1;
55 
56   put ("Local_R2 :");
57   dump (&Local_R2, sizeof (struct R2));
58   new_line ();
59   /* { dg-output "Local_R2 : 84 8d 15 9e 15 5b 35 df.*\n" } */
60 
61   Local_R1.S1 = Local_R2.S1;
62   Local_R1.I  = Local_R2.I;
63   Local_R1.S2 = Local_R2.S2;
64   Local_R1.A1 = Local_R2.A1;
65   Local_R1.A2 = Local_R2.A2;
66   Local_R1.A3 = Local_R2.A3;
67   Local_R1.B  = Local_R2.B;
68 
69   put ("Local_R1 :");
70   dump (&Local_R1, sizeof (struct R1));
71   new_line ();
72   /* { dg-output "Local_R1 : e2 59 d1 48 b4 aa d9 bb.*\n" } */
73 
74   Local_R2.S1 = Local_R1.S1;
75   Local_R2.I  = Local_R1.I;
76   Local_R2.S2 = Local_R1.S2;
77   Local_R2.A1 = Local_R1.A1;
78   Local_R2.A2 = Local_R1.A2;
79   Local_R2.A3 = Local_R1.A3;
80   Local_R2.B  = Local_R1.B;
81 
82   put ("Local_R2 :");
83   dump (&Local_R2, sizeof (struct R2));
84   new_line ();
85   /* { dg-output "Local_R2 : 84 8d 15 9e 15 5b 35 df.*\n" } */
86 
87   new_line ();
88   return 0;
89 }
90