about summary refs log tree commit diff
path: root/tests/codegen/overaligned-constant.rs
diff options
context:
space:
mode:
authorErik Desjardins <erikdesjardins@users.noreply.github.com>2024-02-24 00:48:20 -0500
committerErik Desjardins <erikdesjardins@users.noreply.github.com>2024-04-11 21:42:35 -0400
commitf4426c189f2587fc5e8f48bf518cc75a37d93d0f (patch)
treeed47a319b54f5b7a420c8e73f54fc5c9814c8b0b /tests/codegen/overaligned-constant.rs
parenta07f3eb43acc5df851e15176c7081a900a30a4d7 (diff)
downloadrust-f4426c189f2587fc5e8f48bf518cc75a37d93d0f.tar.gz
rust-f4426c189f2587fc5e8f48bf518cc75a37d93d0f.zip
use [N x i8] for alloca types
Diffstat (limited to 'tests/codegen/overaligned-constant.rs')
-rw-r--r--tests/codegen/overaligned-constant.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/codegen/overaligned-constant.rs b/tests/codegen/overaligned-constant.rs
index 9e5b69ff267..7cd8d19c211 100644
--- a/tests/codegen/overaligned-constant.rs
+++ b/tests/codegen/overaligned-constant.rs
@@ -2,7 +2,7 @@
 // do not ICE during codegen, and that the LLVM constant has the higher alignment.
 //
 //@ compile-flags: -Zmir-opt-level=0 -Zmir-enable-passes=+GVN
-//@ compile-flags: -Cno-prepopulate-passes
+//@ compile-flags: -Cno-prepopulate-passes --crate-type=lib
 //@ only-64bit
 
 struct S(i32);
@@ -12,9 +12,10 @@ 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
+#[no_mangle]
+pub fn overaligned_constant() {
+    // CHECK-LABEL: @overaligned_constant
+    // CHECK: [[full:%_.*]] = alloca [32 x i8], 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 ({{.*}}), align 4