public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [cxx-mem-model] test with multiple optimization options
@ 2011-08-18 21:59 Aldy Hernandez
  0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2011-08-18 21:59 UTC (permalink / raw)
  To: Andrew MacLeod; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 242 bytes --]

Attached is a change to the harness to test with {-O[0123s] -g} as well 
as corresponding changes to the tests themselves.

Tested by running "make check-gcc RUNTESTFLAGS=memmodel.exp" and 
inspecting the logs manually.

Committed to branch.

[-- Attachment #2: curr --]
[-- Type: text/plain, Size: 5598 bytes --]

	* gcc.dg/memmodel/memmodel.exp: Torture with more options.
	* g++.dg/memmodel/memmodel.exp: Same.
	* gcc.dg/memmodel/*.c: Remove optimization flags.
	* g++.dg/memmodel/*.c: Remove optimization flags.

Index: gcc.dg/memmodel/speculative-store.c
===================================================================
--- gcc.dg/memmodel/speculative-store.c	(revision 177836)
+++ gcc.dg/memmodel/speculative-store.c	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do link } */
-/* { dg-options "-O2 --param allow-store-data-races=0" } */
+/* { dg-options "--param allow-store-data-races=0" } */
 /* { dg-final { memmodel-gdb-test } } */
 
 #include <stdio.h>
Index: gcc.dg/memmodel/strict-align-global.c
===================================================================
--- gcc.dg/memmodel/strict-align-global.c	(revision 177836)
+++ gcc.dg/memmodel/strict-align-global.c	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do link } */
-/* { dg-options "-O2 --param allow-packed-store-data-races=0" } */
+/* { dg-options "--param allow-packed-store-data-races=0" } */
 /* { dg-final { memmodel-gdb-test } } */
 
 #include <stdio.h>
Index: gcc.dg/memmodel/subfields.c
===================================================================
--- gcc.dg/memmodel/subfields.c	(revision 177836)
+++ gcc.dg/memmodel/subfields.c	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do link } */
-/* { dg-options "-O2 --param allow-packed-store-data-races=0" } */
+/* { dg-options "--param allow-packed-store-data-races=0" } */
 /* { dg-final { memmodel-gdb-test } } */
 
 #include <stdio.h>
Index: gcc.dg/memmodel/memmodel.exp
===================================================================
--- gcc.dg/memmodel/memmodel.exp	(revision 177836)
+++ gcc.dg/memmodel/memmodel.exp	(working copy)
@@ -2,6 +2,7 @@
 
 load_lib gcc-dg.exp
 load_lib gcc-memmodel-gdb-test.exp
+load_lib torture-options.exp
 
 proc check_guality {args} {
     set result [eval check_compile guality_check executable $args "-g -O0"]
@@ -17,6 +18,13 @@ proc check_guality {args} {
 }
 
 dg-init
+torture-init
+set-torture-options [list \
+	{ -O0 -g } \
+	{ -O1 -g } \
+	{ -O2 -g } \
+	{ -O3 -g } \
+	{ -Os -g } ]
 
 # Test the presence of gdb with the guality infrastructure.
 global GDB
@@ -37,9 +45,9 @@ if {[check_guality "
     return 0;
   }
 "]} {
-  dg-runtest [lsort [glob $srcdir/$subdir/*.c]] "-g" ""
+  gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] ""
 # Uncomment line below when we have common C/C++ tests.
-#  dg-runtest [lsort [glob $srcdir/c-c++-common/memmodel/*.c]] "-g" ""
+#  gcc-dg-runtest [lsort [glob $srcdir/c-c++-common/memmodel/*.c]] ""
 }
 
 if [info exists guality_gdb_name] {
Index: g++.dg/memmodel/atomics-2.C
===================================================================
--- g++.dg/memmodel/atomics-2.C	(revision 177836)
+++ g++.dg/memmodel/atomics-2.C	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do link } */
-/* { dg-options "-std=c++0x -O2" } */
+/* { dg-options "-std=c++0x" } */
 /* { dg-final { memmodel-gdb-test } } */
 
 using namespace std;
Index: g++.dg/memmodel/bitfields-2.C
===================================================================
--- g++.dg/memmodel/bitfields-2.C	(revision 177836)
+++ g++.dg/memmodel/bitfields-2.C	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do link } */
-/* { dg-options "-O2 --param allow-load-data-races=0 --param allow-store-data-races=0" } */
+/* { dg-options "--param allow-load-data-races=0 --param allow-store-data-races=0" } */
 /* { dg-final { memmodel-gdb-test } } */
 
 /* Test that setting <var.a> does not touch either <var.b> or <var.c>.
Index: g++.dg/memmodel/bitfields.C
===================================================================
--- g++.dg/memmodel/bitfields.C	(revision 177836)
+++ g++.dg/memmodel/bitfields.C	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do link } */
-/* { dg-options "-O2 --param allow-load-data-races=0 --param allow-store-data-races=0" } */
+/* { dg-options "--param allow-load-data-races=0 --param allow-store-data-races=0" } */
 /* { dg-final { memmodel-gdb-test } } */
 
 /* Test that setting <var.a> does not touch either <var.b> or <var.c>.
Index: g++.dg/memmodel/memmodel.exp
===================================================================
--- g++.dg/memmodel/memmodel.exp	(revision 177836)
+++ g++.dg/memmodel/memmodel.exp	(working copy)
@@ -2,6 +2,7 @@
 
 load_lib g++-dg.exp
 load_lib gcc-memmodel-gdb-test.exp
+load_lib torture-options.exp
 
 proc check_guality {args} {
     set result [eval check_compile guality_check executable $args "-g -O0"]
@@ -17,6 +18,13 @@ proc check_guality {args} {
 }
 
 dg-init
+torture-init
+set-torture-options [list \
+	{ -O0 -g } \
+	{ -O1 -g } \
+	{ -O2 -g } \
+	{ -O3 -g } \
+	{ -Os -g } ]
 
 # Test the presence of gdb with the guality infrastructure.
 global GDB
@@ -37,9 +45,9 @@ if {[check_guality "
     return 0;
   }
 "]} {
-  dg-runtest [lsort [glob $srcdir/$subdir/*.C]] "-g" ""
+  gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] ""
 # Uncomment line below when we have common C/C++ tests.
-#  dg-runtest [lsort [glob $srcdir/c-c++-common/memmodel/*.c]] "-g" ""
+#  gcc-dg-runtest [lsort [glob $srcdir/c-c++-common/memmodel/*.c]] ""
 }
 
 if [info exists guality_gdb_name] {
Index: g++.dg/memmodel/atomics-1.C
===================================================================
--- g++.dg/memmodel/atomics-1.C	(revision 177836)
+++ g++.dg/memmodel/atomics-1.C	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do link } */
-/* { dg-options "-std=c++0x -O2" } */
+/* { dg-options "-std=c++0x" } */
 /* { dg-final { memmodel-gdb-test } } */
 
 /* Test that atomic int and atomic char work properly.  */

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

only message in thread, other threads:[~2011-08-18 21:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-18 21:59 [cxx-mem-model] test with multiple optimization options Aldy Hernandez

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).