diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/debug/ctf/ctf-variables-3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/ctf/ctf-variables-3.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/debug/ctf/ctf-variables-3.c b/gcc/testsuite/gcc.dg/debug/ctf/ctf-variables-3.c new file mode 100644 index 00000000000..8aea1e82749 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/ctf/ctf-variables-3.c @@ -0,0 +1,22 @@ +/* CTF generation for extern variable with defining and non-defining decl + in the same CU. + + This testcase checks the case when a non-defining decl is followed by + a defining decl for the same variable. See PR debug/105089. + + In this testcase, although two CTF array types are generated, only a + single CTF variable and a single entry in the CTF object info section + are expected. */ + +/* { dg-do compile ) */ +/* { dg-options "-O0 -gctf -dA" } */ + +/* { dg-final { scan-assembler-times "0x12000000\[\t \]+\[^\n\]*ctt_info" 2 } } */ + +/* { dg-final { scan-assembler-times "\[\t \]0\[\t \]+\[^\n\]*cta_nelems" 1 } } */ +/* { dg-final { scan-assembler-times "\[\t \]0x8\[\t \]+\[^\n\]*cta_nelems" 1 } } */ +/* { dg-final { scan-assembler-times "ctv_name" 1 } } */ +/* { dg-final { scan-assembler-times "objtinfo_var_type" 1 } } */ + +extern const char _CTF_NEWSTR[]; +const char _CTF_NEWSTR[] = "ctfinfo"; |