diff mbox

[cxx-mem-model] test with multiple optimization options

Message ID 4E4D82CC.9010300@redhat.com
State New
Headers show

Commit Message

Aldy Hernandez Aug. 18, 2011, 9:23 p.m. UTC
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.
* 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.
diff mbox

Patch

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.  */