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
8 lines
187 B
Rust
8 lines
187 B
Rust
// Verifies that DWARF alignment is specified properly.
|
|
//
|
|
// compile-flags: -C debuginfo=2
|
|
#![crate_type = "lib"]
|
|
|
|
// CHECK: !DIGlobalVariable
|
|
// CHECK: align: 32
|
|
pub static A: u32 = 1;
|