Files
mercury/tests/hard_coded/shift_test.exp
Zoltan Somogyi 58ea6ffff2 Delete old obsolete predicates and functions.
library/*.m:
    Specifically, delete any predicates and functions whose `pragma obsolete'
    dates from 2018 or before. Keep the ones that were obsoleted
    only this year or last year.

NEWS:
    Announce the changes.

tests/debugger/io_tab_goto.m:
tests/debugger/tabled_read.m:
tests/declarative_debugger/io_stream_test.m:
tests/declarative_debugger/tabled_read_decl.m:
tests/declarative_debugger/tabled_read_decl_goto.m:
tests/general/array_test.m:
tests/hard_coded/mutable_init_impure.m:
tests/hard_coded/remove_file.m:
tests/tabling/mercury_java_parser_dead_proc_elim_bug.m:
tests/tabling/mercury_java_parser_dead_proc_elim_bug2.m:
tests/valid/mercury_java_parser_follow_code_bug.m:
    Replace references to predicates and functions that this diff deletes
    with their suggested replacements.

    In several test cases, bring the programming style up to date.

tests/hard_coded/shift_test.{m,exp}:
    Most of this test case tested the now-deleted legacy shift operations.
    Replace these with tests of their non-legacy versions, including
    testing for the expected exceptions.

tests/hard_coded/shift_test.{m,exp}:
    Don't pass --no-warn-obsolete when compiling shift_test.m anymore.
2020-08-18 11:57:47 +10:00

30 lines
1.3 KiB
Plaintext

64 << 0 = 64 (64)
64 << 2 = 256 (256)
-64 << 2 = -256 (-256)
64 << -2 = int.(<<): second operand is out of range (expected failure)
-64 << -2 = int.(<<): second operand is out of range (expected failure)
64 << -256 = int.(<<): second operand is out of range (expected failure)
-64 << -256 = int.(<<): second operand is out of range (expected failure)
25 << 3 = 200 (200)
-25 << 3 = -200 (-200)
25 << -3 = int.(<<): second operand is out of range (expected failure)
-25 << -3 = int.(<<): second operand is out of range (expected failure)
64 >> 0 = 64 (64)
64 >> 2 = 16 (16)
-64 >> 2 = -16 (-16)
64 >> -2 = int.(>>): second operand is out of range (expected failure)
-64 >> -2 = int.(>>): second operand is out of range (expected failure)
64 >> 256 = int.(>>): second operand is out of range (expected failure)
-64 >> 256 = int.(>>): second operand is out of range (expected failure)
25 >> 3 = 3 (3)
-25 >> 3 = -4 (-4)
25 >> -3 = int.(>>): second operand is out of range (expected failure)
-25 >> -3 = int.(>>): second operand is out of range (expected failure)
64 uhch_<< 2 = 256 (256)
-64 unch_>> 2 = -16 (-16)
The following cases test undefined behaviour (they cause overflow):
64 unch_<< 256 = 64 (0)
-64 unch_<< 256 = -64 (0)
64 unch_>> -256 = 64 (0)
-64 unch_>> -256 = -64 (0)