[PATCH, testsuite] Add dg-require-stack-size
Tom de Vries
Tom_deVries@mentor.com
Mon Oct 16 10:17:00 GMT 2017
Hi,
I noticed gcc.dg/tree-ssa/ldist-27.c failing for nvptx due to a too
large stack size.
I started updating the testcase using "dg-add-options stack_size", but
came across dg-require-support and realized I could make a
dg-require-stack-size directive with an argument, and use that instead.
With the patch applied, the test still passes on x86_64, and by mocking
up limited stack space like this:
...
diff --git a/gcc/testsuite/lib/target-supports.exp
b/gcc/testsuite/lib/target-supports.exp
index 4f9bf46..cafea26 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -511,6 +511,7 @@ proc check_effective_target_trampolines { } {
# Return 1 if target has limited stack size.
proc check_effective_target_stack_size { } {
+ return 1
if [target_info exists gcc,stack_size] {
return 1
}
@@ -522,6 +523,7 @@ proc check_effective_target_stack_size { } {
proc dg-effective-target-value { effective_target } {
if { "$effective_target" == "stack_size" } {
if [check_effective_target_stack_size] {
+ return 8192
return [target_info gcc,stack_size]
}
}
...
it's listed as unsupported instead.
The info entry looks like:
...
'dg-require-stack-size SIZE'
Skip the test if the target does not support a stack size of SIZE.
...
OK for trunk?
Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-dg-require-stack-size.patch
Type: text/x-patch
Size: 2441 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20171016/9326d957/attachment.bin>
More information about the Gcc-patches
mailing list