Skip to content

Commit c3c424a

Browse files
committed
compiletests: normalize relative spirv-std paths in stderr
1 parent b54de5f commit c3c424a

22 files changed

+94
-81
lines changed

tests/compiletests/ui/arch/debug_printf_type_checking.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// build-fail
22
// normalize-stderr-test "\S*/crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/"
3+
// normalize-stderr-test "crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/"
34
// compile-flags: -Ctarget-feature=+ext:SPV_KHR_non_semantic_info
45

56
use spirv_std::spirv;

tests/compiletests/ui/arch/debug_printf_type_checking.stderr

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
11
error: Unterminated format specifier: missing type after precision
2-
--> $DIR/debug_printf_type_checking.rs:11:23
2+
--> $DIR/debug_printf_type_checking.rs:12:23
33
|
44
LL | debug_printf!("%1");
55
| ^^^^
66

77
error: Unterminated format specifier: missing type after decimal point
8-
--> $DIR/debug_printf_type_checking.rs:12:23
8+
--> $DIR/debug_printf_type_checking.rs:13:23
99
|
1010
LL | debug_printf!("%1.");
1111
| ^^^^^
1212

1313
error: Unrecognised format specifier: '.'
14-
--> $DIR/debug_printf_type_checking.rs:13:23
14+
--> $DIR/debug_printf_type_checking.rs:14:23
1515
|
1616
LL | debug_printf!("%.");
1717
| ^^^^
1818

1919
error: Unrecognised format specifier: '.'
20-
--> $DIR/debug_printf_type_checking.rs:14:23
20+
--> $DIR/debug_printf_type_checking.rs:15:23
2121
|
2222
LL | debug_printf!("%.1");
2323
| ^^^^^
2424

2525
error: Unterminated format specifier: missing type after fraction precision
26-
--> $DIR/debug_printf_type_checking.rs:15:23
26+
--> $DIR/debug_printf_type_checking.rs:16:23
2727
|
2828
LL | debug_printf!("%1.1");
2929
| ^^^^^^
3030

3131
error: Missing vector dimensions specifier
32-
--> $DIR/debug_printf_type_checking.rs:16:23
32+
--> $DIR/debug_printf_type_checking.rs:17:23
3333
|
3434
LL | debug_printf!("%1.1v");
3535
| ^^^^^^^
3636

3737
error: Invalid width for vector: 5
38-
--> $DIR/debug_printf_type_checking.rs:17:23
38+
--> $DIR/debug_printf_type_checking.rs:18:23
3939
|
4040
LL | debug_printf!("%1.1v5");
4141
| ^^^^^^^^
4242

4343
error: Missing vector type specifier
44-
--> $DIR/debug_printf_type_checking.rs:18:23
44+
--> $DIR/debug_printf_type_checking.rs:19:23
4545
|
4646
LL | debug_printf!("%1.1v2");
4747
| ^^^^^^^^
4848

4949
error: Unrecognised vector type specifier: 'r'
50-
--> $DIR/debug_printf_type_checking.rs:19:23
50+
--> $DIR/debug_printf_type_checking.rs:20:23
5151
|
5252
LL | debug_printf!("%1.1v2r");
5353
| ^^^^^^^^^
5454

5555
error: Unrecognised format specifier: 'r'
56-
--> $DIR/debug_printf_type_checking.rs:20:23
56+
--> $DIR/debug_printf_type_checking.rs:21:23
5757
|
5858
LL | debug_printf!("%r", 11_i32);
5959
| ^^^^
6060

6161
error[E0308]: mismatched types
62-
--> $DIR/debug_printf_type_checking.rs:21:29
62+
--> $DIR/debug_printf_type_checking.rs:22:29
6363
|
6464
LL | debug_printf!("%f", 11_u32);
6565
| --------------------^^^^^^-
@@ -68,14 +68,14 @@ LL | debug_printf!("%f", 11_u32);
6868
| arguments to this function are incorrect
6969
|
7070
help: the return type of this call is `u32` due to the type of the argument passed
71-
--> $DIR/debug_printf_type_checking.rs:21:9
71+
--> $DIR/debug_printf_type_checking.rs:22:9
7272
|
7373
LL | debug_printf!("%f", 11_u32);
7474
| ^^^^^^^^^^^^^^^^^^^^------^
7575
| |
7676
| this argument influences the return type of `assert_is_type`
7777
note: function defined here
78-
--> crates/spirv-std/src/debug_printf.rs:6:7
78+
--> $SPIRV_STD_SRC/debug_printf.rs:6:7
7979
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
8080
help: change the type of the numeric literal from `u32` to `f32`
8181
|
@@ -84,7 +84,7 @@ LL + debug_printf!("%f", 11_f32);
8484
|
8585

8686
error[E0308]: mismatched types
87-
--> $DIR/debug_printf_type_checking.rs:22:29
87+
--> $DIR/debug_printf_type_checking.rs:23:29
8888
|
8989
LL | debug_printf!("%u", 11.0_f32);
9090
| --------------------^^^^^^^^-
@@ -93,14 +93,14 @@ LL | debug_printf!("%u", 11.0_f32);
9393
| arguments to this function are incorrect
9494
|
9595
help: the return type of this call is `f32` due to the type of the argument passed
96-
--> $DIR/debug_printf_type_checking.rs:22:9
96+
--> $DIR/debug_printf_type_checking.rs:23:9
9797
|
9898
LL | debug_printf!("%u", 11.0_f32);
9999
| ^^^^^^^^^^^^^^^^^^^^--------^
100100
| |
101101
| this argument influences the return type of `assert_is_type`
102102
note: function defined here
103-
--> crates/spirv-std/src/debug_printf.rs:6:7
103+
--> $SPIRV_STD_SRC/debug_printf.rs:6:7
104104
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
105105
help: change the type of the numeric literal from `f32` to `u32`
106106
|
@@ -109,7 +109,7 @@ LL + debug_printf!("%u", 11u32);
109109
|
110110

111111
error[E0277]: the trait bound `{float}: spirv_std::Vector<f32, 2>` is not satisfied
112-
--> $DIR/debug_printf_type_checking.rs:23:9
112+
--> $DIR/debug_printf_type_checking.rs:24:9
113113
|
114114
LL | debug_printf!("%v2f", 11.0);
115115
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `spirv_std::Vector<f32, 2>` is not implemented for `{float}`
@@ -125,11 +125,11 @@ LL | debug_printf!("%v2f", 11.0);
125125
`IVec3` implements `spirv_std::Vector<i32, 3>`
126126
and 8 others
127127
note: required by a bound in `spirv_std::debug_printf::assert_is_vector`
128-
--> crates/spirv-std/src/debug_printf.rs:11:0
128+
--> $SPIRV_STD_SRC/debug_printf.rs:11:0
129129
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
130130

131131
error[E0308]: mismatched types
132-
--> $DIR/debug_printf_type_checking.rs:24:29
132+
--> $DIR/debug_printf_type_checking.rs:25:29
133133
|
134134
LL | debug_printf!("%f", Vec2::splat(33.3));
135135
| --------------------^^^^^^^^^^^^^^^^^-
@@ -138,14 +138,14 @@ LL | debug_printf!("%f", Vec2::splat(33.3));
138138
| arguments to this function are incorrect
139139
|
140140
help: the return type of this call is `Vec2` due to the type of the argument passed
141-
--> $DIR/debug_printf_type_checking.rs:24:9
141+
--> $DIR/debug_printf_type_checking.rs:25:9
142142
|
143143
LL | debug_printf!("%f", Vec2::splat(33.3));
144144
| ^^^^^^^^^^^^^^^^^^^^-----------------^
145145
| |
146146
| this argument influences the return type of `assert_is_type`
147147
note: function defined here
148-
--> crates/spirv-std/src/debug_printf.rs:6:7
148+
--> $SPIRV_STD_SRC/debug_printf.rs:6:7
149149
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
150150

151151
error: aborting due to 14 previous errors

tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_0_fail.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// build-pass
22
// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformArithmetic,+GroupNonUniformClustered,+ext:SPV_KHR_vulkan_memory_model
33
// normalize-stderr-test "\S*/crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/"
4+
// normalize-stderr-test "crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/"
45
// normalize-stderr-test "\S*/lib/rustlib/" -> "$$SYSROOT/lib/rustlib/"
6+
// normalize-stderr-test "\$SYSROOT/lib/rustlib/src/rust/library/core/src/panic.rs:\d+:\d+" -> "$$SYSROOT/lib/rustlib/src/rust/library/core/src/panic.rs:LL:CC"
57

68
use glam::UVec3;
79
use spirv_std::arch::{GroupOperation, SubgroupMask};

tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_0_fail.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
error[E0080]: evaluation panicked: `ClusterSize` must be at least 1
2-
--> $SYSROOT/lib/rustlib/src/rust/library/core/src/panic.rs:62:9
2+
--> $SYSROOT/lib/rustlib/src/rust/library/core/src/panic.rs:LL:CC
33
|
44
LL | $crate::panicking::panic_fmt($crate::const_format_args!($($t)+));
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `spirv_std::arch::subgroup_clustered_i_add::<0, u32, u32>::{constant#0}` failed here
66
|
7-
--> crates/spirv-std/src/arch/subgroup.rs:937:0
8-
::: crates/spirv-std/src/arch/subgroup.rs:954:2
7+
--> $SPIRV_STD_SRC/arch/subgroup.rs:937:0
8+
::: $SPIRV_STD_SRC/arch/subgroup.rs:954:2
99
|
1010
= note: in this macro invocation
1111
|
1212
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info)
1313

1414
note: erroneous constant encountered
15-
--> crates/spirv-std/src/arch/subgroup.rs:890:12
16-
::: crates/spirv-std/src/arch/subgroup.rs:954:2
15+
--> $SPIRV_STD_SRC/arch/subgroup.rs:890:12
16+
::: $SPIRV_STD_SRC/arch/subgroup.rs:954:2
1717
|
1818
= note: in this macro invocation
1919
|
2020
= note: this note originates in the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info)
2121

2222
note: the above error was encountered while instantiating `fn subgroup_clustered_i_add::<0, u32, u32>`
23-
--> $DIR/subgroup_cluster_size_0_fail.rs:11:5
23+
--> $DIR/subgroup_cluster_size_0_fail.rs:13:5
2424
|
2525
LL | spirv_std::arch::subgroup_clustered_i_add::<0, _>(value)
2626
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_non_power_of_two_fail.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// build-pass
22
// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformArithmetic,+GroupNonUniformClustered,+ext:SPV_KHR_vulkan_memory_model
33
// normalize-stderr-test "\S*/crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/"
4+
// normalize-stderr-test "crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/"
45
// normalize-stderr-test "\S*/lib/rustlib/" -> "$$SYSROOT/lib/rustlib/"
6+
// normalize-stderr-test "\$SYSROOT/lib/rustlib/src/rust/library/core/src/panic.rs:\d+:\d+" -> "$$SYSROOT/lib/rustlib/src/rust/library/core/src/panic.rs:LL:CC"
57

68
use glam::UVec3;
79
use spirv_std::arch::{GroupOperation, SubgroupMask};

tests/compiletests/ui/arch/subgroup/subgroup_cluster_size_non_power_of_two_fail.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
error[E0080]: evaluation panicked: `ClusterSize` must be a power of 2
2-
--> $SYSROOT/lib/rustlib/src/rust/library/core/src/panic.rs:62:9
2+
--> $SYSROOT/lib/rustlib/src/rust/library/core/src/panic.rs:LL:CC
33
|
44
LL | $crate::panicking::panic_fmt($crate::const_format_args!($($t)+));
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `spirv_std::arch::subgroup_clustered_i_add::<5, u32, u32>::{constant#0}` failed here
66
|
7-
--> crates/spirv-std/src/arch/subgroup.rs:937:0
8-
::: crates/spirv-std/src/arch/subgroup.rs:954:2
7+
--> $SPIRV_STD_SRC/arch/subgroup.rs:937:0
8+
::: $SPIRV_STD_SRC/arch/subgroup.rs:954:2
99
|
1010
= note: in this macro invocation
1111
|
1212
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info)
1313

1414
note: erroneous constant encountered
15-
--> crates/spirv-std/src/arch/subgroup.rs:890:12
16-
::: crates/spirv-std/src/arch/subgroup.rs:954:2
15+
--> $SPIRV_STD_SRC/arch/subgroup.rs:890:12
16+
::: $SPIRV_STD_SRC/arch/subgroup.rs:954:2
1717
|
1818
= note: in this macro invocation
1919
|
2020
= note: this note originates in the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info)
2121

2222
note: the above error was encountered while instantiating `fn subgroup_clustered_i_add::<5, u32, u32>`
23-
--> $DIR/subgroup_cluster_size_non_power_of_two_fail.rs:11:5
23+
--> $DIR/subgroup_cluster_size_non_power_of_two_fail.rs:13:5
2424
|
2525
LL | spirv_std::arch::subgroup_clustered_i_add::<5, _>(value)
2626
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/compiletests/ui/arch/subgroup/subgroup_composite_enum_err.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// build-fail
22
// normalize-stderr-test "\S*/crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/"
3+
// normalize-stderr-test "crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/"
34
// normalize-stderr-test "\.rs:\d+:\d+" -> ".rs:"
45
// normalize-stderr-test "(\n)\d* *([ -])([\|\+\-\=])" -> "$1 $2$3"
56

tests/compiletests/ui/dis/ptr_copy.normal.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
error: cannot memcpy dynamically sized data
2-
--> $CORE_SRC/ptr/mod.rs>:642:9
2+
--> <$CORE_SRC/ptr/mod.rs>:642:9
33
|
44
LL | crate::intrinsics::copy(src, dst, count)
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
note: used from within `core::ptr::copy::<f32>`
8-
--> $CORE_SRC/ptr/mod.rs>:627:21
8+
--> <$CORE_SRC/ptr/mod.rs>:627:21
99
|
1010
LL | pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
1111
| ^^^^
1212
note: called by `ptr_copy::copy_via_raw_ptr`
13-
--> <$DIR/ptr_copy.rs>:28:18
13+
--> <$DIR/ptr_copy.rs>:29:18
1414
|
1515
LL | unsafe { core::ptr::copy(src, dst, 1) }
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1717
note: called by `ptr_copy::main`
18-
--> <$DIR/ptr_copy.rs>:33:5
18+
--> <$DIR/ptr_copy.rs>:34:5
1919
|
2020
LL | copy_via_raw_ptr(&i, o);
2121
| ^^^^^^^^^^^^^^^^^^^^^^^
2222
note: called by `main`
23-
--> <$DIR/ptr_copy.rs>:32:8
23+
--> <$DIR/ptr_copy.rs>:33:8
2424
|
2525
LL | pub fn main(i: f32, o: &mut f32) {
2626
| ^^^^

tests/compiletests/ui/dis/ptr_copy.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// revisions: normal via_intrinsic
22
//[normal] build-fail
3+
// normalize-stderr-test "<\S*/library/core/src/" -> "<$$CORE_SRC/"
34
// normalize-stderr-test "\S*/library/core/src/" -> "$$CORE_SRC/"
45
//[via_intrinsic] build-pass
56
// compile-flags: -C llvm-args=--disassemble-fn=ptr_copy::copy_via_raw_ptr

tests/compiletests/ui/dis/ptr_copy.via_intrinsic.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
%4 = OpFunctionParameter %5
33
%6 = OpFunctionParameter %5
44
%7 = OpLabel
5-
OpLine %8 17 17
5+
OpLine %8 18 17
66
OpCopyMemory %6 %4
77
OpNoLine
88
OpReturn

0 commit comments

Comments
 (0)