Fix caching of tests for multiple variant runs and update existing target-supports tests.
Currently some target supports checks such as vect_int cache their
results in a manner that would cause them not to be rechecked when
running the same tests against a different variant in a multi variant
run. This causes tests to be skipped or run when they shouldn't be.
there is already an existing caching mechanism in place that does the
caching correctly, but presumably these weren't used because some of these
tests originally only contained static data. e.g. only checked if the target is
aarch64*-*-* etc.
This patch changes every function that needs to do any caching at all to use
check_cached_effective_target which will cache per variant instead of globally.
For those tests that already parameterize over et_index I have created
check_cached_effective_target_indexed to handle this common case by creating a list
containing the property name and the current value of et_index.
These changes result in a much simpler implementation for most tests and a large
reduction in lines for target-supports.exp.
Regtested on
aarch64-none-elf
x86_64-pc-linux-gnu
powerpc64-unknown-linux-gnu
arm-none-eabi
and no testsuite errors. Difference would depend on your site.exp.
On arm we get about 4500 new testcases and on aarch64 the low 10s.
On PowerPC and x86_64 no changes as expected since the default exp for these
just test the default configuration.
What this means for new target checks is that they should always use either
check_cached_effective_target or check_cached_effective_target_indexed if the
result of the check is to be cached.
As an example the new vect_int looks like
proc check_effective_target_vect_int { } {
return [check_cached_effective_target_indexed <name> {
expr {
<condition>
}}]
}
The debug information that was once there is now all hidden in
check_cached_effective_target, (called from check_cached_effective_target_indexed)
and so the only thing you are required to do is give it a unique cache name and a condition.
The condition doesn't need to be an if statement so simple boolean expressions are enough here:
[istarget i?86-*-*] || [istarget x86_64-*-*]
|| ([istarget powerpc*-*-*]
&& ![istarget powerpc-*-linux*paired*])
|| ...
From-SVN: r264745