Commit f507d202 by Martin Liska Committed by Martin Liska

Add tests that test boundary values of params

	* Makefile.in: Append rule for params-options.h.
	* params-options.h: New file.
	* gcc.dg/params/blocksort-part.c: New test.
	* gcc.dg/params/params.exp: New file.

From-SVN: r238249
parent d6f7c125
......@@ -6,6 +6,11 @@
2016-07-12 Martin Liska <mliska@suse.cz>
* Makefile.in: Append rule for params-options.h.
* params-options.h: New file.
2016-07-12 Martin Liska <mliska@suse.cz>
* ira-build.c (mark_loops_for_removal): Properly iterate
loops.
......
......@@ -2502,7 +2502,7 @@ generated_files = config.h tm.h $(TM_P_H) $(TM_H) multilib.h \
$(ALL_GTFILES_H) gtype-desc.c gtype-desc.h gcov-iov.h \
options.h target-hooks-def.h insn-opinit.h \
common/common-target-hooks-def.h pass-instances.def \
c-family/c-target-hooks-def.h params.list case-cfn-macros.h \
c-family/c-target-hooks-def.h params.list params.options case-cfn-macros.h \
cfn-operators.pd
#
......@@ -3334,6 +3334,13 @@ s-params.list: $(srcdir)/params-list.h $(srcdir)/params.def
$(SHELL) $(srcdir)/../move-if-change tmp-params.list params.list
$(STAMP) s-params.list
params.options: s-params.options; @true
s-params.options: $(srcdir)/params-options.h $(srcdir)/params.def
$(CPP) $(srcdir)/params-options.h | sed 's/^#.*//;/^$$/d' > tmp-params.options
$(SHELL) $(srcdir)/../move-if-change tmp-params.options params.options
$(STAMP) s-params.options
PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
toplev.h $(DIAGNOSTIC_CORE_H) $(BASIC_BLOCK_H) $(HASH_TABLE_H) \
tree-ssa-alias.h $(INTERNAL_FN_H) gimple-fold.h tree-eh.h gimple-expr.h \
......
/* File used to generate params.list
Copyright (C) 2015-2016 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#define DEFPARAM(enumerator, option, nocmsgid, default, min, max) \
option=default,min,max
#define DEFPARAMENUM5(enumerator, option, nocmsgid, default, \
v0, v1, v2, v3, v4) \
option=v0,v1,v2,v3,v4
#include "params.def"
#undef DEFPARAM
#undef DEFPARAMENUM5
2016-07-12 Martin Liska <mliska@suse.cz>
* gcc.dg/params/blocksort-part.c: New test.
* gcc.dg/params/params.exp: New file.
2016-07-12 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR middle-end/71700
......
# Copyright (C) 2016 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GCC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
# GCC testsuite that uses the `dg.exp' driver.
# Load support procs.
load_lib gcc-dg.exp
# Initialize `dg'.
dg-init
proc param_run_test { param_name param_value } {
global srcdir
global subdir
dg-runtest $srcdir/$subdir/blocksort-part.c "" "-O3 --param $param_name=$param_value"
}
set fd [open "$objdir/../../params.options" r]
set text [read $fd]
close $fd
# Main loop.
foreach params [split $text "\n"] {
set parts [split $params "="]
set name [string trim [lindex $parts 0] '"']
set values [split [lindex $parts 1] ","]
if { [llength $values] == 3 } {
set default [lindex $values 0]
set min [lindex $values 1]
set max [lindex $values 2]
set int_max "INT_MAX"
if { $min != -1 } {
param_run_test $name $min
}
if { $max != $min && $max > 0 && $max != $int_max } {
param_run_test $name $max
}
}
if { [llength $values] == 5 } {
foreach v $values {
param_run_test $name $v
}
}
}
# All done.
dg-finish
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment