diff options
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/fewer-names.rs | 4 | ||||
| -rw-r--r-- | tests/codegen/option-as-slice.rs | 18 | ||||
| -rw-r--r-- | tests/codegen/simd-wide-sum.rs | 2 | ||||
| -rw-r--r-- | tests/codegen/var-names.rs | 4 |
4 files changed, 18 insertions, 10 deletions
diff --git a/tests/codegen/fewer-names.rs b/tests/codegen/fewer-names.rs index ac8cba06b48..7f383a5c149 100644 --- a/tests/codegen/fewer-names.rs +++ b/tests/codegen/fewer-names.rs @@ -13,8 +13,8 @@ pub fn sum(x: u32, y: u32) -> u32 { // NO-LABEL: define{{.*}}i32 @sum(i32 noundef %x, i32 noundef %y) // NO-NEXT: start: -// NO-NEXT: %z = add i32 %y, %x -// NO-NEXT: ret i32 %z +// NO-NEXT: %0 = add i32 %y, %x +// NO-NEXT: ret i32 %0 let z = x + y; z } diff --git a/tests/codegen/option-as-slice.rs b/tests/codegen/option-as-slice.rs index d5077dbf6cc..d735d558374 100644 --- a/tests/codegen/option-as-slice.rs +++ b/tests/codegen/option-as-slice.rs @@ -1,4 +1,4 @@ -// compile-flags: -O +// compile-flags: -O -Z randomize-layout=no // only-x86_64 #![crate_type = "lib"] @@ -12,17 +12,25 @@ use core::option::Option; // CHECK-LABEL: @u64_opt_as_slice #[no_mangle] pub fn u64_opt_as_slice(o: &Option<u64>) -> &[u64] { - // CHECK: start: // CHECK-NOT: select - // CHECK: ret + // CHECK-NOT: br + // CHECK-NOT: switch + // CHECK-NOT: icmp o.as_slice() } // CHECK-LABEL: @nonzero_u64_opt_as_slice #[no_mangle] pub fn nonzero_u64_opt_as_slice(o: &Option<NonZeroU64>) -> &[NonZeroU64] { - // CHECK: start: // CHECK-NOT: select - // CHECK: ret + // CHECK-NOT: br + // CHECK-NOT: switch + // CHECK-NOT: icmp + // CHECK: %[[NZ:.+]] = icmp ne i64 %{{.+}}, 0 + // CHECK-NEXT: zext i1 %[[NZ]] to i64 + // CHECK-NOT: select + // CHECK-NOT: br + // CHECK-NOT: switch + // CHECK-NOT: icmp o.as_slice() } diff --git a/tests/codegen/simd-wide-sum.rs b/tests/codegen/simd-wide-sum.rs index 04314dc291a..db2aa20bde7 100644 --- a/tests/codegen/simd-wide-sum.rs +++ b/tests/codegen/simd-wide-sum.rs @@ -1,4 +1,4 @@ -// compile-flags: -C opt-level=3 --edition=2021 +// compile-flags: -C opt-level=3 -Z merge-functions=disabled --edition=2021 // only-x86_64 // ignore-debug: the debug assertions get in the way diff --git a/tests/codegen/var-names.rs b/tests/codegen/var-names.rs index d4715efad73..53841df32e8 100644 --- a/tests/codegen/var-names.rs +++ b/tests/codegen/var-names.rs @@ -9,7 +9,7 @@ pub fn test(a: u32, b: u32) -> u32 { // CHECK: %c = add i32 %a, %b let d = c; let e = d * a; - // CHECK-NEXT: %e = mul i32 %c, %a + // CHECK-NEXT: %0 = mul i32 %c, %a e - // CHECK-NEXT: ret i32 %e + // CHECK-NEXT: ret i32 %0 } |
