public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed][libgomp, testsuite, openacc] Don't use const int for dimensions
@ 2019-01-09  0:10 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-01-09  0:10 UTC (permalink / raw)
  To: gcc-patches; +Cc: Thomas Schwinge

Hi,

Const int is handled differently at -O0 for -xc and -xc++, which can cause noise
in testsuite/libgomp.oacc-c-c++-common test-cases (which are both run for c and
c++) if const int is used for launch dimensions.

Fix this by using #defines instead.

Committed to trunk.

Thanks,
- Tom

[libgomp, testsuite, openacc] Don't use const int for dimensions

2019-01-08  Tom de Vries  <tdevries@suse.de>

	PR target/88756
	* testsuite/libgomp.oacc-c-c++-common/reduction-1.c (ng, nw, vl): Use
	#define instead of "const int".
	* testsuite/libgomp.oacc-c-c++-common/reduction-2.c (ng, nw, vl): Same.
	* testsuite/libgomp.oacc-c-c++-common/reduction-3.c (ng, nw, vl): Same.
	* testsuite/libgomp.oacc-c-c++-common/reduction-4.c (ng, nw, vl): Same.
	* testsuite/libgomp.oacc-c-c++-common/reduction-5.c (ng, nw, vl): Same.

---
 libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-1.c | 6 +++---
 libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-2.c | 6 +++---
 libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-3.c | 6 +++---
 libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-4.c | 6 +++---
 libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c | 6 +++---
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-1.c
index e8a8911faeb..3fe9ae65309 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-1.c
@@ -8,9 +8,9 @@
 #include <stdlib.h>
 #include "reduction.h"
 
-const int ng = 8;
-const int nw = 4;
-const int vl = 32;
+#define ng 8
+#define nw 4
+#define vl 32
 
 static void
 test_reductions (void)
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-2.c
index d19b1c825ca..83986abf7e0 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-2.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-2.c
@@ -8,9 +8,9 @@
 #include <stdlib.h>
 #include "reduction.h"
 
-const int ng = 8;
-const int nw = 4;
-const int vl = 32;
+#define ng 8
+#define nw 4
+#define vl 32
 
 static void
 test_reductions (void)
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-3.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-3.c
index 1b948bef5a0..3ac0f996a86 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-3.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-3.c
@@ -8,9 +8,9 @@
 #include <stdlib.h>
 #include "reduction.h"
 
-const int ng = 8;
-const int nw = 4;
-const int vl = 32;
+#define ng 8
+#define nw 4
+#define vl 32
 
 static void
 test_reductions (void)
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-4.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-4.c
index 79355eded80..b8fa954cfee 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-4.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-4.c
@@ -9,9 +9,9 @@
 #include <complex.h>
 #include "reduction.h"
 
-const int ng = 8;
-const int nw = 4;
-const int vl = 32;
+#define ng 8
+#define nw 4
+#define vl 32
 
 static void
 test_reductions (void)
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c
index 46b553a61ff..215d919a103 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c
@@ -9,9 +9,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-const int ng = 8;
-const int nw = 4;
-const int vl = 32;
+#define ng 8
+#define nw 4
+#define vl 32
 
 const int n = 100;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-09  0:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09  0:10 [committed][libgomp, testsuite, openacc] Don't use const int for dimensions Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).