diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 13:08:04 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:56 +0200 |
commit | 698d4008d81394ab812ec46730f829628bd69fb8 (patch) | |
tree | 58c117880f1775304e656cb109c7ca3c3aa81d85 /tests/test_core.py | |
parent | 1de317c109dbdcfe403eef51708b41374697fed7 (diff) |
Use do_run_from_file() for test_llvmswitch
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index 25daae15..f85858e5 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -2008,31 +2008,10 @@ def process(filename): def test_llvmswitch(self): Settings.CORRECT_SIGNS = 1 - src = ''' - #include <stdio.h> - #include <string.h> - - int switcher(int p) - { - switch(p) { - case 'a': - case 'b': - case 'c': - return p-1; - case -15: - return p+1; - } - return p; - } + test_path = path_from_root('tests', 'core', 'test_llvmswitch') + src, output = (test_path + s for s in ('.in', '.out')) - int main( int argc, const char *argv[] ) { - unsigned int x = 0xfffffff1; - x >>= (argc-1); // 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,-14,-14,101*') + self.do_run_from_file(src, output) # By default, when user has not specified a -std flag, Emscripten should always build .cpp files using the C++03 standard, # i.e. as if "-std=c++03" had been passed on the command line. On Linux with Clang 3.2 this is the case, but on Windows |