forked from EmbarkStudios/rust-gpu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test accounting for rust-lang/rust#87723.
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Test that using `(a..b).contains(&x)`, which is starting to get used | ||
// in `core` (see https://github.com/rust-lang/rust/pull/87723), cannot | ||
// cause a fatal error, but at most a zombie or SPIR-V validation error. | ||
|
||
// build-fail | ||
|
||
use spirv_std as _; | ||
|
||
fn has_two_decimal_digits(x: u32) -> bool { | ||
(10..100).contains(&x) | ||
} | ||
|
||
#[spirv(fragment)] | ||
pub fn main(i: u32, o: &mut bool) { | ||
*o = has_two_decimal_digits(i); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error: error:0:0 - In Logical addressing, variables may not allocate a pointer type | ||
%49 = OpVariable %_ptr_Function__ptr_Function_uint Function | ||
|
||
| | ||
= note: spirv-val failed | ||
= note: module `$TEST_BUILD_DIR/lang/core/ops/range-contains.stage-id.spv.dir/module` | ||
|
||
error: aborting due to previous error | ||
|