Skip to content

Fix repr128-dwarf test #138263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions tests/run-make/repr128-dwarf/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,15 @@ fn main() {
while let Some((_, entry)) = cursor.next_dfs().unwrap() {
match entry.tag() {
gimli::constants::DW_TAG_variant if !is_old_llvm => {
let value = match entry
.attr(gimli::constants::DW_AT_discr_value)
.unwrap()
.unwrap()
.value()
{
let Some(value) = entry.attr(gimli::constants::DW_AT_discr_value).unwrap()
else {
// `std` enums might have variants without `DW_AT_discr_value`.
continue;
};
let value = match value.value() {
AttributeValue::Block(value) => value.to_slice().unwrap().to_vec(),
value => panic!("unexpected DW_AT_discr_value of {value:?}"),
// `std` has non-repr128 enums which don't use `AttributeValue::Block`.
value => continue,
};
// The `DW_TAG_member` that is a child of `DW_TAG_variant` will contain the
// variant's name.
Expand Down
Loading