Skip to content

Commit eab4b5b

Browse files
Firestar99LegNeato
authored andcommitted
tests: add for_range_signed test
1 parent 02cefd1 commit eab4b5b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tests/ui/lang/control_flow/for_range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
use spirv_std::spirv;
44

55
#[spirv(fragment)]
6-
pub fn main(#[spirv(flat)] i: i32) {
6+
pub fn main(#[spirv(flat)] i: u32) {
77
for _ in 0..i {}
88
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// build-fail
2+
// normalize-stderr-test "\S*/library/core/src/" -> "$$CORE_SRC/"
3+
4+
// FIXME(eddyb) this should work, but `unchecked_add_unsigned` doesn't exist,
5+
// so range internals use `a.checked_add_unsigned(b).unwrap_unchecked()` instead,
6+
// and that requires working `overflowing_add`, which we don't yet have.
7+
8+
use spirv_std::spirv;
9+
10+
#[spirv(fragment)]
11+
pub fn main(#[spirv(flat)] i: i32) {
12+
for _ in 0..i {}
13+
}

0 commit comments

Comments
 (0)