| 1 |
/* CTF forward type is generated for forward declarations of types in C. |
| 2 |
|
| 3 |
Check that the ctf-kind of CTF_K_FOWARD type is CTF_K_STRUCT or CTF_K_UNION. |
| 4 |
For forward types, the compiler encodes the CTF kind in the ctt_type field. |
| 5 |
CTF_K_FORWARD is used as the CTF type as usual in the ctt_info. */ |
| 6 |
|
| 7 |
/* Note - A value of 6 in "ctt_size or ctt_type" appears twice in this |
| 8 |
testcase. This might be misconstrued as 2 CTK_K_FORWARD records of struct |
| 9 |
type. The second assembler tag is due to a ref type in a CVR CTF record. |
| 10 |
TBD - perhaps a more robust string pattern is needed. */ |
| 11 |
|
| 12 |
/* { dg-do compile } */ |
| 13 |
/* { dg-options "-O0 -gctf -dA" } */ |
| 14 |
|
| 15 |
/* { dg-final { scan-assembler-times "\[\t \]0x26000000\[\t \]+\[^\n\]*ctt_info" 2 } } */ |
| 16 |
/* { dg-final { scan-assembler-times "\[\t \]0x6\[\t \]+\[^\n\]*ctt_size or ctt_type" 2 } } */ |
| 17 |
/* { dg-final { scan-assembler-times "\[\t \]0x7\[\t \]+\[^\n\]*ctt_size or ctt_type" 2 } } */ |
| 18 |
|
| 19 |
typedef struct __locale_struct |
| 20 |
{ |
| 21 |
struct __locale_data *__locales[13]; /* forward struct type. */ |
| 22 |
|
| 23 |
const int *__ctype_toupper; |
| 24 |
const char *__names[13]; |
| 25 |
} *__locale_t; |
| 26 |
|
| 27 |
typedef __locale_t locale_t; |
| 28 |
|
| 29 |
locale_t loc; |
| 30 |
|
| 31 |
typedef struct __inter_struct |
| 32 |
{ |
| 33 |
union __inter_data * __inters[13]; /* forward union type. */ |
| 34 |
|
| 35 |
const int * __ctype_kind; |
| 36 |
} * __inter_t; |
| 37 |
|
| 38 |
typedef __inter_t inter_t; |
| 39 |
|
| 40 |
inter_t inter; |