;; Test interesting integer "expressions". These tests contain code ;; patterns which tempt common value-changing optimizations. ;; Test that x+1>n is not folded to x. (module (func (export "i32.no_fold_shl_shr_s") (param $x i32) (result i32) (i32.shr_s (i32.shl (get_local $x) (i32.const 1)) (i32.const 1))) (func (export "i32.no_fold_shl_shr_u") (param $x i32) (result i32) (i32.shr_u (i32.shl (get_local $x) (i32.const 1)) (i32.const 1))) (func (export "i64.no_fold_shl_shr_s") (param $x i64) (result i64) (i64.shr_s (i64.shl (get_local $x) (i64.const 1)) (i64.const 1))) (func (export "i64.no_fold_shl_shr_u") (param $x i64) (result i64) (i64.shr_u (i64.shl (get_local $x) (i64.const 1)) (i64.const 1))) ) (assert_return (invoke "i32.no_fold_shl_shr_s" (i32.const 0x80000000)) (i32.const 0)) (assert_return (invoke "i32.no_fold_shl_shr_u" (i32.const 0x80000000)) (i32.const 0)) (assert_return (invoke "i64.no_fold_shl_shr_s" (i64.const 0x8000000000000000)) (i64.const 0)) (assert_return (invoke "i64.no_fold_shl_shr_u" (i64.const 0x8000000000000000)) (i64.const 0)) ;; Test that x>>n<