testsuite: Factor out a function to run a matrix of tests
This commons up code from libffi.call/call.exp and libffi.special/special.exp, unifies the optimization option matrix between the two, and makes it easier to add more axes to the matrix in the future.
This commit is contained in:
@@ -273,6 +273,23 @@ proc libffi-dg-runtest { testcases default-extra-flags } {
|
||||
}
|
||||
}
|
||||
|
||||
proc run-many-tests { testcases extra_flags } {
|
||||
global using_gcc
|
||||
if { [string match $using_gcc "yes"] } {
|
||||
set common "-W -Wall"
|
||||
set optimizations { "-O0" "-O2" "-O3" "-Os" "-O2 -fomit-frame-pointer" }
|
||||
} else {
|
||||
# Assume we are using the vendor compiler.
|
||||
set common ""
|
||||
set optimizations { "" }
|
||||
}
|
||||
|
||||
set common [ concat $common $extra_flags ]
|
||||
foreach opt $optimizations {
|
||||
set options [ concat $common $opt ]
|
||||
dg-runtest $testcases $options ""
|
||||
}
|
||||
}
|
||||
|
||||
# Like check_conditional_xfail, but callable from a dg test.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user