diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-06-08 13:43:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-08 13:43:19 +0200 |
| commit | 82a1d79dffd5e6ba86271046f795a4235d734845 (patch) | |
| tree | a505e884701454c9f93bf5165b8edae21e4140d3 /src/test/codegen/debug-alignment.rs | |
| parent | 29c6f5f60322663349f0a167fedc7240f498dd7b (diff) | |
| parent | fe533e862cd2d2d65e14970d327365dfe593aa27 (diff) | |
| download | rust-82a1d79dffd5e6ba86271046f795a4235d734845.tar.gz rust-82a1d79dffd5e6ba86271046f795a4235d734845.zip | |
Rollup merge of #97846 - pcwalton:align-bits, r=michaelwoerister
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
Diffstat (limited to 'src/test/codegen/debug-alignment.rs')
| -rw-r--r-- | src/test/codegen/debug-alignment.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/codegen/debug-alignment.rs b/src/test/codegen/debug-alignment.rs new file mode 100644 index 00000000000..f6c1062e0fc --- /dev/null +++ b/src/test/codegen/debug-alignment.rs @@ -0,0 +1,8 @@ +// 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; |
