| 1 |
/* { dg-do run } */ |
| 2 |
|
| 3 |
#include <stdio.h> |
| 4 |
|
| 5 |
#include "init8.h" |
| 6 |
#include "dump.h" |
| 7 |
|
| 8 |
#ifdef __cplusplus |
| 9 |
extern "C" |
| 10 |
#endif |
| 11 |
void abort (void); |
| 12 |
|
| 13 |
int main (void) |
| 14 |
{ |
| 15 |
struct R1 A1 = My_R1; |
| 16 |
struct R1 B1 = My_R1; |
| 17 |
|
| 18 |
struct R2 A2 = My_R2; |
| 19 |
struct R2 B2 = My_R2; |
| 20 |
|
| 21 |
put ("A1 :"); |
| 22 |
dump (&A1, sizeof (struct R1)); |
| 23 |
new_line (); |
| 24 |
/* { dg-output "A1 : 78 56 34 12 00 ab 00 12 00 cd 00 34 00 ef 00 56.*\n" } */ |
| 25 |
|
| 26 |
put ("B1 :"); |
| 27 |
dump (&B1, sizeof (struct R1)); |
| 28 |
new_line (); |
| 29 |
/* { dg-output "B1 : 78 56 34 12 00 ab 00 12 00 cd 00 34 00 ef 00 56.*\n" } */ |
| 30 |
|
| 31 |
put ("A2 :"); |
| 32 |
dump (&A2, sizeof (struct R2)); |
| 33 |
new_line (); |
| 34 |
/* { dg-output "A2 : 12 34 56 78 12 00 ab 00 34 00 cd 00 56 00 ef 00.*\n" } */ |
| 35 |
|
| 36 |
put ("B2 :"); |
| 37 |
dump (&B2, sizeof (struct R2)); |
| 38 |
new_line (); |
| 39 |
/* { dg-output "B2 : 12 34 56 78 12 00 ab 00 34 00 cd 00 56 00 ef 00.*\n" } */ |
| 40 |
|
| 41 |
if (A1.I != B1.I || A1.N.C1 != B1.N.C1) abort(); |
| 42 |
|
| 43 |
if (A2.I != B2.I || A2.N.C1 != B2.N.C1) abort (); |
| 44 |
|
| 45 |
new_line (); |
| 46 |
return 0; |
| 47 |
} |