diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-05-01 18:32:35 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-01 18:32:35 +0900 |
| commit | fc850b6c606ccf67e5ea88e94cf2188af62c67ff (patch) | |
| tree | e8e09106f691dac6956ee0297bd00570478f1a7f /compiler/rustc_codegen_cranelift/example/std_example.rs | |
| parent | a4dbb8c9097157c8e51002c0b4d4216e04466338 (diff) | |
| parent | ef53ebc5da969ae92ce47eebbdc3697803965ad3 (diff) | |
| download | rust-fc850b6c606ccf67e5ea88e94cf2188af62c67ff.tar.gz rust-fc850b6c606ccf67e5ea88e94cf2188af62c67ff.zip | |
Rollup merge of #84749 - XAMPPRocky:cranelift-rebase, r=bjorn3
Sync `rustc_codegen_cranelift` Retrying #84746 r? ``@bjorn3`` --- Edit(bjorn3): Since the last sync there have been some refactorings around the driver code in preparation for a planned new feature. In addition ``@mominul`` implemented `-Ctarget-cpu` support and ``@XAMPPRocky`` fixed compilation of cg_clif itself for Windows with the MSVC toolchain.
Diffstat (limited to 'compiler/rustc_codegen_cranelift/example/std_example.rs')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/example/std_example.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_cranelift/example/std_example.rs b/compiler/rustc_codegen_cranelift/example/std_example.rs index 015bbdfed46..77ba72df8ef 100644 --- a/compiler/rustc_codegen_cranelift/example/std_example.rs +++ b/compiler/rustc_codegen_cranelift/example/std_example.rs @@ -48,6 +48,8 @@ fn main() { assert_eq!(2.3f32.copysign(-1.0), -2.3f32); println!("{}", 2.3f32.powf(2.0)); + assert_eq!(i64::MAX.checked_mul(2), None); + assert_eq!(-128i8, (-128i8).saturating_sub(1)); assert_eq!(127i8, 127i8.saturating_sub(-128)); assert_eq!(-128i8, (-128i8).saturating_add(-128)); @@ -84,6 +86,7 @@ fn main() { assert_eq!(houndred_i128 as f64, 100.0); assert_eq!(houndred_f32 as i128, 100); assert_eq!(houndred_f64 as i128, 100); + assert_eq!(1u128.rotate_left(2), 4); // Test signed 128bit comparing let max = usize::MAX as i128; |
