testsuite: Fix up builtin-prefetch-1.c tests

Message ID 20241101171715.12890-1-xry111@xry111.site
State Committed
Commit e8689ac75faca61a0251d1098dbafa8c637ec489
Headers
Series testsuite: Fix up builtin-prefetch-1.c tests |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply

Commit Message

Xi Ruoyao Nov. 1, 2024, 5:16 p.m. UTC
  How can you use "read-shared" as an identifier?  It's not allowed by all
C standard versions.

gcc/testsuite/ChangeLog:

	* gcc.c-torture/execute/builtin-prefetch-1.c (rws): Use
	"read_shared" instead of "read-shared" as the identifier for
	enum value.
	* gcc.dg/builtin-prefetch-1.c (rws): Likewise.
---

Bootstrapped and regtested on x86_64-linux-gnu.  The following test
failures are resolved:

< FAIL: gcc.c-torture/execute/builtin-prefetch-1.c   -O0  (test for excess errors)
< UNRESOLVED: gcc.c-torture/execute/builtin-prefetch-1.c   -O0  compilation failed to produce executable
< FAIL: gcc.c-torture/execute/builtin-prefetch-1.c   -O1  (test for excess errors)
< UNRESOLVED: gcc.c-torture/execute/builtin-prefetch-1.c   -O1  compilation failed to produce executable
< FAIL: gcc.c-torture/execute/builtin-prefetch-1.c   -O2  (test for excess errors)
< UNRESOLVED: gcc.c-torture/execute/builtin-prefetch-1.c   -O2  compilation failed to produce executable
< FAIL: gcc.c-torture/execute/builtin-prefetch-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  (test for excess errors)
< UNRESOLVED: gcc.c-torture/execute/builtin-prefetch-1.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  compilation failed to produce executable
< FAIL: gcc.c-torture/execute/builtin-prefetch-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  (test for excess errors)
< UNRESOLVED: gcc.c-torture/execute/builtin-prefetch-1.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  compilation failed to produce executable
< FAIL: gcc.c-torture/execute/builtin-prefetch-1.c   -O3 -g  (test for excess errors)
< UNRESOLVED: gcc.c-torture/execute/builtin-prefetch-1.c   -O3 -g  compilation failed to produce executable
< FAIL: gcc.c-torture/execute/builtin-prefetch-1.c   -Os  (test for excess errors)
< UNRESOLVED: gcc.c-torture/execute/builtin-prefetch-1.c   -Os  compilation failed to produce executable
< FAIL: gcc.dg/builtin-prefetch-1.c  (test for warnings, line 31)
< FAIL: gcc.dg/builtin-prefetch-1.c  (test for warnings, line 32)
< FAIL: gcc.dg/builtin-prefetch-1.c  (test for warnings, line 33)
< FAIL: gcc.dg/builtin-prefetch-1.c  (test for warnings, line 34)
< FAIL: gcc.dg/builtin-prefetch-1.c  (test for warnings, line 35)
< FAIL: gcc.dg/builtin-prefetch-1.c  (test for warnings, line 36)
< FAIL: gcc.dg/builtin-prefetch-1.c (test for excess errors)
< UNRESOLVED: gcc.dg/builtin-prefetch-1.c compilation failed to produce executable

Ok for trunk?

 gcc/testsuite/gcc.c-torture/execute/builtin-prefetch-1.c | 2 +-
 gcc/testsuite/gcc.dg/builtin-prefetch-1.c                | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Comments

Jeff Law Nov. 1, 2024, 5:41 p.m. UTC | #1
On 11/1/24 11:16 AM, Xi Ruoyao wrote:
> How can you use "read-shared" as an identifier?  It's not allowed by all
> C standard versions.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.c-torture/execute/builtin-prefetch-1.c (rws): Use
> 	"read_shared" instead of "read-shared" as the identifier for
> 	enum value.
> 	* gcc.dg/builtin-prefetch-1.c (rws): Likewise.
OK.  I was seeing similar failures in my tester, but hadn't started to 
analyze yet.

Jeff
  
Xi Ruoyao Nov. 1, 2024, 5:49 p.m. UTC | #2
On Fri, 2024-11-01 at 11:41 -0600, Jeff Law wrote:
> 
> 
> On 11/1/24 11:16 AM, Xi Ruoyao wrote:
> > How can you use "read-shared" as an identifier?  It's not allowed by
> > all
> > C standard versions.
> > 
> > gcc/testsuite/ChangeLog:
> > 
> > 	* gcc.c-torture/execute/builtin-prefetch-1.c (rws): Use
> > 	"read_shared" instead of "read-shared" as the identifier
> > for
> > 	enum value.
> > 	* gcc.dg/builtin-prefetch-1.c (rws): Likewise.
> OK.  I was seeing similar failures in my tester, but hadn't started to
> analyze yet.

Pushed to trunk.
  
Haochen Jiang Nov. 1, 2024, 6:11 p.m. UTC | #3
> From: Xi Ruoyao <xry111@xry111.site>
> Sent: Saturday, November 2, 2024 1:50 AM
\
> > On 11/1/24 11:16 AM, Xi Ruoyao wrote:
> > > How can you use "read-shared" as an identifier?  It's not allowed by
> > > all C standard versions.
> > >
> > > gcc/testsuite/ChangeLog:
> > >
> > > 	* gcc.c-torture/execute/builtin-prefetch-1.c (rws): Use
> > > 	"read_shared" instead of "read-shared" as the identifier for
> > > 	enum value.
> > > 	* gcc.dg/builtin-prefetch-1.c (rws): Likewise.
> > OK.  I was seeing similar failures in my tester, but hadn't started to
> > analyze yet.
> 
> Pushed to trunk.

I have a patch get approved to also fix that just waiting for another day.

But still thank for fixing that!

Thx,
Haochen

> 
> --
> Xi Ruoyao <xry111@xry111.site>
> School of Aerospace Science and Technology, Xidian University
  
Haochen Jiang Nov. 1, 2024, 6:12 p.m. UTC | #4
> From: Xi Ruoyao <xry111@xry111.site>
> Sent: Saturday, November 2, 2024 1:16 AM
> 
> How can you use "read-shared" as an identifier?  It's not allowed by all C
> standard versions.
> 
 
I did a last minute change to fix that but unfortunately did not get into
my patch.

My apology.

Thx,
Haochen
  

Patch

diff --git a/gcc/testsuite/gcc.c-torture/execute/builtin-prefetch-1.c b/gcc/testsuite/gcc.c-torture/execute/builtin-prefetch-1.c
index 03620c6ea6b..07b490dc1a6 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtin-prefetch-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtin-prefetch-1.c
@@ -15,7 +15,7 @@  void exit (int);
 #define READ_ACCESS 0
 
 enum locality { none, low, moderate, high };
-enum rws { read, write, read-shared };
+enum rws { read, write, read_shared };
 
 int arr[10];
 
diff --git a/gcc/testsuite/gcc.dg/builtin-prefetch-1.c b/gcc/testsuite/gcc.dg/builtin-prefetch-1.c
index 7f75353795f..aadbf144cfe 100644
--- a/gcc/testsuite/gcc.dg/builtin-prefetch-1.c
+++ b/gcc/testsuite/gcc.dg/builtin-prefetch-1.c
@@ -8,7 +8,7 @@ 
 extern void exit (int);
 
 enum locality { none, low, moderate, high, bogus };
-enum rws { read, write, read-shared };
+enum rws { read, write, read_shared };
 
 int arr[10];