2023-01-21 19:02:34 +00:00
|
|
|
// ignore-tidy-linelength
|
2024-12-18 12:24:30 +00:00
|
|
|
//! This test verifies the accuracy of emitted file and line debuginfo metadata for structs and
|
|
|
|
//! unions.
|
|
|
|
|
|
|
|
//@ revisions: MSVC NONMSVC
|
|
|
|
//@[MSVC] only-msvc
|
|
|
|
//@[NONMSVC] ignore-msvc
|
|
|
|
//@ compile-flags: --crate-type=lib -Copt-level=0 -Cdebuginfo=2 -Zdebug-info-type-line-numbers=true
|
2023-01-21 19:02:34 +00:00
|
|
|
|
2024-12-03 02:59:34 +00:00
|
|
|
// NONMSVC: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*[/\\]}}issue-98678-struct-union.rs{{".*}})
|
2023-07-30 03:48:54 +00:00
|
|
|
// MSVC: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}\\issue-98678-struct-union.rs{{".*}})
|
2023-01-21 18:57:16 +00:00
|
|
|
|
|
|
|
// 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) {}
|