adding assert for better error
This commit is contained in:
parent
63f2a0dac0
commit
dd51961fbb
|
@ -633,6 +633,30 @@ main := fn(): uint {
|
|||
|
||||
### Purely Testing Examples
|
||||
|
||||
#### triggering_store_in_divergent_branch
|
||||
```hb
|
||||
opaque := fn(): uint {
|
||||
return 1 << 31
|
||||
}
|
||||
|
||||
main := fn(): void {
|
||||
a := 0
|
||||
loop if a >= opaque() break else {
|
||||
valid := true
|
||||
b := 0
|
||||
loop if b >= opaque() break else {
|
||||
if b == 1 << 16 {
|
||||
valid = false
|
||||
break
|
||||
}
|
||||
b += 1
|
||||
}
|
||||
if valid == false continue
|
||||
a += 1
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### very_nested_loops
|
||||
```hb
|
||||
$W := 200
|
||||
|
|
|
@ -4823,6 +4823,7 @@ mod tests {
|
|||
fb_driver;
|
||||
|
||||
// Purely Testing Examples;
|
||||
triggering_store_in_divergent_branch;
|
||||
wrong_dead_code_elimination;
|
||||
memory_swap;
|
||||
very_nested_loops;
|
||||
|
|
|
@ -130,6 +130,7 @@ impl BitSet {
|
|||
}
|
||||
|
||||
let (elem, bit) = Self::indexes(index);
|
||||
debug_assert!(elem < data.len(), "{} < {}", elem, data.len());
|
||||
let elem = unsafe { data.get_unchecked_mut(elem) };
|
||||
let prev = *elem;
|
||||
*elem |= 1 << bit;
|
||||
|
|
Loading…
Reference in a new issue