| 1 |
/* CTF generation for functions with varargs or otherwise. |
| 2 |
|
| 3 |
In this testcase, it is expected to see one CTF_K_FUNCTION record with two |
| 4 |
function arguments. The second function argument with a value of 0 |
| 5 |
corresponds to the ellipsis. |
| 6 |
|
| 7 |
Example CTF section excerpt on x86_64 : |
| 8 |
|
| 9 |
.long 0x5 # ctt_name (name = format) |
| 10 |
.long 0x16000002 # ctt_info (CTF_K_FUNCTION with 2 arguments) |
| 11 |
.long 0x2 # ctt_size or ctt_type (return typeID) |
| 12 |
.long 0x2 # dtu_argv (TypeID of the First argument) |
| 13 |
.long 0 # dtu_argv (TypeID of the second argument) |
| 14 |
.ascii "\0" # ctf_string |
| 15 |
.ascii "int\0" # ctf_string |
| 16 |
.ascii "format\0" # ctf_string |
| 17 |
|
| 18 |
*/ |
| 19 |
|
| 20 |
/* { dg-do compile } */ |
| 21 |
/* { dg-options "-O0 -gctf -dA" } */ |
| 22 |
|
| 23 |
/* { dg-final { scan-assembler-times "\[\t \]0x16000002\[\t \]+\[^\n\]*ctt_info" 1 } } */ |
| 24 |
/* { dg-final { scan-assembler-times "dtu_argv" 2 } } */ |
| 25 |
/* { dg-final { scan-assembler-times "\[\t \]0\[\t \]+\[^\n\]*dtu_argv" 1 } } */ |
| 26 |
|
| 27 |
int foo (void); |
| 28 |
|
| 29 |
int bar (int); |
| 30 |
|
| 31 |
int * format (int * fmt, ...) |
| 32 |
{ |
| 33 |
return fmt; |
| 34 |
} |