Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions tests/compiletests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@ contents of `path/to/test.rs.stderr`.
* remove rustc error src paths:
* `// normalize-stderr-test "\S*/lib/rustlib/" -> "$$SYSROOT/lib/rustlib/"` normalize path to crates delivered with rustc, such as `core`
* `// normalize-stderr-test "\S*/crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/"` normalize path to the `spirv-std` crate
* `// normalize-stderr-test "\.rs:\d+:\d+" -> ".rs:""` remove the line and column from error messages, eg. `--> path/to/some.rs:8:6`
* `// normalize-stderr-test "(\n)\d* *([ -])([\|\+\-\=])" -> "$1 $2$3""` remove the line number prefixing the source code snippet, does not touch `...`
2 changes: 2 additions & 0 deletions tests/compiletests/ui/arch/debug_printf_type_checking.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// build-fail
// normalize-stderr-test "\S*/crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/"
// compile-flags: -Ctarget-feature=+ext:SPV_KHR_non_semantic_info
// normalize-stderr-test "\.rs:\d+:\d+" -> ".rs:"
// normalize-stderr-test "(\n)\d* *([ -])([\|\+\-\=])" -> "$1 $2$3"

use spirv_std::spirv;
use spirv_std::{glam::Vec2, macros::debug_printf};
Expand Down
136 changes: 68 additions & 68 deletions tests/compiletests/ui/arch/debug_printf_type_checking.stderr
Original file line number Diff line number Diff line change
@@ -1,123 +1,123 @@
error: Unterminated format specifier: missing type after precision
--> $DIR/debug_printf_type_checking.rs:11:23
|
11 | debug_printf!("%1");
| ^^^^
--> $DIR/debug_printf_type_checking.rs:
|
| debug_printf!("%1");
| ^^^^

error: Unterminated format specifier: missing type after decimal point
--> $DIR/debug_printf_type_checking.rs:12:23
|
12 | debug_printf!("%1.");
| ^^^^^
--> $DIR/debug_printf_type_checking.rs:
|
| debug_printf!("%1.");
| ^^^^^

error: Unrecognised format specifier: '.'
--> $DIR/debug_printf_type_checking.rs:13:23
|
13 | debug_printf!("%.");
| ^^^^
--> $DIR/debug_printf_type_checking.rs:
|
| debug_printf!("%.");
| ^^^^

error: Unrecognised format specifier: '.'
--> $DIR/debug_printf_type_checking.rs:14:23
|
14 | debug_printf!("%.1");
| ^^^^^
--> $DIR/debug_printf_type_checking.rs:
|
| debug_printf!("%.1");
| ^^^^^

error: Unterminated format specifier: missing type after fraction precision
--> $DIR/debug_printf_type_checking.rs:15:23
|
15 | debug_printf!("%1.1");
| ^^^^^^
--> $DIR/debug_printf_type_checking.rs:
|
| debug_printf!("%1.1");
| ^^^^^^

error: Missing vector dimensions specifier
--> $DIR/debug_printf_type_checking.rs:16:23
|
16 | debug_printf!("%1.1v");
| ^^^^^^^
--> $DIR/debug_printf_type_checking.rs:
|
| debug_printf!("%1.1v");
| ^^^^^^^

error: Invalid width for vector: 5
--> $DIR/debug_printf_type_checking.rs:17:23
|
17 | debug_printf!("%1.1v5");
| ^^^^^^^^
--> $DIR/debug_printf_type_checking.rs:
|
| debug_printf!("%1.1v5");
| ^^^^^^^^

error: Missing vector type specifier
--> $DIR/debug_printf_type_checking.rs:18:23
|
18 | debug_printf!("%1.1v2");
| ^^^^^^^^
--> $DIR/debug_printf_type_checking.rs:
|
| debug_printf!("%1.1v2");
| ^^^^^^^^

error: Unrecognised vector type specifier: 'r'
--> $DIR/debug_printf_type_checking.rs:19:23
|
19 | debug_printf!("%1.1v2r");
| ^^^^^^^^^
--> $DIR/debug_printf_type_checking.rs:
|
| debug_printf!("%1.1v2r");
| ^^^^^^^^^

error: Unrecognised format specifier: 'r'
--> $DIR/debug_printf_type_checking.rs:20:23
|
20 | debug_printf!("%r", 11_i32);
| ^^^^
--> $DIR/debug_printf_type_checking.rs:
|
| debug_printf!("%r", 11_i32);
| ^^^^

error[E0308]: mismatched types
--> $DIR/debug_printf_type_checking.rs:21:29
--> $DIR/debug_printf_type_checking.rs:
|
21 | debug_printf!("%f", 11_u32);
| debug_printf!("%f", 11_u32);
| --------------------^^^^^^-
| | |
| | expected `f32`, found `u32`
| arguments to this function are incorrect
|
help: the return type of this call is `u32` due to the type of the argument passed
--> $DIR/debug_printf_type_checking.rs:21:9
--> $DIR/debug_printf_type_checking.rs:
|
21 | debug_printf!("%f", 11_u32);
| debug_printf!("%f", 11_u32);
| ^^^^^^^^^^^^^^^^^^^^------^
| |
| this argument influences the return type of `debug_printf_assert_is_type`
note: function defined here
--> $SPIRV_STD_SRC/lib.rs:134:8
--> $SPIRV_STD_SRC/lib.rs:
|
134 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
| pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
help: change the type of the numeric literal from `u32` to `f32`
|
21 - debug_printf!("%f", 11_u32);
21 + debug_printf!("%f", 11_f32);
- debug_printf!("%f", 11_u32);
+ debug_printf!("%f", 11_f32);
|

error[E0308]: mismatched types
--> $DIR/debug_printf_type_checking.rs:22:29
--> $DIR/debug_printf_type_checking.rs:
|
22 | debug_printf!("%u", 11.0_f32);
| debug_printf!("%u", 11.0_f32);
| --------------------^^^^^^^^-
| | |
| | expected `u32`, found `f32`
| arguments to this function are incorrect
|
help: the return type of this call is `f32` due to the type of the argument passed
--> $DIR/debug_printf_type_checking.rs:22:9
--> $DIR/debug_printf_type_checking.rs:
|
22 | debug_printf!("%u", 11.0_f32);
| debug_printf!("%u", 11.0_f32);
| ^^^^^^^^^^^^^^^^^^^^--------^
| |
| this argument influences the return type of `debug_printf_assert_is_type`
note: function defined here
--> $SPIRV_STD_SRC/lib.rs:134:8
--> $SPIRV_STD_SRC/lib.rs:
|
134 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
| pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)
help: change the type of the numeric literal from `f32` to `u32`
|
22 - debug_printf!("%u", 11.0_f32);
22 + debug_printf!("%u", 11u32);
- debug_printf!("%u", 11.0_f32);
+ debug_printf!("%u", 11u32);
|

error[E0277]: the trait bound `{float}: Vector<f32, 2>` is not satisfied
--> $DIR/debug_printf_type_checking.rs:23:9
--> $DIR/debug_printf_type_checking.rs:
|
23 | debug_printf!("%v2f", 11.0);
| debug_printf!("%v2f", 11.0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Vector<f32, 2>` is not implemented for `{float}`
|
= help: the following other types implement trait `Vector<T, N>`:
Expand All @@ -131,35 +131,35 @@ error[E0277]: the trait bound `{float}: Vector<f32, 2>` is not satisfied
`IVec3` implements `Vector<i32, 3>`
and 8 others
note: required by a bound in `debug_printf_assert_is_vector`
--> $SPIRV_STD_SRC/lib.rs:141:8
--> $SPIRV_STD_SRC/lib.rs:
|
139 | pub fn debug_printf_assert_is_vector<
| pub fn debug_printf_assert_is_vector<
| ----------------------------- required by a bound in this function
140 | TY: crate::scalar::Scalar,
141 | V: crate::vector::Vector<TY, SIZE>,
| TY: crate::scalar::Scalar,
| V: crate::vector::Vector<TY, SIZE>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `debug_printf_assert_is_vector`
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
--> $DIR/debug_printf_type_checking.rs:24:29
--> $DIR/debug_printf_type_checking.rs:
|
24 | debug_printf!("%f", Vec2::splat(33.3));
| debug_printf!("%f", Vec2::splat(33.3));
| --------------------^^^^^^^^^^^^^^^^^-
| | |
| | expected `f32`, found `Vec2`
| arguments to this function are incorrect
|
help: the return type of this call is `Vec2` due to the type of the argument passed
--> $DIR/debug_printf_type_checking.rs:24:9
--> $DIR/debug_printf_type_checking.rs:
|
24 | debug_printf!("%f", Vec2::splat(33.3));
| debug_printf!("%f", Vec2::splat(33.3));
| ^^^^^^^^^^^^^^^^^^^^-----------------^
| |
| this argument influences the return type of `debug_printf_assert_is_type`
note: function defined here
--> $SPIRV_STD_SRC/lib.rs:134:8
--> $SPIRV_STD_SRC/lib.rs:
|
134 | pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
| pub fn debug_printf_assert_is_type<T>(ty: T) -> T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `debug_printf` (in Nightly builds, run with -Z macro-backtrace for more info)

Expand Down
1 change: 1 addition & 0 deletions tests/compiletests/ui/arch/subgroup/subgroup_ballot.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// build-pass
// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformBallot,+ext:SPV_KHR_vulkan_memory_model
// compile-flags: -C llvm-args=--disassemble-fn=subgroup_ballot::subgroup_ballot
// normalize-stderr-test "OpLine .*\n" -> ""

use spirv_std::spirv;

Expand Down
2 changes: 0 additions & 2 deletions tests/compiletests/ui/arch/subgroup/subgroup_ballot.stderr
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
%1 = OpFunction %2 None %3
%4 = OpFunctionParameter %2
%5 = OpLabel
OpLine %6 364 13
%7 = OpGroupNonUniformBallot %8 %9 %4
OpLine %6 403 13
%10 = OpGroupNonUniformInverseBallot %2 %9 %7
OpNoLine
OpReturnValue %10
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// build-pass
// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformBallot,+ext:SPV_KHR_vulkan_memory_model
// compile-flags: -C llvm-args=--disassemble-fn=subgroup_ballot_bit_count::subgroup_ballot_bit_count
// normalize-stderr-test "OpLine .*\n" -> ""

use spirv_std::arch::{GroupOperation, SubgroupMask};
use spirv_std::spirv;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
%1 = OpFunction %2 None %3
%4 = OpFunctionParameter %5
%6 = OpLabel
OpLine %7 498 0
%8 = OpGroupNonUniformBallotBitCount %2 %9 Reduce %4
OpNoLine
OpReturnValue %8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// build-pass
// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformBallot,+ext:SPV_KHR_vulkan_memory_model
// compile-flags: -C llvm-args=--disassemble-fn=subgroup_broadcast_first::subgroup_broadcast_first
// normalize-stderr-test "OpLine .*\n" -> ""

use glam::Vec3;
use spirv_std::spirv;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
%1 = OpFunction %2 None %3
%4 = OpFunctionParameter %2
%5 = OpLabel
OpLine %6 331 13
%7 = OpGroupNonUniformBroadcastFirst %2 %8 %4
OpNoLine
OpReturnValue %7
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// build-pass
// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformArithmetic,+GroupNonUniformClustered,+ext:SPV_KHR_vulkan_memory_model
// normalize-stderr-test "\S*/crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/"
// normalize-stderr-test "\.rs:\d+:\d+" -> ".rs:"
// normalize-stderr-test "(\n)\d* *([ -])([\|\+\-\=])" -> "$1 $2$3"

use glam::UVec3;
use spirv_std::arch::{GroupOperation, SubgroupMask};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
error[E0080]: evaluation panicked: `ClusterSize` must be at least 1
--> $SPIRV_STD_SRC/arch/subgroup.rs:826:1
--> $SPIRV_STD_SRC/arch/subgroup.rs:
|
826 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r"
827 | | An integer add group operation of all `value` operands contributed by active invocations in the group.
828 | |
829 | | Result Type must be a scalar or vector of integer type.
| / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r"
| | An integer add group operation of all `value` operands contributed by active invocations in the group.
| |
| | Result Type must be a scalar or vector of integer type.
... |
842 | | * `ClusterSize` must not be greater than the size of the group
843 | | ");
| | * `ClusterSize` must not be greater than the size of the group
| | ");
| |__^ evaluation of `spirv_std::arch::subgroup_clustered_i_add::<0, u32, u32>::{constant#0}` failed here
|
= 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)

note: erroneous constant encountered
--> $SPIRV_STD_SRC/arch/subgroup.rs:826:1
--> $SPIRV_STD_SRC/arch/subgroup.rs:
|
826 | / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r"
827 | | An integer add group operation of all `value` operands contributed by active invocations in the group.
828 | |
829 | | Result Type must be a scalar or vector of integer type.
| / macro_subgroup_op_clustered!(impl Integer, "OpGroupNonUniformIAdd", subgroup_clustered_i_add; r"
| | An integer add group operation of all `value` operands contributed by active invocations in the group.
| |
| | Result Type must be a scalar or vector of integer type.
... |
842 | | * `ClusterSize` must not be greater than the size of the group
843 | | ");
| | * `ClusterSize` must not be greater than the size of the group
| | ");
| |__^
|
= note: this note originates in the macro `macro_subgroup_op_clustered` (in Nightly builds, run with -Z macro-backtrace for more info)

note: the above error was encountered while instantiating `fn spirv_std::arch::subgroup_clustered_i_add::<0, u32, u32>`
--> $DIR/subgroup_cluster_size_0_fail.rs:10:5
|
10 | spirv_std::arch::subgroup_clustered_i_add::<0, _>(value)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--> $DIR/subgroup_cluster_size_0_fail.rs:
|
| spirv_std::arch::subgroup_clustered_i_add::<0, _>(value)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// build-pass
// compile-flags: -C target-feature=+GroupNonUniform,+GroupNonUniformArithmetic,+GroupNonUniformClustered,+ext:SPV_KHR_vulkan_memory_model
// normalize-stderr-test "\S*/crates/spirv-std/src/" -> "$$SPIRV_STD_SRC/"
// normalize-stderr-test "\.rs:\d+:\d+" -> ".rs:"
// normalize-stderr-test "(\n)\d* *([ -])([\|\+\-\=])" -> "$1 $2$3"

use glam::UVec3;
use spirv_std::arch::{GroupOperation, SubgroupMask};
Expand Down
Loading