diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-03-06 14:15:25 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-03-06 14:15:25 -0800 |
commit | 4879395227fbddf3695cc550eecbe9c829701b61 (patch) | |
tree | 48027bc2b155d9fde21424003b34ae7e8f1069df /tests | |
parent | ac6876fb82b553ed6a5427b8b5abbe6ecb4ef34a (diff) |
standardize switch comparisons on signed values
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/runner.py b/tests/runner.py index e8bcb72e..51b9e357 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -2298,18 +2298,20 @@ def process(filename): case 'b': case 'c': return p-1; - case 'd': + case 0xfffffff1: return p+1; } return p; } int main( int argc, const char *argv[] ) { - printf("*%d,%d,%d,%d,%d*\\n", switcher('a'), switcher('b'), switcher('c'), switcher('d'), switcher('e')); + unsigned int x = 0xfffffff1; + x >>= 0; // force it to be unsigned for purpose of checking our switch comparison in signed/unsigned + printf("*%d,%d,%d,%d,%d,%d*\\n", switcher('a'), switcher('b'), switcher('c'), switcher(x), switcher(-15), switcher('e')); return 0; } ''' - self.do_run(src, '*96,97,98,101,101*') + self.do_run(src, '*96,97,98,-14,-14,101*') def test_indirectbr(self): src = ''' |