diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-12-17 23:31:45 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-12-17 23:31:58 +0000 |
| commit | 503af0deb2789e35f7c1b0b61c5f0e5ddf8425db (patch) | |
| tree | 7074dafbf10a7ee9bbfec2b597e3e3675c36283d /tests/codegen | |
| parent | 3ea5cfaa11ce82b3d16385e16b770b4749463406 (diff) | |
| download | rust-503af0deb2789e35f7c1b0b61c5f0e5ddf8425db.tar.gz rust-503af0deb2789e35f7c1b0b61c5f0e5ddf8425db.zip | |
Fortify test.
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/overaligned-constant.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/codegen/overaligned-constant.rs b/tests/codegen/overaligned-constant.rs index 5f4dc3173c8..c94dfd85e7d 100644 --- a/tests/codegen/overaligned-constant.rs +++ b/tests/codegen/overaligned-constant.rs @@ -1,7 +1,7 @@ // GVN may create indirect constants with higher alignment than their type requires. Verify that we // do not ICE during codegen, and that the LLVM constant has the higher alignment. // -// compile-flags: -O -Zmir-enable-passes=+GVN -Cdebuginfo=2 +// compile-flags: -Zmir-opt-level=0 -Zmir-enable-passes=+GVN // compile-flags: -Cno-prepopulate-passes // only-64bit @@ -9,7 +9,15 @@ struct S(i32); struct SmallStruct(f32, Option<S>, &'static [f32]); +// CHECK: @0 = private unnamed_addr constant +// CHECK-SAME: , align 8 + fn main() { + // CHECK-LABEL: @_ZN20overaligned_constant4main + // CHECK: [[full:%_.*]] = alloca %SmallStruct, align 8 + // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[full]], ptr align 8 @0, i64 32, i1 false) + // CHECK: %b.0 = load i32, ptr @0, align 4, + // CHECK: %b.1 = load i32, ptr getelementptr inbounds ({ i32, i32 }, ptr @0, i32 0, i32 1), align 4 let mut s = S(1); s.0 = 3; @@ -26,6 +34,3 @@ fn main() { // alignment 8, but only use the `Option<S>` field, at offset 0 with alignment 4. let SmallStruct(a, b, c) = SMALL_VAL; } - -// CHECK: @0 = private unnamed_addr constant -// CHECK-SAME: , align 8 |
