Files
rust/tests/codegen/issue-98678-struct-union.rs
Matt Weber cc4f214a78 Split metadata testing into multiple files
This helps with the fact that the order in which debuginfo is emitted
differs between platforms, and is probably not guaranteed to be stable
in general.
2024-11-06 22:26:15 -05:00

24 lines
836 B
Rust

// This test verifies the accuracy of emitted file and line debuginfo metadata for structs and
// unions.
//
// compile-flags: -C debuginfo=2
#![crate_type = "lib"]
// CHECK: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}/codegen/issue-98678-struct-union.rs{{".*}})
// CHECK: !DICompositeType({{.*"}}MyType{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
pub struct MyType {
// CHECK: !DIDerivedType({{.*"}}i{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
i: i32,
}
// CHECK: !DICompositeType({{.*"}}MyUnion{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
pub union MyUnion {
// CHECK: !DIDerivedType({{.*"}}i{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
i: i32,
// CHECK: !DIDerivedType({{.*"}}f{{".*}}file: ![[#FILE]]{{.*}}line: [[# @LINE + 1]],
f: f32,
}
pub fn foo(_: MyType, _: MyUnion) {}