Sha256: f1b921b205d0f6120faaccd8138e5db8c42e9ab548eb3fbef643f3cfc8be03d0

Contents?: true

Size: 1.39 KB

Versions: 30

Compression:

Stored size: 1.39 KB

Contents

mod iconst;

struct Context;
impl iconst::Context for Context {}

fn main() {
    let mut ctx = Context;

    assert_eq!(iconst::constructor_X(&mut ctx, -1), Some(-2));
    assert_eq!(iconst::constructor_X(&mut ctx, -2), Some(-3));
    assert_eq!(
        iconst::constructor_X(&mut ctx, 0x7fff_ffff_ffff_ffff),
        Some(0x8000_0000_0000_0000u64 as i64)
    );
    assert_eq!(
        iconst::constructor_X(&mut ctx, 0xffff_ffff_ffff_fff0_u64 as i64),
        Some(1)
    );

    assert_eq!(
        iconst::constructor_Y(&mut ctx, 0x1000_0000_0000_0000_1234_5678_9abc_def0),
        Some(-1)
    );
    assert_eq!(
        iconst::constructor_Y(
            &mut ctx,
            0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffffu128 as i128
        ),
        Some(3)
    );
    assert_eq!(
        iconst::constructor_Y(&mut ctx, -0x1000_0000_0000_0000_1234_5678_9abc_def0),
        Some(1)
    );
    assert_eq!(
        iconst::constructor_Y(
            &mut ctx,
            -(0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffffu128 as i128)
        ),
        Some(-3)
    );

    assert_eq!(iconst::constructor_Z(&mut ctx, 0), Some(1));
    assert_eq!(iconst::constructor_Z(&mut ctx, 1), Some(2));
    assert_eq!(iconst::constructor_Z(&mut ctx, 2), Some(3));
    assert_eq!(iconst::constructor_Z(&mut ctx, 3), Some(4));
    assert_eq!(
        iconst::constructor_Z(&mut ctx, 0o7654321),
        Some(0b11_00_11_00)
    );
}

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
wasmtime-28.0.0 ./ext/cargo-vendor/cranelift-isle-0.115.0/isle_examples/run/iconst_main.rs
wasmtime-27.0.0 ./ext/cargo-vendor/cranelift-isle-0.114.0/isle_examples/run/iconst_main.rs
wasmtime-26.0.0 ./ext/cargo-vendor/cranelift-isle-0.113.0/isle_examples/run/iconst_main.rs
wasmtime-25.0.2 ./ext/cargo-vendor/cranelift-isle-0.112.2/isle_examples/run/iconst_main.rs
wasmtime-25.0.1 ./ext/cargo-vendor/cranelift-isle-0.112.1/isle_examples/run/iconst_main.rs
wasmtime-25.0.0 ./ext/cargo-vendor/cranelift-isle-0.112.0/isle_examples/run/iconst_main.rs
wasmtime-24.0.0 ./ext/cargo-vendor/cranelift-isle-0.111.0/isle_examples/run/iconst_main.rs
wasmtime-23.0.2 ./ext/cargo-vendor/cranelift-isle-0.110.2/isle_examples/run/iconst_main.rs
wasmtime-22.0.0 ./ext/cargo-vendor/cranelift-isle-0.109.0/isle_examples/run/iconst_main.rs
wasmtime-21.0.1 ./ext/cargo-vendor/cranelift-isle-0.108.1/isle_examples/run/iconst_main.rs
wasmtime-20.0.2 ./ext/cargo-vendor/cranelift-isle-0.107.2/isle_examples/run/iconst_main.rs
wasmtime-20.0.0 ./ext/cargo-vendor/cranelift-isle-0.107.2/isle_examples/run/iconst_main.rs
wasmtime-18.0.3 ./ext/cargo-vendor/cranelift-isle-0.105.3/isle_examples/run/iconst_main.rs
wasmtime-17.0.1 ./ext/cargo-vendor/cranelift-isle-0.104.1/isle_examples/run/iconst_main.rs
wasmtime-17.0.0 ./ext/cargo-vendor/cranelift-isle-0.104.0/isle_examples/run/iconst_main.rs
wasmtime-16.0.0 ./ext/cargo-vendor/cranelift-isle-0.103.0/isle_examples/run/iconst_main.rs
wasmtime-15.0.1 ./ext/cargo-vendor/cranelift-isle-0.102.1/isle_examples/run/iconst_main.rs
wasmtime-15.0.0 ./ext/cargo-vendor/cranelift-isle-0.102.1/isle_examples/run/iconst_main.rs
wasmtime-14.0.4 ./ext/cargo-vendor/cranelift-isle-0.101.4/isle_examples/run/iconst_main.rs
wasmtime-14.0.3 ./ext/cargo-vendor/cranelift-isle-0.101.4/isle_examples/run/iconst_main.rs