| 1 |
/* CTF generation for array type. |
| 2 |
|
| 3 |
Unsized arrays are encoded with a 0 for the number of elements. |
| 4 |
|
| 5 |
In this testcase, 5 distinct CTF records for arrays are expected |
| 6 |
b1 : cta_nelems = 2 |
| 7 |
c1 : cta_nelems = 3 |
| 8 |
a1 : cta_nelems = 2, 5 |
| 9 |
buf : cta_nelems = 0. */ |
| 10 |
|
| 11 |
/* { dg-do compile } */ |
| 12 |
/* { dg-options "-O0 -gctf -dA" } */ |
| 13 |
|
| 14 |
/* { dg-final { scan-assembler-times "0x12000000\[\t \]+\[^\n\]*ctt_info" 5 } } */ |
| 15 |
|
| 16 |
/* { dg-final { scan-assembler-times "\[\t \]0x2\[\t \]+\[^\n\]*cta_nelems" 2 } } */ |
| 17 |
/* { dg-final { scan-assembler-times "\[\t \]0x3\[\t \]+\[^\n\]*cta_nelems" 1 } } */ |
| 18 |
/* { dg-final { scan-assembler-times "\[\t \]0x5\[\t \]+\[^\n\]*cta_nelems" 1 } } */ |
| 19 |
/* { dg-final { scan-assembler-times "\[\t \]0\[\t \]+\[^\n\]*cta_nelems" 1 } } */ |
| 20 |
|
| 21 |
int b1[2] = {0,1}; |
| 22 |
int c1[5] = {0,1,2,3,4}; |
| 23 |
int a1[2][3] = { {3,4,5}, {2,3,4} }; |
| 24 |
|
| 25 |
/* Variable length struct using arrays. */ |
| 26 |
struct my_array |
| 27 |
{ |
| 28 |
int flags; |
| 29 |
int length; |
| 30 |
int buf[]; |
| 31 |
} my_array_obj; |