1 /* { dg-do compile { target *-*-darwin* } } */
2 /* { dg-options "-O0 -gdwarf-2 -dA" } */
3 /* { dg-skip-if "Unmatchable assembly" { mmix-*-* } } */
4 /* { dg-final { scan-assembler "__debug_pubtypes" } } */
5 /* { dg-final { scan-assembler "long+\[ \t\]+0x165+\[ \t\]+\[#;]+\[ \t\]+Pub Info Length" } } */
6 /* { dg-final { scan-assembler "used_struct\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
7 /* { dg-final { scan-assembler-not "unused_struct\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
8 /* { dg-final { scan-assembler "\"list_name_type\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
9 /* { dg-final { scan-assembler "\"enum_list_array\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
10 /* { dg-final { scan-assembler "\"field_union\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
35 struct unused_struct
*next
;
45 typedef enum list_name_type
*enum_list_array
;
47 enum_list_array enum_list
;
50 foo (struct used_struct
*list
)
56 enum_list
= (enum_list_array
) malloc (10 * sizeof (enum list_name_type
));
58 for (i
= 0; i
< 10; i
++)
60 if (strncmp (list
[i
].name
, "Alice", 5) == 0)
62 enum_list
[i
] = girl_name
;
65 else if (strncmp (list
[i
].name
, "David", 5) == 0)
67 enum_list
[i
] = boy_name
;
71 enum_list
[i
] = unknown
;
77 main (int argc
, char **argv
)
80 struct used_struct
*my_list
;
82 my_list
= (struct used_struct
*) malloc (10 * sizeof (struct used_struct
));
84 for (i
= 0; i
< 10; i
++)
87 my_list
[i
].name
= (char *) malloc (11);
88 sprintf (my_list
[i
].name
, "Alice_%d", i
);
93 for (i
= 0; i
< 10; i
++)
94 fprintf (stdout
, "Key: %d, Name: %s\n", my_list
[i
].key
, my_list
[i
].name
);