Skip to content

Commit 3e2aa53

Browse files
committed
Explicitly register MSVC/NONMSVC revisions for some codegen tests
1 parent fa6a18d commit 3e2aa53

11 files changed

+76
-50
lines changed

tests/codegen/async-fn-debug-awaitee-field.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
// This test makes sure that the coroutine field capturing the awaitee in a `.await` expression
2-
// is called "__awaitee" in debuginfo. This name must not be changed since debuggers and debugger
3-
// extensions rely on the field having this name.
4-
51
// ignore-tidy-linelength
2+
//! This test makes sure that the coroutine field capturing the awaitee in a `.await` expression
3+
//! is called `__awaitee` in debuginfo. This name must not be changed since debuggers and debugger
4+
//! extensions rely on the field having this name.
5+
6+
//@ revisions: MSVC NONMSVC
7+
//@[MSVC] only-msvc
8+
//@[NONMSVC] ignore-msvc
9+
610
//@ compile-flags: -C debuginfo=2 --edition=2018 -Copt-level=0
711

812
#![crate_type = "lib"]

tests/codegen/debug-accessibility/crate-enum.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
//@ compile-flags: -C debuginfo=2
21
// ignore-tidy-linelength
2+
//! Checks that visibility information is present in the debuginfo for crate-visibility enums.
33
4-
#![allow(dead_code)]
4+
//@ revisions: MSVC NONMSVC
5+
//@[MSVC] only-msvc
6+
//@[NONMSVC] ignore-msvc
57

6-
// Checks that visibility information is present in the debuginfo for crate-visibility enums.
8+
//@ compile-flags: -C debuginfo=2
79

810
mod module {
911
use std::hint::black_box;

tests/codegen/debug-accessibility/private-enum.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
//@ compile-flags: -C debuginfo=2
21
// ignore-tidy-linelength
2+
//! Checks that visibility information is present in the debuginfo for private enums.
33
4-
#![allow(dead_code)]
5-
6-
// Checks that visibility information is present in the debuginfo for private enums.
4+
//@ revisions: MSVC NONMSVC
5+
//@[MSVC] only-msvc
6+
//@[NONMSVC] ignore-msvc
7+
//@ compile-flags: -C debuginfo=2
78

89
use std::hint::black_box;
910

tests/codegen/debug-accessibility/public-enum.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
//@ compile-flags: -C debuginfo=2
21
// ignore-tidy-linelength
2+
//! Checks that visibility information is present in the debuginfo for types and their fields.
33
4-
#![allow(dead_code)]
4+
//@ revisions: MSVC NONMSVC
5+
//@[MSVC] only-msvc
6+
//@[NONMSVC] ignore-msvc
57

6-
// Checks that visibility information is present in the debuginfo for types and their fields.
8+
//@ compile-flags: -C debuginfo=2
79

810
use std::hint::black_box;
911

tests/codegen/debug-accessibility/super-enum.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
//@ compile-flags: -C debuginfo=2
21
// ignore-tidy-linelength
2+
//! Checks that visibility information is present in the debuginfo for super-visibility enums.
33
4-
#![allow(dead_code)]
5-
6-
// Checks that visibility information is present in the debuginfo for super-visibility enums.
4+
//@ revisions: MSVC NONMSVC
5+
//@[MSVC] only-msvc
6+
//@[NONMSVC] ignore-msvc
7+
//@ compile-flags: -C debuginfo=2
78

89
mod module {
910
use std::hint::black_box;

tests/codegen/debug-vtable.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
// This test checks the debuginfo for the expected 3 vtables is generated for correct names and number
2-
// of entries.
1+
// ignore-tidy-linelength
2+
//! This test checks the debuginfo for the expected 3 vtables is generated for correct names and
3+
//! number of entries.
4+
5+
//@ revisions: MSVC NONMSVC
6+
//@[MSVC] only-msvc
7+
//@[NONMSVC] ignore-msvc
38

49
// Use the v0 symbol mangling scheme to codegen order independent of rustc version.
510
// Unnamed items like shims are generated in lexicographical order of their symbol name and in the
611
// legacy mangling scheme rustc version and generic parameters are both hashed into a single part
712
// of the name, thus randomizing item order with respect to rustc version.
813

914
//@ compile-flags: -Cdebuginfo=2 -Copt-level=0 -Csymbol-mangling-version=v0
10-
// ignore-tidy-linelength
1115

1216
// Make sure that vtables don't have the unnamed_addr attribute when debuginfo is enabled.
1317
// This helps debuggers more reliably map from dyn pointer to concrete type.

tests/codegen/debuginfo-generic-closure-env-names.rs

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
// This test checks that we get proper type names for closure environments and
2-
// async-fn environments in debuginfo, especially making sure that generic arguments
3-
// of the enclosing functions don't get lost.
4-
//
5-
// Unfortunately, the order that debuginfo gets emitted into LLVM IR becomes a bit hard
6-
// to predict once async fns are involved, so DAG allows any order.
7-
//
8-
// Note that the test does not check async-fns when targeting MSVC because debuginfo for
9-
// those does not follow the enum-fallback encoding yet and thus is incomplete.
10-
111
// ignore-tidy-linelength
2+
//! This test checks that we get proper type names for closure environments and
3+
//! async-fn environments in debuginfo, especially making sure that generic arguments
4+
//! of the enclosing functions don't get lost.
5+
//!
6+
//! Unfortunately, the order that debuginfo gets emitted into LLVM IR becomes a bit hard
7+
//! to predict once async fns are involved, so DAG allows any order.
8+
//!
9+
//! Note that the test does not check async-fns when targeting MSVC because debuginfo for
10+
//! those does not follow the enum-fallback encoding yet and thus is incomplete.
11+
12+
//@ revisions: MSVC NONMSVC
13+
//@[MSVC] only-msvc
14+
//@[NONMSVC] ignore-msvc
1215

1316
// Use the v0 symbol mangling scheme to codegen order independent of rustc version.
1417
// Unnamed items like shims are generated in lexicographical order of their symbol name and in the

tests/codegen/issues/issue-98678-async.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
// This test verifies the accuracy of emitted file and line debuginfo metadata for async blocks and
2-
// async functions.
3-
//
1+
// ignore-tidy-linelength
2+
//! This test verifies the accuracy of emitted file and line debuginfo metadata for async blocks and
3+
//! async functions.
4+
5+
//@ revisions: MSVC NONMSVC
6+
//@[MSVC] only-msvc
7+
//@[NONMSVC] ignore-msvc
48
//@ edition:2021
59
//@ compile-flags: --crate-type=lib -Copt-level=0 -Cdebuginfo=2 -Zdebug-info-type-line-numbers=true
610

7-
// ignore-tidy-linelength
8-
911
// NONMSVC-DAG: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*[/\\]}}issue-98678-async.rs{{".*}})
1012
// MSVC: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}\\issue-98678-async.rs{{".*}})
1113

tests/codegen/issues/issue-98678-closure-coroutine.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
// This test verifies the accuracy of emitted file and line debuginfo metadata for closures and
2-
// coroutines.
3-
//
4-
//@ compile-flags: --crate-type=lib -Copt-level=0 -Cdebuginfo=2 -Zdebug-info-type-line-numbers=true
1+
// ignore-tidy-linelength
2+
//! This test verifies the accuracy of emitted file and line debuginfo metadata for closures and
3+
//! coroutines.
4+
55
#![feature(coroutines, stmt_expr_attributes)]
66

7-
// ignore-tidy-linelength
7+
//@ revisions: MSVC NONMSVC
8+
//@[MSVC] only-msvc
9+
//@[NONMSVC] ignore-msvc
10+
//@ compile-flags: --crate-type=lib -Copt-level=0 -Cdebuginfo=2 -Zdebug-info-type-line-numbers=true
811

912
// NONMSVC-DAG: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*[/\\]}}issue-98678-closure-coroutine.rs{{".*}})
1013
// MSVC-DAG: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}\\issue-98678-closure-coroutine.rs{{".*}})

tests/codegen/issues/issue-98678-enum.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
// This test verifies the accuracy of emitted file and line debuginfo metadata enums.
2-
//
3-
//@ compile-flags: --crate-type=lib -Copt-level=0 -Cdebuginfo=2 -Zdebug-info-type-line-numbers=true
4-
51
// ignore-tidy-linelength
2+
//! This test verifies the accuracy of emitted file and line debuginfo metadata enums.
3+
4+
//@ revisions: MSVC NONMSVC
5+
//@[MSVC] only-msvc
6+
//@[NONMSVC] ignore-msvc
7+
//@ compile-flags: --crate-type=lib -Copt-level=0 -Cdebuginfo=2 -Zdebug-info-type-line-numbers=true
68

79
// NONMSVC: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*[/\\]}}issue-98678-enum.rs{{".*}})
810
// MSVC: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}\\issue-98678-enum.rs{{".*}})

tests/codegen/issues/issue-98678-struct-union.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
// This test verifies the accuracy of emitted file and line debuginfo metadata for structs and
2-
// unions.
3-
//
4-
//@ compile-flags: --crate-type=lib -Copt-level=0 -Cdebuginfo=2 -Zdebug-info-type-line-numbers=true
5-
61
// ignore-tidy-linelength
2+
//! This test verifies the accuracy of emitted file and line debuginfo metadata for structs and
3+
//! unions.
4+
5+
//@ revisions: MSVC NONMSVC
6+
//@[MSVC] only-msvc
7+
//@[NONMSVC] ignore-msvc
8+
//@ compile-flags: --crate-type=lib -Copt-level=0 -Cdebuginfo=2 -Zdebug-info-type-line-numbers=true
79

810
// NONMSVC: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*[/\\]}}issue-98678-struct-union.rs{{".*}})
911
// MSVC: ![[#FILE:]] = !DIFile({{.*}}filename:{{.*}}\\issue-98678-struct-union.rs{{".*}})

0 commit comments

Comments
 (0)