Skip to content

Commit

Permalink
Update wasm test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Apr 23, 2021
1 parent 35ae752 commit ed6dd40
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 173 deletions.
162 changes: 0 additions & 162 deletions src/test/codegen/wasm_casts_nontrapping.rs

This file was deleted.

23 changes: 12 additions & 11 deletions src/test/codegen/wasm_casts_trapping.rs
@@ -1,13 +1,14 @@
// only-wasm32
// compile-flags: -C target-feature=-nontrapping-fptoint
// min-llvm-version: 12.0
#![crate_type = "lib"]

// CHECK-LABEL: @cast_f64_i64
#[no_mangle]
pub fn cast_f64_i64(a: f64) -> i64 {
// CHECK-NOT: fptosi double {{.*}} to i64
// CHECK-NOT: select i1 {{.*}}, i64 {{.*}}, i64 {{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.wasm.trunc.{{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.fptosi.sat.i64.f64{{.*}}
a as _
}

Expand All @@ -16,7 +17,7 @@ pub fn cast_f64_i64(a: f64) -> i64 {
pub fn cast_f64_i32(a: f64) -> i32 {
// CHECK-NOT: fptosi double {{.*}} to i32
// CHECK-NOT: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.wasm.trunc.{{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.fptosi.sat.i32.f64{{.*}}
a as _
}

Expand All @@ -25,7 +26,7 @@ pub fn cast_f64_i32(a: f64) -> i32 {
pub fn cast_f32_i64(a: f32) -> i64 {
// CHECK-NOT: fptosi float {{.*}} to i64
// CHECK-NOT: select i1 {{.*}}, i64 {{.*}}, i64 {{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.wasm.trunc.{{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.fptosi.sat.i64.f32{{.*}}
a as _
}

Expand All @@ -34,7 +35,7 @@ pub fn cast_f32_i64(a: f32) -> i64 {
pub fn cast_f32_i32(a: f32) -> i32 {
// CHECK-NOT: fptosi float {{.*}} to i32
// CHECK-NOT: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.wasm.trunc.{{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.fptosi.sat.i32.f32{{.*}}
a as _
}

Expand All @@ -43,7 +44,7 @@ pub fn cast_f32_i32(a: f32) -> i32 {
pub fn cast_f64_u64(a: f64) -> u64 {
// CHECK-NOT: fptoui double {{.*}} to i64
// CHECK-NOT: select i1 {{.*}}, i64 {{.*}}, i64 {{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.wasm.trunc.{{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.fptoui.sat.i64.f64{{.*}}
a as _
}

Expand All @@ -52,7 +53,7 @@ pub fn cast_f64_u64(a: f64) -> u64 {
pub fn cast_f64_u32(a: f64) -> u32 {
// CHECK-NOT: fptoui double {{.*}} to i32
// CHECK-NOT: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.wasm.trunc.{{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.fptoui.sat.i32.f64{{.*}}
a as _
}

Expand All @@ -61,7 +62,7 @@ pub fn cast_f64_u32(a: f64) -> u32 {
pub fn cast_f32_u64(a: f32) -> u64 {
// CHECK-NOT: fptoui float {{.*}} to i64
// CHECK-NOT: select i1 {{.*}}, i64 {{.*}}, i64 {{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.wasm.trunc.{{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.fptoui.sat.i64.f32{{.*}}
a as _
}

Expand All @@ -70,16 +71,16 @@ pub fn cast_f32_u64(a: f32) -> u64 {
pub fn cast_f32_u32(a: f32) -> u32 {
// CHECK-NOT: fptoui float {{.*}} to i32
// CHECK-NOT: select i1 {{.*}}, i32 {{.*}}, i32 {{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.wasm.trunc.{{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.fptoui.sat.i32.f32{{.*}}
a as _
}

// CHECK-LABEL: @cast_f32_u8
#[no_mangle]
pub fn cast_f32_u8(a: f32) -> u8 {
// CHECK-NOT: {{.*}} call {{.*}} @llvm.wasm.trunc.{{.*}}
// CHECK: fptoui float {{.*}} to i8
// CHECK-NEXT: select i1 {{.*}}, i8 {{.*}}, i8 {{.*}}
// CHECK-NOT: fptoui float {{.*}} to i8
// CHECK-NOT: select i1 {{.*}}, i8 {{.*}}, i8 {{.*}}
// CHECK: {{.*}} call {{.*}} @llvm.fptoui.sat.i8.f32{{.*}}
a as _
}

Expand Down

0 comments on commit ed6dd40

Please sign in to comment.