about summary refs log tree commit diff
path: root/tests/codegen-llvm/align-static.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-10 15:09:18 +0000
committerbors <bors@rust-lang.org>2025-09-10 15:09:18 +0000
commit565a9ca63e9df4b223fed0da01f15e578acfb538 (patch)
treefdbc4245cfe17954d617a6f3c9b89c025ff128cb /tests/codegen-llvm/align-static.rs
parent7ad23f43a225546c095123de52cc07d8719f8e2b (diff)
parent212baec446dd7fc7bbda66a4b3b0e2f856d575ce (diff)
downloadrust-565a9ca63e9df4b223fed0da01f15e578acfb538.tar.gz
rust-565a9ca63e9df4b223fed0da01f15e578acfb538.zip
Auto merge of #146409 - matthiaskrgr:rollup-thju381, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#144765 (inclusive `Range`s: change `end` to `last`)
 - rust-lang/rust#146178 (Implement `#[rustc_align_static(N)]` on `static`s)
 - rust-lang/rust#146368 (CI: rfl: move job forward to Linux v6.17-rc5 to remove temporary commits)
 - rust-lang/rust#146378 (Update wasm-component-ld to 0.5.17)
 - rust-lang/rust#146391 (Trim paths less in MIR dumping)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/codegen-llvm/align-static.rs')
-rw-r--r--tests/codegen-llvm/align-static.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/codegen-llvm/align-static.rs b/tests/codegen-llvm/align-static.rs
new file mode 100644
index 00000000000..53db998919a
--- /dev/null
+++ b/tests/codegen-llvm/align-static.rs
@@ -0,0 +1,31 @@
+//@ compile-flags: -C no-prepopulate-passes -Z mir-opt-level=0
+
+#![crate_type = "lib"]
+#![feature(static_align)]
+
+// CHECK: @STATIC_ALIGN =
+// CHECK-SAME: align 16
+#[no_mangle]
+#[rustc_align_static(16)]
+pub static STATIC_ALIGN: u64 = 0;
+
+// CHECK: @ALIGN_SPECIFIED_TWICE_1 =
+// CHECK-SAME: align 64
+#[no_mangle]
+#[rustc_align_static(32)]
+#[rustc_align_static(64)]
+pub static ALIGN_SPECIFIED_TWICE_1: u64 = 0;
+
+// CHECK: @ALIGN_SPECIFIED_TWICE_2 =
+// CHECK-SAME: align 128
+#[no_mangle]
+#[rustc_align_static(128)]
+#[rustc_align_static(32)]
+pub static ALIGN_SPECIFIED_TWICE_2: u64 = 0;
+
+// CHECK: @ALIGN_SPECIFIED_TWICE_3 =
+// CHECK-SAME: align 256
+#[no_mangle]
+#[rustc_align_static(32)]
+#[rustc_align_static(256)]
+pub static ALIGN_SPECIFIED_TWICE_3: u64 = 0;