diff options
| author | Brian Anderson <[email protected]> | 2011-03-07 21:21:01 -0500 |
|---|---|---|
| committer | Brian Anderson <[email protected]> | 2011-03-07 21:21:01 -0500 |
| commit | 9fc4db6b89213afdf45c02fc2bd2be62b0ddc40c (patch) | |
| tree | 6c84574116273f91cbe89abd256b9f809adf97de /src/test/run-pass/arith-unsigned.rs | |
| parent | Allow the else part of an expr_if to be either expr_if or expr_block (diff) | |
| parent | rustc: Cast the LLVM representations of tag types when constructing boxes. Un... (diff) | |
| download | rust-9fc4db6b89213afdf45c02fc2bd2be62b0ddc40c.tar.xz rust-9fc4db6b89213afdf45c02fc2bd2be62b0ddc40c.zip | |
Merge branch 'master' into recursive-elseif
Conflicts:
src/Makefile
src/comp/front/ast.rs
src/comp/front/parser.rs
src/comp/middle/fold.rs
src/comp/middle/trans.rs
Diffstat (limited to 'src/test/run-pass/arith-unsigned.rs')
| -rw-r--r-- | src/test/run-pass/arith-unsigned.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/run-pass/arith-unsigned.rs b/src/test/run-pass/arith-unsigned.rs new file mode 100644 index 00000000..3fac3714 --- /dev/null +++ b/src/test/run-pass/arith-unsigned.rs @@ -0,0 +1,24 @@ +// Unsigned integer operations + +fn main() { + check (0u8 < 255u8); + check (0u8 <= 255u8); + check (255u8 > 0u8); + check (255u8 >= 0u8); + check (250u8 / 10u8 == 25u8); + check (255u8 % 10u8 == 5u8); + check (0u16 < 60000u16); + check (0u16 <= 60000u16); + check (60000u16 > 0u16); + check (60000u16 >= 0u16); + check (60000u16 / 10u16 == 6000u16); + check (60005u16 % 10u16 == 5u16); + check (0u32 < 4000000000u32); + check (0u32 <= 4000000000u32); + check (4000000000u32 > 0u32); + check (4000000000u32 >= 0u32); + check (4000000000u32 / 10u32 == 400000000u32); + check (4000000005u32 % 10u32 == 5u32); + + // 64-bit numbers have some flakiness yet. Not tested +} |