Add testsuite/lib/compile_flags.exp and use it in tests.
testsuite/lib/compile_flags.exp defines all_compile_flags(),
all_compile_flag(INDEX) and all_compile_flag_name(INDEX) which return
the number, actual flag and extra test name to use in tests that use
target_compile for use space testing. On architectures that support
multiple ABIs it will return all combinations of all optimizations
(none, -O, -O2) and the ABI flags (-m64, -m32 or -m31).
Use in a for loop like: for {set i 0} {$i < [all_compile_flags]} {incr i} {
set extra_flag [all_compile_flag $i] # Add to target_compile flags
set extra_name [all_compile_flag_name $i] # Add to test pass/fail message
...
}