[COMMITTED] BTF testsuite: Remove explicit check on btm_type

Indu Bhagat indu.bhagat@oracle.com
Tue Jul 6 23:17:31 GMT 2021


[Committed as obvious.]

The value of btm_type is the BTF type ID of the referred type.  The order in
which the BTF types are added can change across platforms and also as the code
evolves, hence changing the BTF type ID. As there is no direct and portable
method of testing that a BTF type refers to another BTF type of a specific
kind, remove the explicit check on btm_type.

This patch adjusts the testcase without affecting the test coverage as other
testcases already have similar constructs. It 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/btf/btf-bitfields-3.c: Remove the check on btm_type.
---
 gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-3.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-3.c b/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-3.c
index 5e68416..0e00f2b 100644
--- a/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-3.c
+++ b/gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-3.c
@@ -11,7 +11,6 @@
      [2] int 'unsigned int' size=4 offset=0 bits=32
      [3] struct 'bitt' size=4
          member 'f' type=1 bitfield_size=2 bit_offset=0
-         member 'data' type=2 bitfield_size=14 bit_offset=2
    */
 
 /* { dg-do compile } */
@@ -19,15 +18,12 @@
 
 /* Enum with 4 members.  */
 /* { dg-final { scan-assembler-times "\[\t \]0x6000004\[\t \]+\[^\n\]*btt_info" 1 } } */
-/* Struct with bitfield members, and 2 members.  */
-/* { dg-final { scan-assembler-times "\[\t \]0x84000002\[\t \]+\[^\n\]*btt_info" 1 } } */
+/* Struct with 1 bitfield member.  */
+/* { dg-final { scan-assembler-times "\[\t \]0x84000001\[\t \]+\[^\n\]*btt_info" 1 } } */
 
 /* Bitfield "f" points to type ID 1.  */
 /* { dg-final { scan-assembler-times "\[\t \]0x1\[\t \]+\[^\n\]*btm_type" 1 } } */
 
-/* Bitfield "data" points to type ID 2.  */
-/* { dg-final { scan-assembler-times "\[\t \]0x2\[\t \]+\[^\n\]*btm_type" 1 } } */
-
 enum foo
 {
   BAR = 0,
@@ -39,5 +35,4 @@ enum foo
 struct bitt
 {
   enum foo f : 2;
-  unsigned data : 14;
 } bitty;
-- 
1.8.3.1



More information about the Gcc-patches mailing list