[COMMITTED] CTF testsuite: Remove explicit check on ctv_typeidx

Indu Bhagat indu.bhagat@oracle.com
Tue Jul 6 23:08:57 GMT 2021


[Committed as obvious.]

The value of ctv_typeidx is the CTF type ID of the data type of the associated
variable.  The order in which the CTF types are added can change across
platforms and also as the code evolves, hence changing the CTF type ID. As
there is no direct and portable method of testing that the data type of a CTF
variable is of a specific kind, remove the check on ctv_typeidx.

This also fixes a subset of failures as seen on Darwin.

2021-07-06  Indu Bhagat  <indu.bhagat@oracle.com>

gcc/testsuite/ChangeLog:

	PR debug/101283
        * gcc.dg/debug/ctf/ctf-attr-mode-1.c: Remove the check for ctv_typeidx.
---
 gcc/testsuite/gcc.dg/debug/ctf/ctf-attr-mode-1.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/debug/ctf/ctf-attr-mode-1.c b/gcc/testsuite/gcc.dg/debug/ctf/ctf-attr-mode-1.c
index fc3af03..c4801a7 100644
--- a/gcc/testsuite/gcc.dg/debug/ctf/ctf-attr-mode-1.c
+++ b/gcc/testsuite/gcc.dg/debug/ctf/ctf-attr-mode-1.c
@@ -1,7 +1,10 @@
 /* Test CTF generation works well with ((mode)) attribute.
 
    In this testcase, CTF should report type of bqi to be an enum and
-   not an int.  */
+   not an int.  Also, CTF for typedef of enum should exist.  However, there
+   are no direct and portable methods of checking that a CTF type / CTF
+   variable refers to a specific CTF type, so this testcase merely asserts
+   for existence of individual CTF records.  */
 
 /* { dg-do compile )  */
 /* { dg-options "-O0 -gctf -dA" } */
@@ -16,7 +19,5 @@
 /* { dg-final { scan-assembler-times "\[\t \]0x22000003\[\t \]+\[^\n\]*ctt_info" 1 } } */
 /* { dg-final { scan-assembler-times "\[\t \]0x2a000000\[\t \]+\[^\n\]*ctt_info" 1 } } */
 
-/* { dg-final { scan-assembler-times "\[\t \]0x3\[\t \]+\[^\n\]*ctv_typeidx" 1} } */
-
 typedef enum { B1 = 1, B2 = 2, B3 = 3 } B;
 B __attribute__ ((mode (QI))) bqi;
-- 
1.8.3.1



More information about the Gcc-patches mailing list