Added null_check_test
This commit is contained in:
parent
4e5db51091
commit
92cc1f00a8
|
@ -965,6 +965,20 @@ main := fn(): uint {
|
|||
}
|
||||
```
|
||||
|
||||
#### null_check_test
|
||||
```hb
|
||||
main := fn(): unit {
|
||||
ptr := @as(?^uint, null)
|
||||
*ptr = 0
|
||||
|
||||
if ptr == null {
|
||||
return 1
|
||||
}
|
||||
|
||||
return *ptr
|
||||
}
|
||||
```
|
||||
|
||||
### Just Testing Optimizations
|
||||
|
||||
#### const_folding_with_arg
|
||||
|
|
|
@ -4058,6 +4058,7 @@ mod tests {
|
|||
writing_into_string;
|
||||
request_page;
|
||||
tests_ptr_to_ptr_copy;
|
||||
null_check_test;
|
||||
|
||||
// Just Testing Optimizations;
|
||||
const_folding_with_arg;
|
||||
|
|
Loading…
Reference in a new issue