Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
dd4562a18f4a91e40ba701019af33ab80c1b2886
rust/tests/codegen-llvm/debug-alignment.rs

9 lines
188 B
Rust
Raw Normal View History

Specify DWARF alignment in bits, not bytes. In DWARF, alignment of types is specified in bits, as is made clear by the parameter name `AlignInBits`. However, `rustc` was incorrectly passing a byte alignment. This commit fixes that. This was noticed in upstream LLVM when I tried to check in a test consisting of LLVM IR generated from `rustc` and it triggered assertions [1]. [1]: https://reviews.llvm.org/D126835
2022-06-07 13:38:35 -07:00
// Verifies that DWARF alignment is specified properly.
//
[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives
2024-02-22 12:10:29 +00:00
//@ compile-flags: -C debuginfo=2
Specify DWARF alignment in bits, not bytes. In DWARF, alignment of types is specified in bits, as is made clear by the parameter name `AlignInBits`. However, `rustc` was incorrectly passing a byte alignment. This commit fixes that. This was noticed in upstream LLVM when I tried to check in a test consisting of LLVM IR generated from `rustc` and it triggered assertions [1]. [1]: https://reviews.llvm.org/D126835
2022-06-07 13:38:35 -07:00
#![crate_type = "lib"]
// CHECK: !DIGlobalVariable
// CHECK: align: 32
pub static A: u32 = 1;
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 755ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API