diff options
author | Nathan Hammond <github.com@nathanhammond.com> | 2012-03-07 21:31:08 -0500 |
---|---|---|
committer | Nathan Hammond <github.com@nathanhammond.com> | 2012-03-07 21:31:08 -0500 |
commit | 8219427f95f5e40e04822e2e2371d7adedc11cdc (patch) | |
tree | 426bce3f9f0e3692171f001b4c12fdd3f22a7a87 /tests | |
parent | 1c1e00f1ddf6a816872991e3d10cbfcc38ff5134 (diff) | |
parent | 84c9c225258ae9ab77eda0163b1368e95cb55f10 (diff) |
Merge with @richardassar's changes.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/runner.py b/tests/runner.py index e8bcb72e..b8641d9a 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -2287,6 +2287,8 @@ def process(filename): self.do_run(src, '*nameA,nameB*') def test_llvmswitch(self): + Settings.CORRECT_SIGNS = 1 + src = ''' #include <stdio.h> #include <string.h> @@ -2298,18 +2300,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 = ''' |