]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
BTF testsuite: Remove explicit check on btm_type
authorIndu Bhagat <indu.bhagat@oracle.com>
Tue, 6 Jul 2021 23:11:47 +0000 (16:11 -0700)
committerIndu Bhagat <indu.bhagat@oracle.com>
Tue, 6 Jul 2021 23:13:29 +0000 (16:13 -0700)
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

index 5e68416e2c27f5b2910da8e1455347afc1b0257e..0e00f2b81fb7786c3f15b82356ed958d5928f2d1 100644 (file)
@@ -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 } */
 
 /* 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;