From ddba45156d238d9602ee20a728def4e485c0c9cf Mon Sep 17 00:00:00 2001 From: hunt Date: Mon, 18 Jun 2007 19:29:56 +0000 Subject: [PATCH] 2007-06-18 Martin Hunt * syscall.exp (test_procedure): Use switch statements to clean up the logic for setting flags for 64 and 32-bit passes. --- testsuite/systemtap.syscall/ChangeLog | 5 ++++ testsuite/systemtap.syscall/syscall.exp | 40 +++++++++++++++---------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/testsuite/systemtap.syscall/ChangeLog b/testsuite/systemtap.syscall/ChangeLog index 4958bdaf0..3765d7bb2 100644 --- a/testsuite/systemtap.syscall/ChangeLog +++ b/testsuite/systemtap.syscall/ChangeLog @@ -1,3 +1,8 @@ +2007-06-18 Martin Hunt + + * syscall.exp (test_procedure): Use switch statements to clean + up the logic for setting flags for 64 and 32-bit passes. + 2007-05-25 Martin Hunt * syscall.exp (test_procedure): Remove stray timeout assignment. diff --git a/testsuite/systemtap.syscall/syscall.exp b/testsuite/systemtap.syscall/syscall.exp index 02c6278f0..e9ea9537b 100644 --- a/testsuite/systemtap.syscall/syscall.exp +++ b/testsuite/systemtap.syscall/syscall.exp @@ -12,13 +12,19 @@ proc test_procedure {} { # Add any other 64-bit arcvhitecture you want tested below. # To find tcl's platform name for your machine, run the following: # echo "puts $::tcl_platform(machine)" | tclsh - set do_64_bit_pass 0 - if {$::tcl_platform(machine) == "x86_64" || $::tcl_platform(machine) == "ppc64" || $::tcl_platform(machine) == "s390x" } { - set do_64_bit_pass 1 - set flags "additional_flags=-m64" - } - if { $::tcl_platform(machine) == "ia64" } { - set do_64_bit_pass 1 + + switch -regexp $::tcl_platform(machine) { + ^ia64$ { + set do_64_bit_pass 1 + set flags "" + } + ^(x86_64|ppc64|s390x)$ { + set do_64_bit_pass 1 + set flags "additional_flags=-m64" + } + default { + set do_64_bit_pass 0 + } } if {$do_64_bit_pass} { @@ -39,16 +45,18 @@ proc test_procedure {} { catch {exec rm -f $wd/$file} } } - - set do_32_bit_pass 1 - set flags "additional_flags=-m32" - # add any 64-bit only machines to this statement - if { $::tcl_platform(machine) == "ia64" } { - set do_32_bit_pass 0 - } - if { $::tcl_platform(machine) == "s390x" } { - set flags "additional_flags=-m31" + set do_32_bit_pass 1 + switch -regexp $::tcl_platform(machine) { + ^(x86_64|ppc64)$ { + set flags "additional_flags=-m32" + } + ^s390x$ { + set flags "additional_flags=-m31" + } + ^ia64$ { + set do_32_bit_pass 0 + } } if {$do_32_bit_pass} { -- 2.43.5