diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-30 05:16:36 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-30 05:16:36 +0000 |
commit | bc4381667a31bd5f1e677d64c789b1e959df00d5 (patch) | |
tree | a6b80dca8f72a2e7640e4d535901e42325b2a954 /gcc/testsuite/lib | |
parent | 1cd66bce1663eb648638d311b493de0dcc4146c3 (diff) | |
parent | 738c50b853f5ba0eaf93e23f6d29cbac761eef9e (diff) | |
download | gcc-reload-v2a.tar.gz |
Weekly merge from trunk. No regressions.reload-v2a
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/reload-v2a@181834 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/lib')
-rw-r--r-- | gcc/testsuite/lib/gcc-simulate-thread.exp | 31 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 103 |
2 files changed, 89 insertions, 45 deletions
diff --git a/gcc/testsuite/lib/gcc-simulate-thread.exp b/gcc/testsuite/lib/gcc-simulate-thread.exp index b2487d2d8c7..9be5da317b9 100644 --- a/gcc/testsuite/lib/gcc-simulate-thread.exp +++ b/gcc/testsuite/lib/gcc-simulate-thread.exp @@ -22,11 +22,6 @@ # Call 'fail' if a given test printed "FAIL:", otherwise call 'pass'. proc simulate-thread { args } { - - # ??? Exit immediately if this is alpha*-*-linux* target, single-stepping - # executable between ldl_l and stl_c insns in gdb breaks LL/SC chaining. - if { [istarget alpha*-*-linux*] } { return } - if { ![isnative] || [is_remote target] } { return } if { [llength $args] == 1 } { @@ -50,35 +45,39 @@ proc simulate-thread { args } { return } + set message "thread simulation test" + send_log "Spawning: $gdb_name -nx -nw -quiet -x $cmd_file ./$exec_file\n" set res [remote_spawn target "$gdb_name -nx -nw -x $cmd_file ./$exec_file"] if { $res < 0 || $res == "" } { - unsupported "$testcase" + unsupported "$testcase $message" return } set gdb_worked 0 - remote_expect target [timeout_value] { + + # Set timeout to 10 seconds due to huge amount of generated log. + remote_expect target 10 { # Too old GDB -re "Unhandled dwarf expression|Error in sourced command file" { - unsupported "$testcase" + unsupported "$testcase $message" remote_close target return } -re "FAIL:" { - fail "$testcase" + fail "$testcase $message" remote_close target return } - # If the gdb output contained simulate_thread_main, assume + # If the gdb output contained simulate_thread_done, assume # that at the very least, we had a working gdb that was able - # to break in simulate_thread_main. - -re "simulate_thread_main" { + # to break in simulate_thread_done. + -re "simulate_thread_done" { set gdb_worked 1 exp_continue } timeout { - unsupported "$testcase" + fail "$testcase $message" remote_close target return } @@ -86,10 +85,10 @@ proc simulate-thread { args } { remote_close target if {$gdb_worked} { - pass "$testcase" + pass "$testcase $message" } else { - # Fail in the absence of a sane GDB. - fail "$testcase" + # Unsupported in the absence of a sane GDB. + unsupported "$testcase $message" } return } diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 94309102034..78223afe601 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2476,7 +2476,7 @@ proc check_effective_target_ultrasparc_hw { } { # instructions. We check this by attempting: "bmask %g0, %g0, %g0" proc check_effective_target_ultrasparc_vis2_hw { } { - return [check_runtime ultrasparc_hw { + return [check_runtime ultrasparc_vis2_hw { int main() { __asm__(".word 0x81b00320"); return 0; } } "-mcpu=ultrasparc3"] } @@ -2485,7 +2485,7 @@ proc check_effective_target_ultrasparc_vis2_hw { } { # instructions. We check this by attempting: "addxc %g0, %g0, %g0" proc check_effective_target_ultrasparc_vis3_hw { } { - return [check_runtime ultrasparc_hw { + return [check_runtime ultrasparc_vis3_hw { int main() { __asm__(".word 0x81b00220"); return 0; } } "-mcpu=niagara3"] } @@ -3620,11 +3620,81 @@ proc check_effective_target_sync_int_128 { } { } } -# Return 1 if the target supports atomic operations on "long long". +# Return 1 if the target supports atomic operations on "int_128" values +# and can execute them. -proc check_effective_target_sync_long_long { } { +proc check_effective_target_sync_int_128_runtime { } { if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) && ![is-effective-target ia32] } { + return [check_cached_effective_target sync_int_128_available { + check_runtime_nocache sync_int_128_available { + #include "cpuid.h" + int main () + { + unsigned int eax, ebx, ecx, edx; + if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)) + return !(ecx & bit_CMPXCHG16B); + return 1; + } + } "" + }] + } else { + return 0 + } +} + +# Return 1 if the target supports atomic operations on "long long". +# +# Note: 32bit x86 targets require -march=pentium in dg-options. + +proc check_effective_target_sync_long_long { } { + if { [istarget x86_64-*-*] + || [istarget i?86-*-*]) + || [istarget arm*-*-*] + || [istarget alpha*-*-*] } { + return 1 + } else { + return 0 + } +} + +# Return 1 if the target supports atomic operations on "long long" +# and can execute them. +# +# Note: 32bit x86 targets require -march=pentium in dg-options. + +proc check_effective_target_sync_long_long_runtime { } { + if { [istarget x86_64-*-*] + || [istarget i?86-*-*] } { + return [check_cached_effective_target sync_long_long_available { + check_runtime_nocache sync_long_long_available { + #include "cpuid.h" + int main () + { + unsigned int eax, ebx, ecx, edx; + if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)) + return !(edx & bit_CMPXCHG8B); + return 1; + } + } "" + }] + } elseif { [istarget arm*-*-linux-gnueabi] } { + return [check_runtime sync_longlong_runtime { + #include <stdlib.h> + int main () + { + long long l1; + + if (sizeof (long long) != 8) + exit (1); + + /* Just check for native; checking for kernel fallback is tricky. */ + asm volatile ("ldrexd r0,r1, [%0]" : : "r" (&l1) : "r0", "r1"); + + exit (0); + } + } "" ] + } elseif { [istarget alpha*-*-*] } { return 1 } else { return 0 @@ -3662,31 +3732,6 @@ proc check_effective_target_sync_int_long { } { return $et_sync_int_long_saved } -# Return 1 if the target supports atomic operations on "long long" and can -# execute them -# So far only put checks in for ARM, others may want to add their own -proc check_effective_target_sync_longlong { } { - return [check_runtime sync_longlong_runtime { - #include <stdlib.h> - int main () - { - long long l1; - - if (sizeof (long long) != 8) - exit (1); - - #ifdef __arm__ - /* Just check for native; checking for kernel fallback is tricky. */ - asm volatile ("ldrexd r0,r1, [%0]" : : "r" (&l1) : "r0", "r1"); - #else - # error "Add other suitable archs here" - #endif - - exit (0); - } - } "" ] -} - # Return 1 if the target supports atomic operations on "char" and "short". proc check_effective_target_sync_char_short { } { |